I\'ve been having this problem for a while now. I created a brand new winforms c# application in Visual Studio. I can usually launch it in debug mode once without a problem.
I added a web service/reference to my Web Server and then my Visual Studio went all crazy and wouldnt recoginze and custom controls or web services. The pages worked for the end users.. Just had access / recognition issues in VS.
I saw a few posts to remove cache files in C:\Users\gklein\AppData\Roaming\Microsoft\VisualStudio\10.0\ReflectedSchemas - I did that but it didnt work for me...
What did work was when i recompiled the web server, there was an error about access to C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\remedy\7642007a\c5be7720\App_WebReference file/folder...
My web server runs impersonating a global network user with elevated access rights...But they recently migrated my pc to a new domain where that user has no rights. The web site couldnt compile (as that user) on my pc. - Once I manually added that global network user as an admin on my pc... cleared cache and restarted VS.. IT WORKED!!!
hope my experience helps some else tooo
Have you tried enable windows service 'Application Experience'? This solved my problem after struggling for several days.
http://www.codeproject.com/Questions/296249/Visual-Studio-2010-Access-Denied-Errors
I had the same problem, by running VS2019 as administrator solved the issue.
I recently had this issue. I manually deleted and replaced the file and continued to have the access error. I restarted my laptop and I was able to build and run my project.
An XML file generated by my solution had the Read-only attribute set for a file version generated by another build. After the Read-only attribute was turned off for this file, my build ran without the path is denied error.
I've been experiencing this problem now for the last 9 months, in VS2015 and VS2017 community editions. It appears that the compiler continues to live after the first compile for about 20 minutes, all the while holding locks on the files.
My workaround is to kill the compiler, then rebuild. This always works without any apparent adverse side effects.
You can kill the compiler from the Package Manager Console (or from PowerShell) with this code:
Get-Process | where {$_.ProcessName -eq "VBCSCompiler"} | foreach {Stop-Process -Id $_.Id}
Hope this helps you as it has me for the past couple of months.