Unable to create PDB file

Perhaps something else has the file open, like an editor or another copy of Visual Studio?

Try shutting down and restarting VS, or even rebooting your machine to see if that resolves the problem.


This worked for me where the other answer's here failed:

Unable to write to output file [FileName] .pdb: Unspecified error Visual Studio


Here is a MUCH better way to fix this issue.

Basically close your solution and re-open it without compiling. Check the Error List and it will show you which files are missing.


After banging my head on the wall for a while on this one and digging through source control to try to get back to a working copy, it turned out that the PDB file wasn't the issue at all. Someone had deleted a source file which was causing VS to choke when I tried to find that file to create the debug information.

So if anyone comes across this error and can't figure it out, make sure that you aren't missing a source file somewhere.

It would have been very helpful if VS would have told me that file is missing rather than just telling me it had an unspecified error creating the PDB file.

Thanks.