I got following error while running dotnet build
command on my .NET Core project.
C:\\Program Files\\dotnet\\sdk\\2.1.2\\Microsoft.Common.Curre
The solution for me is to stop the IIS Express processes by right-clicking on the taskbar icon.
Or you can make a command line in "Pre-Build Event":
$(Solution)taskkill /FI "IMAGENAME eq iisexpress.exe" /F
Add this command in the "Properties" of your projet > "Build Events"
We don't have time to see if the command has been executed properly in "Ouput" view into "Build" section. Add this command line in "Pre-Build Event" to see the results:
cmd /c pause
You can remove this line after check...
If your web server is IIS you can put an empty file named app_offline.htm
in the project root, which will gracefully shut down the app.
I have it scripted like so:
dotnet build
For those like me who have this issue on a shared host with no access to anything whatsoever, don't try to copy your dll directly via panel or FTP, zip it then upload it then extract it this way it works in Plesk panel.
Most likely an open .Net core process running and blocking, if on windows, just kill it through the task manager.
I have experienced the same issue when adding a new migration class. My Visual Studio (2017) instance was constantly freezing and when I restarted Visual Studio I started getting similar messages. What helped me was to kill the dotnet.exe process via Windows Task Manager.
Your ASP.Net application is running from the same directory, that is why you couldn't build your code. You have following options:
I would go with first option, but if you have difficulty finding out how to do it, last option is the easiest. In any case if for any reason you couldn't restart your computer, second one will surely work.