Share via


Visual Studio Troubleshooting: Compilation Error - Access to the path is denied

Symptoms

So you bumped into this error while trying to compile a project that says:

Access to the path <..> is denied.

Troubleshooting options

Below some options what can you do which may possibly fix your issue.

Administrator

Make sure you run your VS as administrator.

Read only

Check for the file on which request is denied error is thrown has the read only property unchecked.

File lock

Try deleting the file if you are able to do indicates there is no lock on the file, if not :kill the process which is having the lock. In this situation restart is a good medicine. Please use your discretion while doing that.

Recompile

Trying clean from the visual studio and recompile after you have verified the above two. If still not in luck. Close all the instances of VS and go to Task Manager and see if there are any active instances of VS.

Process explorer

Use process explorer to verify as well: https://technet.microsoft.com/en-us/sysinternals/bb896653

Application experience

Turn on windows service :- Application experience

Computer (right-click) -> manage -> Service & Application -> service -> Enable Application experience.