Error the process cannot access the file because it is being used by another process while building project by CLI on .NET Core

后端 未结 8 1259
一个人的身影
一个人的身影 2021-01-11 23:56

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         


        
8条回答
  •  情话喂你
    2021-01-12 00:24

    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...

提交回复
热议问题