A collection of learnings and opinions.

Tuesday, October 7, 2008

C# Compiler Could Not Be Created

I was having memory-problems on my dev machine (2 Gigs don't go far these days), and after a few resets I was getting an exception whenever I tried to open a solution containing a C# project in VS2005. It told me the C# compiler could not be loaded, and I should reinstall VS.
Eh? No way. That's an entire day, getting it back to where I want it.
So I open the Help -> About to see if I can get some info about what's wrong. There I'm hit by a Package Load Failure, coming from ReSharper (we loves it). This looks like something.
A quick google for this, and I find Aaron Stebner has a possible solution. The tool he references in that post didn't find any problems, but running through the steps to re-build the native libraries did.
So these are the steps in case that blog ever disappears:
  1. Open a cmd prompt
  2. Run del %windir%\Assembly\NativeImages_v2.0.XXXXX_32\Microsoft.VisualStu#
    (where XXXXX is the build number of the .NET Framework 2.0 that
    you have installed - you can figure that out by looking at the name of
    the folder at %windir%\Microsoft.NET\Framework\v2.0.XXXXX)
  3. Run %windir%\Microsoft.NET\Framework\v2.0.XXXXX\ngen.exe update /queue
That's done it. A restart of VS and we're up and running again. Now I just have to convince my boss I should get 2 more gigs of RAM.

No comments: