Unable to copy file reference.dll to bin/reference.dll. The process cannot access the file reference.dll because it is being used by another process

后端 未结 30 1935
深忆病人
深忆病人 2021-01-31 03:34

For one of my ASP.NET 3.5 applications, every single time I try to build the web app, it throws the following build errors in Visual Studio 2008:

Error 16

相关标签:
30条回答
  • 2021-01-31 04:05

    I had this issue on a web project with System.Web.Extensions.dll from the Microsoft Reference Assemblies folder. Setting "Copy Local" to false in the reference properties fixed it.

    0 讨论(0)
  • 2021-01-31 04:06

    You could download the excellent SysInternals Handle program. This will tell you which processes have a lock on the files concerned.

    If it is an external program (e.g. virus scanner/indexer) then this should help. If it just reports Visual Studio (devenv.exe) as the culprit, then it will be of less help!

    0 讨论(0)
  • 2021-01-31 04:08

    Check if the user dll and the application referencing the dll target the same .NET framework. I had a case where the frameworks were different which caused this problem.

    0 讨论(0)
  • 2021-01-31 04:09

    Just go to \Debug\bin and delete all .dll files.

    Working great for me.

    0 讨论(0)
  • 2021-01-31 04:09

    Delete the binaries from the bin\Debug folder and recompile them. This works for me!!!

    0 讨论(0)
  • 2021-01-31 04:12

    I didn't have any luck with the pre-build events unfortunately. What worked, in typical IT Crowd fashion, was to quit Visual Studio and reopen it.

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