15

I am getting this error all of a sudden and I don't know why. I have to restart VS2010 everytime I make change to the code because apparently it locks the pdb files.

1>LINK : fatal error LNK1201: error writing to program database 'C:\code\MyProject\Debug\MyProject.pdb'; check for insufficient disk space, invalid path, or insufficient privilege

Even if I clean the project it doens't delete this file. I have tried the solution proposed here by Toni but it didn't work for me either. When add path to pre-build like he has suggested I get the following error:

1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5): error MSB3073: The command "C:\Program Files (x86)\Microsoft Visual Studio 10.0\freepdb MyProject 1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5): error MSB3073: :VCEnd" exited with code 9009.

pnuts
  • 58,317
  • 11
  • 87
  • 139
zar
  • 11,361
  • 14
  • 96
  • 178

5 Answers5

8

The culprit was deleaker that I had installed to detect memory leak and it looks like it was holding up the debugger/pdb files. After uninstalling my problem is fixed.

zar
  • 11,361
  • 14
  • 96
  • 178
5

It worked for me when I closed ProcessExplorer (sysinternal tool procexp64.exe) which I was using to check number of thread memory usage. Search that file and then close it.

enter image description here

[Update]: You can also use Windows "Task Manager" as efficiently as "Process Explorer of Sysinternal" to locate any zombie handles. Task Manager | Performance | Open Resource Monitor | CPU |Associated Handles | search -> enter image description here

userom
  • 403
  • 5
  • 8
3

I have faced similar problem when I worked with single pdb file in two Visual Studio versions. Closing one visual studio version solved the problem.

displayName
  • 13,888
  • 8
  • 60
  • 75
  • In my case, single VS held the pdb hostage and didn't update it when I _rebuild the project in the same Visual Studio_. I just closed VS and opened it again and rebuild the project without problem. – displayName Oct 09 '17 at 21:35
  • In my case just had to delete pdb file and after that it all worked fine... – Žarko Tomičić Nov 29 '21 at 20:20
1

I faced the similar issue and the reason for me was windbg was holding all the pdb files,so when the visual studio was trying to create new fresh pdb files it was unable to overwrite old files as these were being use by windbg.

So the obvious problem is when ever Visual studio is unable to overwrite the existing files with a new output files it outputs the following error.

GingerJack
  • 3,044
  • 1
  • 17
  • 19
0

Your antivirus is blocking the write access. Please unblock the folder protection