C# compiler bug workaround


We've received a couple of reports of people running into this internally and I figured it was worth posting about for anyone who searches for information on the problem. It's a very easy workaround and I think most would be able to figure it out on their own but we've run across a few users who missed it.


The problem is the 7.1 (Everett) version of the C# compiler crashes (ICEs) when attempting to create a pdb where one already exists that was created with a more recent version of the compiler (e.g. 8.0 aka Whidbey).


The workaround is just a matter of deleting the existing PDB file.


The error output you'd see if you run into it would be similar to the following:


Microsoft (R) Visual C# .NET Compiler version 7.10.4133.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

fatal error CS0041: Unexpected error writing debug information to file 'c:\test\test.PDB' --
'Catastrophic failure '
error CS0583: Internal Compiler Error (0xc0000005 at address 53625106): likely culprit is 'CODEGEN'.
An internal error has occurred in the compiler. To work around this problem, try simplifying or changing the
program near the locations listed below. Locations at the top of the list are closer to the point at which the
internal error occurred.
test.cs(5,14): error CS0584: Internal Compiler Error: stage 'CODEGEN' symbol 'Test.Main()'
test.cs(5,14): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'Test.Main()'
test.cs(5,14): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'Test.Main()'
test.cs(3,7): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol 'Test'
test.cs(1,1): error CS0584: Internal Compiler Error: stage 'COMPILE' symbol ''
test.cs: error CS0586: Internal Compiler Error: stage 'COMPILE'
error CS0587: Internal Compiler Error: stage 'COMPILE'
error CS0587: Internal Compiler Error: stage 'BEGIN'


A KB article is in the works but those sometimes take a bit. Also, if you ended up here because you ran across an instance of the C# compiler crashing with an ICE (Internal Compiler Error) that is not the one described above. Please help us fix it by logging a bug on our MSDN Feedback site. Thanks!

Comments (11)
  1. It would be great if the MSDN Feedback Site (http://lab.msdn.microsoft.com/ProductFeedback/) allowed for VS.NET 2003 bugs to be reported.

    I’ve got a similar problem but I can only reproduce it in my project and not in a seperate project. How do I go about reporting it?

  2. Craig, feel free to submit it via the MSDN Feedback site even if it may be an Everett-only issue. Just make sure you identify it as a C# compiler issue and it should get to us soon after. We’ll investigate at that point and contact you if we need some more info. Thanks!

  3. Oz says:

    That works! thanks!

  4. Dan McKinley says:

    Thanks for the info.

  5. Nick says:

    You saved my life!!

  6. James Shaw says:

    Perfect, that’s exactly what happened. You should expect a lot of hits from this over the coming months.

    I’ll be blogging this tonight 🙂

  7. Steve Moxon says:

    Nice post, and quick solution.

    Many thanks.

Comments are closed.

Skip to main content