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!