Solved

C# app.exe Access Denied

Posted on 2016-09-03
11
18 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 69

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
 
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now