Visual Studio 2015 locks DLL during debugging

后端 未结 4 977
囚心锁ツ
囚心锁ツ 2021-02-07 18:26

I have 3 C# projects A, B, and C. Both A and B reference C. The references to C from A and B are set to \"Copy Local\" implying that after C is built to C.dll (in the output dir

4条回答
  •  遇见更好的自我
    2021-02-07 19:03

    In my case, the .pdb file was locked. This is not the same as the .exe getting locked as it should be when debugging.

    Assuming it's just the .pdb, simply move it to a new folder (I dragged and dropped). Oddly enough, it cannot be deleted, but it can most certainly be moved! Once the .pdb file was gone, the assembly was able to compile again.

    The alternative solution (and probably the least convenient) involves closing out of the project entirely, then opening it again (the .pdb file magically unlocks!).

    Edit: After happening a second time, moving the file did not work; it appears restarting the project is the only reliable way to go.

提交回复
热议问题