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?
source to share
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.
source to share