Unable to create PDB file

28,441

Solution 1

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.

Solution 2

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.

Solution 3

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

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

Solution 4

I was receiving the same error and it ended up being a web reference that needed to be updated. After updating all the web references the issue persisted. Finally I added the same web reference as the same url and name and the add web reference told me that there was a reference by the same name and provided an option to update it with the latest information. This finally worked and the project is running again.

Solution 5

If you work on solution with more than one projects inside, there is possibility of wrong compile order.

Share:
28,441
Ryan Smith
Author by

Ryan Smith

Just a simple programmer, mostly web stuff. .NET and PHP are the primary languages I work with, but obviously including all the peripheral languages required to make that work.

Updated on April 02, 2020

Comments

  • Ryan Smith
    Ryan Smith about 4 years

    For some reason this error started popping up today on one of my projects.

    Error 1 Unable to write to output file 'C:\MyProject\Release\MyProject.pdb': Unspecified error

    If I go into advanced compile options and change it to not generate and debug info, my project compiles fine.

    I have tried setting the permissions on the Release folder to full for everyone, so I would assume it's not a permissions issue. Also, I don't see anything in my log files that would provide me with more information about the issue.

    Does anyone know why this error would just start showing up or a way to fix it?

    Thanks.


    Update: I have rebooted my machine, restarted VS several times and have even completely deleted the existing OBJ file where the issue is happening. It's still giving me the same error.

    This is a simple one project solution that was working fine just last week. It appears to be an issue with VS trying to build the PDB file because I can delete them out of the Release and Debug folders without issue. When I try rebuilding them VS will start creating the file (about 1.4MB is size) but I still get the error.