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