Sdílet prostřednictvím


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

  • Anonymous
    April 09, 2005
    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?

  • Anonymous
    April 09, 2005
    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!

  • Anonymous
    September 14, 2005
    Hi!

    I had simmilar error:
    http://www.kierepka.pl/index.php?option=com_content&task=view&id=34&Itemid=1

    Regards
    M.Kierepka

  • Anonymous
    November 03, 2005
    That works! thanks!

  • Anonymous
    February 22, 2006
    Thanks for the info.

  • Anonymous
    March 13, 2006
    You saved my life!!

  • Anonymous
    March 21, 2006
    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 :)

  • Anonymous
    April 12, 2006
    Nice post, and quick solution.

    Many thanks.

  • Anonymous
    November 26, 2007
    PingBack from http://feeds.maxblog.eu/item_603795.html

  • Anonymous
    January 21, 2009
    PingBack from http://www.keyongtech.com/648323-internal-compiler-error-urgent

  • Anonymous
    June 12, 2009
    PingBack from http://weakbladder.info/story.php?id=904