Unexpected Error creating debug information file GG.PDB"--"

35,012

Solution 1

As requested, my comment as an answer:


Try cleaning the solution (under the Build menu in VS).

Since the build was interrupted half-way through by your power failure, the file isn't locked -- the build system is probably just in an inconsistent state (which a Clean Solution should fix).

Solution 2

This worked for me:

  1. Shut down VS.NET
  2. Browse to the project in Windows Explorer
  3. Delete the /obj/ folder.
  4. Delete the project outputs (.dll and .pdb) from /bin (not sure if this step is necessary)
  5. Can't hurt but might help: delete the project outputs from any other project /bin folders in the solution that is having issues (wasn't necessary for me)
  6. Restart VS.NET
  7. Rebuild

http://weblogs.asp.net/ssmith/archive/2003/08/12/23755.aspx

Solution 3

This happens once in a while in my environment and the problem probably has to do with the PDB file being locked (i.e., I'm guessing the last part of the error message is missing in your post). This is how it looks on my machine:

Unexpected error creating debug information file 'c:\dir\obj\file.PDB' -- 'c:\dir\obj\file.PDB: The process cannot access the file because it is being used by another process.'

In my case, cleaning the solution does not solve the problem and restarting is an overkill, so I usually just copy the full name of the pdb file (from the error) and execute this on the command line:

ren c:\dir\obj\file.PDB *.old

Solution 4

This worked for me: Close Visual studio and open visual studio using Run as Administrator and problem was solved.

Solution 5

Not need to restart or delete the file. Just rename the file and that is enough. If you try to delete the file it will give an error. Better just rename it & it will work. :)

Share:
35,012

Related videos on Youtube

zack_falcon
Author by

zack_falcon

I'm currently an IT Student. I love computer games, good food, skating, football, and R/C Trucks.

Updated on March 15, 2020

Comments

  • zack_falcon
    zack_falcon about 4 years

    When I try to build my project, it returns the following error:

    Error 1 Unexpected error creating debug information file 'D:\Documents\Lance\Documents\School\Capstone\GG\GG\obj\Debug\GG.PDB' -- '' GG

    I've recently had the misfortune of having my PC restart on me, due to sudden power supply problems (maybe). This is while the project was building, before this problem started.

    When the PC came back online I've noticed that the changes I've made to the program prior to the sudden power down was not saved. And, it won't build anymore.

    • Cameron
      Cameron almost 13 years
      Try cleaning the solution (under Build menu in VS)
    • Daniel A. White
      Daniel A. White almost 13 years
      have you tried to do a clean build?
    • CharithJ
      CharithJ almost 13 years
      Are you using an version control system? May be any locking issue?
    • zack_falcon
      zack_falcon almost 13 years
      @ CharithJ, I'm not using any version control system (whatever that is, sorry, new guy). Just 'vanilla' Visual Studio 2005. @ Cameron, thanks! That worked.
    • zack_falcon
      zack_falcon about 9 years
      @Cameron, I forgot to ask all these years - I just noticed it because it got a Famous Question badge - and I do apologize sincerely, but could you put your comment as an answer, so I could accept it?
    • Cameron
      Cameron about 9 years
      @zack: Haha, sure, no problem :-)
  • Bassem Wissa
    Bassem Wissa almost 11 years
    worked for me :) i the power went off and i that error happened, i deleted obj folder, then rebuild it worked cool.
  • Nick Orlando
    Nick Orlando over 10 years
    This worked, though I had to do an iisreset before I could do step 3, as w3wp.exe was holding onto the .pdb file in /obj/
  • henrik
    henrik over 10 years
    Yes. Obviously the file is not important. Renaming the file worked like a charm :)
  • steinar
    steinar over 10 years
    Well, I would say that the file is important, i.e. if you want to debug. But it will be recreated on the next build.
  • KMX
    KMX about 8 years
    it worked for me first time.. but again it falls. I had to rename my assembly name to make it work. No need to restart your VS.