Unable to write to output file pdb

apappas

Member
Joined
Mar 8, 2007
Messages
8
Programming Experience
10+
In Visual Basic 2005 I get the following error message:

vbc : error BC31019: Unable to write to output file 'C:\GATOS\Source\30 Business\Gatos.BusinessLogic.Amortization\obj\Debug\Gatos.BusinessLogic.Amortization.pdb': System Error &H80070005&

I have to close Visual Basic 2005, delete the folder obj, restart Visual Basic 2005 and recompile, but even that does not work allways. When I have managed to recompile, I start the project in the debugger, stop it at some point, make a modification, compile it, and then I get the same error. So I have to restart again Visual Basic 2004 ... You see that productivity goes towards 0...

I saw with sysinernals/project explorer, that devenv.exe uses the pdb file. My solution holds two projects, Gatos.BusinessLogic.Amortization which is a COM+ component, and Gatos.BusinessLogic.Amortization.Test which is a windows application to test the COM+ component, it therefore has a reference to the COM+ component. If I remove the Test application, compilation goes fine. But for debugging I have to add again the Test application.

Does anybody have an idea what is the problem with the pdb file? Is there a way, to be able to compile and run the solution without having to restart Visual Basic 2005 and without removing and readding the Test project?

Best regards,

Alexandros Pappas


The text from the output window is the following:
------ Build started: Project: Gatos.BusinessLogic.Amortization, Configuration: Debug Any CPU ------
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics /nowarn:42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 /rootnamespace:Gatos.BusinessLogic.Amortization /doc:eek:bj\Debug\Gatos.BusinessLogic.Amortization.xml /define:"CONFIG=\"Debug\",DEBUG=-1,TRACE=-1,_MyType=\"Windows\",PLATFORM=\"AnyCPU\"" /reference:..\..\Runtime\Gatos.BusinessEntities.Amortization.dll,..\..\Runtime\Gatos.BusinessLogic.Calendar.dll,..\..\Runtime\Gatos.Common.GlobalConstants.dll,..\..\Runtime\Gatos.Common.SystemEntities.dll,..\..\Runtime\Gatos.DataAccess.Amortization.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Data.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.EnterpriseServices.dll,C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /out:eek:bj\Debug\Gatos.BusinessLogic.Amortization.dll /resource:eek:bj\Debug\Gatos.BusinessLogic.Amortization.Resources.resources /target:library AmortizationsControllerR.vb AmortizationsControllerU.vb AmortizationsEngine.vb "My Project\AssemblyInfo.vb" "My Project\Application.Designer.vb" "My Project\Resources.Designer.vb" "My Project\Settings.Designer.vb"
vbc : error BC31019: Unable to write to output file 'C:\GATOS\Source\30 Business\Gatos.BusinessLogic.Amortization\obj\Debug\Gatos.BusinessLogic.Amortization.pdb': System Error &H80070005&
C:\GATOS\Source\30 Business\Gatos.BusinessLogic.Amortization\AmortizationsEngine.vb(68) : warning BC42024: Unused local variable: 'dr2'.
C:\GATOS\Source\30 Business\Gatos.BusinessLogic.Amortization\AmortizationsEngine.vb(74) : warning BC42024: Unused local variable: 'postingDate'.
------ Build started: Project: Gatos.BusinessLogic.Amortization.Test, Configuration: Debug Any CPU ------
Gatos.BusinessLogic.Amortization.Test -> C:\GATOS\Source\30 Business\Tests\Gatos.BusinessLogic.Amortization.Test\bin\Debug\Gatos.BusinessLogic.Amortization.Test.exe
========== Build: 1 succeeded or up-to-date, 1 failed, 0 skipped ==========
 
A quick web search shows people get this problem when something has set the pdb file read-only (VSS was mentioned) or if another process holds lock on it (check with Process Explorer).
 
Thank you

Thank you very much, unlocker works fine. It is sad that Microsoft makes the programing environments always more cumbersome, slower and more difficult to use, and that one has to resort to such tools. But thank you very much again.
 
Microsoft makes the programing environments always more cumbersome
I don't understand what you say here. Your problem is not a common one, and probably not caused by VS. The intent of my reply was for you to find means to investigate what caused the problem. Using Unlocker is a bad idea because it does not solve the problem. The problem is not that the file is locked or perhaps set readonly, but what did that to the file.
 
locked by devenv

I see with unlocker or processexplorer (already mentioned in my first post), that the file is locked by devenv.exe. I expect Visual Studio 2005 to be able to write to this file when I have stoped debugging. Nobody else is using this file. So Visual Studio is stupid to lock this file without reason. Visual Studio is not able to release the locks when necessary. So who's else fault can it be?
 
There is not VSS involved? Otherwise there could be some options:
- if you don't have SP1 installed, that is first option, there could be fixed included for some system setups unknown to most users
- your installation could be faulty, try reinstall
- if VS doesn't stop debugging when app exit there could be a problem with the com object.
 
1. There is no VSS but the source control of TeamSuite involved. Nevertheless I checked, that the pdb file is not in the source control.

2. I stop the debugging from within Visual Studio, so it should realize, that I have stopped debugging and should release the lock on the pdb file.

3. I have version (from Help/About): 8.0.50727.42 (RTM.050727-4200). I will try to start in the evening SP1. As I heard, it takes some hours to install, again some hours lost from productive work. And I thought new tools make you more productive...

But thank you very much for your support, I really appreciate.
 
I installed VS80sp1-KB926601-X86-ENU.exe and now I have version (from Help/About): 8.0.50727.762 (SP.050727-7600). But the problem still exists. I wonder when will Microsoft finally decide to fix this. As it is, it is a very inefficient programming tool.
 
Using Unlocker is a bad idea because it does not solve the problem.
Yes you're right this will not solve the problem.

As it is, it is a very inefficient programming tool.

man, you'll be the first to say this... I would like to say that no IDE is better than Visual studio.

As JohnH said, this is not a common problem so there is something wrong with your visual studio ide. May be you can change to release mode run the app and delete the debug folder and change back to debug mode and run again.But I'm not sure.
 
I tried that also, switching to release, deleting the Debug folder (which I could only delete with unlocker, because ofcourse devenv had locked it!) and then switched back to Debug, but again the same problem.
I have never seen an IDE, where you must restart it, each time you make a modification! Even the simplest IDE does not have such a problem. And apparently this problem with the pdb, is not only on my machine. I have not a very complex installation, Windows XP, Visual Studio 2005, Sql Server 2005, Microsoft Office and VirusScan. I am angry about the product, but not at all about you and all the suggestions you give, for which I am very thankfull.
 
You should contact MS support, or have the request forwarded by your dealer.
 
I have solved this problem, although the solution is not pretty.

1 - I created a new project.
2 - I deleted the blank form and closed the new project.
3 - I copied all of my source files to the new project directory.
4 - I re-opened the new project and added all of the existing files.
5 - I compiled the new project.
6 - I deleted the old project.
7 - I renamed the new project as the old project.

This problem is not a problem with the code, it is a problem with Visual Studio.

Steve Gaines, MCSD
SteveGaines
 
Back
Top