Why does IIS Express lock files stopping build, rebuild and clean in ASP.Net Core?

Viewed 432

Every once in a while (and happening to me right now) I'll have a project and something goes wrong and I don't know what. It will just stop me from building my project. It just writes this out a million times for each file:

Severity Code Description Project File Line Suppression State Warning MSB3026 Could not copy "obj\Debug\netcoreapp3.1\WebApp.dll" to "bin\Debug\netcoreapp3.1\WebApp.dll". Beginning retry 1 in 1000ms. The process cannot access the file 'bin\Debug\netcoreapp3.1\WebApp.dll' because it is being used by another process. The file is locked by: "iisexpress.exe (10396)" WebApp C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets 4183

IIS is not even in my tray. How do I kill the process? And why in the world does it do this in the first place?

Very annoying. Lose to much time for this stupid thing.

1 Answers

Open the Task Manager => find out the IISExpress process => end task. Now you can compile the code. this does not need Visual Studio restart.

Related