How to Debug "Unexpected error initializing debug information -" Could not find required export at runtime. "

I get this error on all projects (including new blank templates) that I try to create with Visual Studio 2008:

Unexpected error initializing debug information - "Could not find required export at runtime."

The error help for compiler error CS0040 doesn't help much:

This error can occur when using the / debug compiler and indicates that the compiler was unable to write to the .pdb file. Possible resolutions for this error include reinstalling Visual Studio, ensuring that the compiler has write access to the file or directory, or does not compile with / Debug.

I can manually create files in {bin, obj} \ Debug directories, run Studio as administrator, didn't help, uninstalling both 3.5 environment and Visual Studio 2008 and re-installing them with their respective service packs and I still get the error.

Removing all /debug

switches from the command line obviously removes the error message as stated, but is not an option for further development.

How can I debug this?

0


source to share


2 answers


In the end, I used the Process Monitor from the Sysinternals Suite to take a look at what the compiler was doing. By running csc.exe

Visual Studio 2008 from the command line and filtering Process Name is "csc.exe"

on the process monitor, I got a good idea of ​​what the compiler does.



"Inspired" by the message "Failed to find the required export at runtime", I searched for the missing DLLs and actually found that I csc.exe

tried to access Windows\Microsoft.NET\Framework\v2.0.50727\diasymreader.dll

but failed. Getting this DLL from a different installation fixed the error for me.

+1


source


It looks like you have incorrect versions of VS / .NET DLLs installed somehow, or some fancy "half 3.0 half 3.5" bad state I've seen happened multiple times; you can check versions everywhere but the easiest is to route the car :(



0


source







All Articles