Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C# app.exe Access Denied

Posted on 2016-09-03
11
Medium Priority
?
110 Views
Last Modified: 2016-09-09
I created a console app.  I'm trying to test it.  When I run it I get "Access is Denied."  Do not know why.  I am an administrator on my personal computer.

Any ideas?
0
Comment
Question by:CipherIS
  • 6
  • 4
11 Comments
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 41783405
Does it actually start?
What does it attempt to do when it is starting?
Have you tried the 'run as administrator' option from the context menu when you right click on the exe?
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 41783621
you are surely trying to access a resource (network drive or something else) that is not available. On which line of code do you have the error? You will need to trace your application to find out.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 41783794
the EXE is on my C:\ drive under a subdirectory.
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
LVL 45

Expert Comment

by:AndyAinscow
ID: 41783796
Please answer the questions you have been asked.
0
 
LVL 1

Author Comment

by:CipherIS
ID: 41783915
I don't have a line of code.  I am running it from the command line and I am receiving an "access denied".  Right now I'm just writing a simple console app and will expand on it.  Like a Hello World for an example.  I'm testing passing parameters into it.  

Just wanted to write the parameters out before I went further in the code.  When I went to test it I received the "Access Denied" from the command prompt.  I'm glad I found this issue now before I went further with the development.
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 41783926
>>I don't have a line of code.

So it is basically the following:
Main()
{
}
0
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 41783927
And to repeat myself:

Does it actually start?
What does it attempt to do when it is starting?
Have you tried the 'run as administrator' option from the context menu when you right click on the exe?

The first two seemed to be answered by no and absolutely nothing but what about the third?
0
 
LVL 1

Author Comment

by:CipherIS
ID: 41783932
Does it actually start?
-  No.  Nothing is happening.  

What does it attempt to do when starting?
-  It's a simple code.  I am getting the string[] args and just doing a Console.WriteLine.  That is all at the moment.

Have you tried the 'run as administrator'....
I set the "Run as administrator" after right clicking on the EXE and it's still "Access Denied".

 Error.jpg
0
 
LVL 1

Author Comment

by:CipherIS
ID: 41784057
The one thing I did differently was run vsvars32.bat prior to doing anything.  I wrote a simple Hello World Winform and that won't open from the EXE.  I can run it in .NET but it is not running when I go to the bin directory and double click on the EXE..

I'm using VS 2015.
0
 
LVL 1

Accepted Solution

by:
CipherIS earned 0 total points
ID: 41784117
I rebooted my computer and it seems to be working.  Weird.  Thanks.
0
 
LVL 1

Author Closing Comment

by:CipherIS
ID: 41791023
Rebooting seems to have solved the issue.
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question