title: Why is msbuild and link.exe "hanging" during a build?
body: <p>We have a few C++ solutions and we run some build scripts using batch files that call msbuild.exe for each of the configurations in the solutions.</p>
  
  <p>This had been working fine on 3 developer machines and one build machine, but then one of the projects started to hang when linking. This only happens on the newest machine which is a quad core, 2.8ghz I think. It runs on Windows Server 2003 and the others are on XP or Vista.  </p>
  
  <p>This happens consistently even if I change the order of builds in the bat file.</p>
  
  <p>If I run the build from the IDE on that machine it does not hang.</p>
  
  <p>Any ideas about what could possibly be causing this?</p>
  
  <p>I am using Visual Studio 2008.</p>
  
  <hr>
  
  <h3>Edit:</h3>
  
  <p>I see now that when it is hung the following are running:</p>
  
  <ul>
  <li>link.exe (2 instances) One with large memory usage and one with a small amount of memory usage.</li>
  <li>vcbuild.exe </li>
  <li>msbuild.exe</li>
  <li>vcbuildhelper.exe </li>
  <li>mspdbsrv.exe</li>
  </ul>
  
  <hr>
  
  <h3>Edit:</h3>
  
  <p>The exe file exists and so does the pdb file.</p>
  
  <p>The exe file is locked by some process, and I can't delete it or move it. I can delete the pdb file though.</p>
  
  <p>I also have the problem if I just use VCBuild.exe.</p>
  
  <p>I decided to try debugging the 2 link.exe processes and the mspdbsrv.exe processes.</p>
  
  <p>When I attached the debugger/MSdev IDE to them I got a message box saying that the application was deadlocked and/or that "all threads have exited". </p>
  
  <p>I guess I will have to check for a service pack for that msdev install on that machine.  </p>
  
  <hr>
  
  <h3>Edit:</h3>
  
  <p>In the debug.htm output file I get all sorts of stuff output after the link.exe command is generated.</p>
  
  <p>However, for the release buildlog.htm the linke.exe line is the last line.</p>
  
  <p>This is clearly a hang in the linker.  Definitely a Microsoft bug.</p>
  
  <p>I am now trying to figure out what the .rsp (linker response) file is.  </p>
  
  <p>When I issue: </p>
  
  <blockquote>
    <p>link.exe @c:\\Release\RSP00000535202392.rsp /NOLOGO /ERRORREPORT:QUEUE</p>
  </blockquote>
  
  <p>That is the last line in the release build log. The debug one has lots more information after that.</p>
  
  <p>Reinstalling a different version of Visual Studio did not solve the problem.</p>
  
  <p>I will open an issue/ticket with Microsoft. I will post an answer if I can.</p>