The ASPSmith's Blog

Some rants about ASP.NET by Steven Smith

"unexpected error creating debug information"

I keep running into this issue in my multi-project VS.NET solutions.  For some reason, something is locking the dll(s) in the /obj/ folder of library components.  The fix that I have at the moment is as follows:

  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 this step is necessary)
  5. (can't hurt, might help) -- delete the project outputs from any other project /bin folders in the solution that is having issues.
  6. Restart VS.NET
  7. Rebuild
  8. Laugh the next time you hear that DLL Hell is no more in .NET...

Update: Just deleting /obj/ after closing VS.NET does it.  Ambrose pointed me to prcview.exe and that demonstrated that it is in fact devenv.exe locking the file, so it's VS.NET's own fault, not Index Server or anything else that is to blame.

Listening to: Disturbed - Remember

Comments

Paschall said:

Steven it's probably also the same problem I had few days ago. Check Index Server, and see if it's running.

If you don't need it turn off the services, otherwise add some exclusion directories, the .Net temporary folders for a starter
# August 12, 2003 10:36 AM

Addy Santo said:

The problem can be caused by virtually anything which runs in the background and is triggered by file activity. Index server is one example, also anti-virus scanners tend to do the same.

I get this occasionally in VB/C# but much more often with managed C++ projects. I'm not sure why...
# August 12, 2003 11:09 AM

Jamie Cansdale said:

I always keep the SysInternals Process Explorer [1] at hand to remove .pdb and .dll files from the grips of Visual Studio. You'll find you can release the file handle without shutting down Visual Studio. I also find this hardly ever happens with VS.NET 2003.

[1] http://www.sysinternals.com/ntw2k/utilities.shtml
# August 12, 2003 5:08 PM

Steven Smith said:

For the record, I am using VS.NET 2003. The one that keeps getting locked is a C# project (class library) in a solution with 4 other VB projects (3 class libs and a web). I'm wondering if the IDE real-time compiling of VB's IDE is hitting the PDF/DLL from the C# project and not cleaning them up.

Using prcview, it's clear that only that one project's file are being referenced from the My Documents/Visual Studio Projects/ProjectName/obj/ folder. The rest (the other dlls and pdbs being locked/referenced by devenv.exe) are going to the shadow copy under Application Data/.

Thanks for the link to Process Explorer - I'll check it out.
# August 12, 2003 6:15 PM

Denis Bauer said:

I've made some good experience to switch from "Debug" to "Release" and back to solve this problem.
But it isn't working all the time.
# August 13, 2003 4:10 AM

Steven Smith said:

Tried switching from Debug to Release, and it worked! Easier than shutting down, to be sure. Thanks for the tip, Denis!
# August 13, 2003 11:18 AM

Charles McEvoy said:

I've had this problem to, tis VERY annoying!
# August 29, 2003 9:32 AM

Abraham Rodriguez said:

Just curious, has anyone had problems like these (and others) arising from having the project files too deep into a directory's hierarchy? like if I have debug .exe in a place say c:\documents and settings\me\my documents\visual studio projects\asp.net\controls\myapp\bin\debug\myapp.exe I get all kinds of errors, including the error with the file locks.. once I moved root of the project to be directly under visual studio projects, the problem was solved forever.. I don't know if it's related, but worth noting perhaps?
# September 15, 2003 1:39 PM

TrackBack said:

# October 30, 2003 7:15 AM

Steve Hampton said:

Solution in this blog was extremely helpful to me as I've spent most of today trying to figure it out!!! Thanks guys!
# February 12, 2004 1:32 PM

Michael said:

Good info. I have tried all of it and I still can't compile. Also, no one mentioned bind failures (FUSLOGVW.exe). I get these also. The ide is having trouble finding/loading the assembly.

Any other help ??? Thanks!!
# February 12, 2004 4:35 PM

John said:

Dont know if it really help but I heard about checking the option 'Launch folder windows in separate process' on Windows explorer
# March 2, 2004 1:49 PM

Rob said:

Most likely, you have an ASPX file open in VS.NET that has embedded your control. The ASPX project opens the control DLL and keeps it open. If you just don't open the ASPX while in VS.NET, you will be able to compile your solution. Once you open it, you will likely have to restart VS.NET, since it obviously seems to cache these controls when rendering them in the WYSIWYG design-time viewer.
# April 12, 2004 1:20 PM

Dave said:

I have had similar problems. I have 75 c# projects all in 1 solution. The problem occurs mostly with user controls. Another (i think) related problem is in the following link: This has been a killer for me and has some interesting related info:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=4fe7c9e8.0403311729.470cd405%40posting.google.com&rnum=2&prev=/groups%3Fq%3Dchakachimp%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den
# April 23, 2004 1:27 AM

Dave said:

I have had similar problems. I have 75 c# projects all in 1 solution. The problem occurs mostly with user controls. Another (i think) related problem is in the following link: This has been a killer for me and has some interesting related info:

http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=4fe7c9e8.0403311729.470cd405%40posting.google.com&rnum=2&prev=/groups%3Fq%3Dchakachimp%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den
# April 23, 2004 1:28 AM

Patrick said:

If you run Build->Clean Solution this will take care of the issue as well.

# August 3, 2007 2:18 PM

DhanaSekaran. R said:

Hi buddy,

Thanks a lot man. It helped me a lot and I have fixed the issue successfully.

Thanks a lot once again.

# August 4, 2007 2:28 AM

Siva said:

This post was very useful and informative. Thanks.

# April 17, 2009 1:24 AM

burak said:

delete only .pdb files about your project in obj and bin/debug folder and everything work fine..

# May 29, 2009 8:12 PM

cosh said:

Thanks my friend its working:)

you are perfect!!

# August 11, 2009 3:36 AM

Derek said:

Thanks, fixed my issues!

# August 21, 2009 1:07 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)