Build error: “The process cannot access the file because it is being used by another process”

后端 未结 30 1838
青春惊慌失措
青春惊慌失措 2020-12-13 03:08

I\'ve got a C# webforms app, that until today had been working just swimmingly.

Now today, all of a sudden, every time I try run the app, I get a file l

相关标签:
30条回答
  • 2020-12-13 03:38

    One more solution: when the files get locked, blocking process is reported (something like "ServiceHub.Host.CLR.x64 (7764)") with it's id in parentheses. To get rid of the process, open PowerShell (x + Win + I) and type: "Stop-Process -Id idNumber".

    0 讨论(0)
  • 2020-12-13 03:40

    I have found a simple solution which works for me. It goes like this:

    When the problem occurs, just change the building configuration at the top (if in “Release” to “Debug” and vice versa), build and then change back to previous configuration and build again.

    screenshot

    I suppose that changing the configuration releases the vcshost and devenv.

    0 讨论(0)
  • 2020-12-13 03:41

    I have overcome this problem by renaming the locked file (using Windows Explorer). I was not allowed to delete the file, but renaming the locked file works!

    0 讨论(0)
  • 2020-12-13 03:41

    I had the same issue on my Xamarin application in visual studio and it was resolved by unplugging my test mobile device. The application was closed and the debugger was stopped but the error was still happening when trying to build or rebuild the solution. It only stopped after i unplugged the device because i had to receive a call.

    0 讨论(0)
  • 2020-12-13 03:41

    I had the same issue and could not rectify by using any of the methods mentioned in previous answers. I resolved the issue by killing all instances of "SSIS Debug Hist (32 bit)" in task manager and now working as normal.

    0 讨论(0)
  • 2020-12-13 03:42

    Run this command from the Run box:

    net stop iisadmin /y
    

    and then

    iisreset
    

    worked for me. vs 2003

    0 讨论(0)
提交回复
热议问题