ASP.Net cannot create/shadow copy

前端 未结 11 1686
暗喜
暗喜 2020-12-29 02:02

I get this error repeatedly when developing ASP.Net applications:

  Cannot create/shadow copy \'XXXXX\' when that file already exists

Where

11条回答
  •  清酒与你
    2020-12-29 02:37

    Add these lines in the pre-build event command line, which basically unlocks the DLL within Visual Studio:

     IF EXIST $(TargetPath).LOCKED  (del $(TargetPath).LOCKED)
      ELSE (IF EXIST $(TargetPath) (move $(TargetPath) $(TargetPath).LOCKED))
    

    Re-compile and your unable to copy DLL error will not occur.

提交回复
热议问题