How to get PDB file for mscorlib.ni.lib (.Net Framework 3.5)

After a lot of searching, I still could not resolve the issue.

I have a mdmp file. The call stack shows that it is using mscorlib.ni.dll. Therefore, in order to get information about the function, I need to get the pdb file.

The version of mscorlib.ni.dll is 2.0.50727.3655. I believe this comes from the .Net Framework 3.5.

Since mscorlib.ni.dll is the native optimized dll that ngen.exe generates, so I need to use ngen.exe createpdb to generate pdf for this dll.

ngen.exe createpdb "C:\Windows\assembly\...\mscorlib.ni.dll" "C:\SymbolCache" 

Here is the result:

  • I can not find ngen.exe in the folder "C: \ Windows \ Microsoft.NET \ Framework64 \ v3.5"
  • I can find ngen.exe in the folder "C: \ Windows \ Microsoft.NET \ Framework64 \ v2", but it does not have the createpdb option.
  • I can find ngen.exe in the folder "C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319" and it supports the createpdb parameter, but it reports an error.

Microsoft (R) CLR native image generator - version 4.0.30319.18408 Copyright (c) Microsoft Corporation. All rights reserved. Disabled header found in native image "C: \ Windows \ assembly \ NativeImages_v2.0.507 7_64 \ mscorlib \ 5cd1c2848ff40eb0a8c149706ee394fa \ mscorlib.ni.dll. Unspecified error (Exception from HRESULT: 0x80004005) E

So, I do not know how to get pdb for this mscorlib.ni.dll Net Framework 3.5.

Any idea?

+6
c # windows dll ngen
source share
2 answers

I had the same error message until I realized that I was calling ngen.exe from folder 64 . Apparently mscorlib.ni.dll was not 64-bit.

So, I used the 32-bit version of ngen.exe from the folder C:\Windows\Microsoft.NET\Framework\v4.0.30319 , and it successfully created the PDB.

However, the path to your mscorlib.ni.dll includes ...\NativeImages_v2.0.507 7_64\... , which indicates that it is 64-bit, so this could be another problem.

+6
source share

Like the answer from the monsignor, for me the solution was to match the bit version (64-bit or 32-bit). My mini-drive was 64-bit, so I had to go to the Framework64 folder and run ngen, and everything was fine. Initially, I got the same ngen error that is described here (invalid header found in native image ... E_FAIL), because I was in the Framework folder instead of the Framework64 (facepalm) folder.

However, even though the ngen command worked ... the pdb that was eventually generated was still not accepted by VS 2013 as a comparable character file in my script.

+1
source share

All Articles