Failed to copy .exe file in Visual Studio 2017

I have a main asp.net project that links to .NET Framework and I am using Visual Studio 2017 Enterprise. When I try to build my solution I ran into this error:

Unable to copy file "obj\Debug\net461\MyProject.exe" to "bin\Debug\net461\MyProject.exe". 
Access to the path 'bin\Debug\net461\MyProject.exe' is denied.

      

Even though I cleaned up the solution and build again, I still have this error.

Has anyone encountered this error?

+3


source to share


1 answer


Go to Task Manager and search for Microsoftvshost.exe and kill them all. Even if you stop debugging, the exe may continue to run in the background. This causes the file to be locked.



+4


source







All Articles