Solved

C# app.exe Access Denied

Posted on 2016-09-03
11
24 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 44

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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 44

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 44

Expert Comment

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

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

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.Net Report Printing Issue 3 31
Switching Visual Studio 2015 to normal debug display 3 25
.NET 2008 VB and C# 6 27
JSON  parse help 7 19
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

786 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