Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug in Visual Studio 2017 gives access denied

I have installed Visual Studio on Windows server 2012 and now I'm trying to debug an existing project. This gives me 'Error while trying to run project - access denied' I have now problems running the project without debugging.

I have restarted Studio and no files are read-only

like image 425
Paul Sorensen Avatar asked Oct 02 '17 06:10

Paul Sorensen


People also ask

How do I fix Access Denied issues?

Right-click the file or folder, and then click Properties. Click the Security tab. Under Group or user names, click your name to see the permissions that you have. Click Edit, click your name, select the check boxes for the permissions that you must have, and then click OK.

How do I fix the Debug executable in Visual Studio?

Just use File/Open Project/Solution, select EXE file and Open it. Then select Debug/Start debugging. The other option is to run the EXE first and then Select Debug/Attach to process.

How do I enable debugging code in Visual Studio?

To bring up the Run and Debug view, select the Run and Debug icon in the Activity Bar on the side of VS Code. You can also use the keyboard shortcut Ctrl+Shift+D. The Run and Debug view displays all information related to running and debugging and has a top bar with debugging commands and configuration settings.


2 Answers

Found the solution enable 'use managed compatibility mode' in the debugging>general section of VS2017 options. found here:https://developercommunity.visualstudio.com/content/problem/49763/access-denied-when-attempting-to-run-under-the-deb.html

like image 57
Paul Sorensen Avatar answered Sep 27 '22 23:09

Paul Sorensen


Access Denied errors can occur if a file has an unresolved lock on it. This can happen whether or not your file, typically the executable that you just compiled, is read-only or not.

The easiest way to clear a lock like that is to reboot your system. Or if you're unwilling to reboot or you just want to make one file available again, you could use a tool such as Process Explorer to find the process that is using the file, and either close the program or kill that process.

like image 40
eksortso Avatar answered Sep 27 '22 21:09

eksortso