Extracting pdb from mscorlib.ni.dll using ngen or other tools

1.3k views Asked by At

I am trying to get pdb from mscorlib.ni.dll but in all conditions it fails. I used the ngen.exe from the pc that supports "createpdb" options.

To be sure, I ran all the ngen versions with all the mscorlib.ni.dll versions. Il all cases, I end up with errors.

Can someone help to demistify pdb creation on dll files.

  • List item

D:\Windows\Microsoft.NET\Framework>D:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe createpdb "D:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\a5669e937ab8f4e7928ddb37cc469ae1\mscorlib.ni.dll" c:\symbo
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.
Can not find native image 'D:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\a5669e937ab8f4e7928ddb37cc469ae1\mscorlib.ni.dll'.  Error=3

D:\Windows\Microsoft.NET\Framework>cd v4.0.30319

D:\Windows\Microsoft.NET\Framework\v4.0.30319>D:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe createpdb "D:\Windows\assembly\NativeImages_v2.0.50727_32\mscorlib\5bd3374f05d46ba0563f44d032209f08\mscorlib.ni.dll" "c:\symbols"
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.
Invalid header found in native image 'D:\Windows\assembly\NativeImages_v2.0.50727_32\mscorlib\5bd3374f05d46ba0563f44d032209f08\mscorlib.ni.dll'.
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

D:\Windows\Microsoft.NET\Framework\v4.0.30319>D:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe createpdb "D:\Windows\assembly\NativeImages_v2.0.50727_64\mscorlib\6227ee011c9930128c5ad76841ecf2ee\mscorlib.ni.dll" "c:\symbols"
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.
Invalid header found in native image 'D:\Windows\assembly\NativeImages_v2.0.50727_64\mscorlib\6227ee011c9930128c5ad76841ecf2ee\mscorlib.ni.dll'.
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

D:\Windows\Microsoft.NET\Framework\v4.0.30319>D:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe createpdb "D:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\c90ef9a73ea0044641d31b19023aad61\mscorlib.ni.dll" "c:\symbols"
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.
Invalid header found in native image 'D:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\c90ef9a73ea0044641d31b19023aad61\mscorlib.ni.dll'.
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

D:\Windows\Microsoft.NET\Framework\v4.0.30319>D:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe createpdb "D:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\a20cafac04a2e9b3bcb5ec4d674775e5\mscorlib.ni.dll" "c:\symbols"
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.
Invalid header found in native image 'D:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\a20cafac04a2e9b3bcb5ec4d674775e5\mscorlib.ni.dll'.
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

D:\Windows\Microsoft.NET\Framework\v4.0.30319>D:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe createpdb "D:\Windows\assembly\NativeImages_v2.0.50727_32\mscorlib\5bd3374f05d46ba0563f44d032209f08\mscorlib.ni.dll" "c:\symbols"
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.
Invalid header found in native image 'D:\Windows\assembly\NativeImages_v2.0.50727_32\mscorlib\5bd3374f05d46ba0563f44d032209f08\mscorlib.ni.dll'.
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

D:\Windows\Microsoft.NET\Framework\v4.0.30319>D:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe createpdb "D:\Windows\assembly\NativeImages_v2.0.50727_64\mscorlib\6227ee011c9930128c5ad76841ecf2ee\mscorlib.ni.dll" "c:\symbols"
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.
Invalid header found in native image 'D:\Windows\assembly\NativeImages_v2.0.50727_64\mscorlib\6227ee011c9930128c5ad76841ecf2ee\mscorlib.ni.dll'.
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

D:\Windows\Microsoft.NET\Framework\v4.0.30319>D:\Windows\Microsoft.NET\Framework64\v4.0.30319\ngen.exe createpdb "D:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\c90ef9a73ea0044641d31b19023aad61\mscorlib.ni.dll" "c:\symbols"
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.
Invalid header found in native image 'D:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\c90ef9a73ea0044641d31b19023aad61\mscorlib.ni.dll'.
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

D:\Windows\Microsoft.NET\Framework\v4.0.30319>D:\Windows\Microsoft.NET\Framework\v4.0.30319\ngen.exe createpdb "D:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\a20cafac04a2e9b3bcb5ec4d674775e5\mscorlib.ni.dll" "c:\symbols"
Microsoft (R) CLR Native Image Generator - Version 4.0.30319.33440
Copyright (c) Microsoft Corporation.  All rights reserved.
Invalid header found in native image 'D:\Windows\assembly\NativeImages_v4.0.30319_64\mscorlib\a20cafac04a2e9b3bcb5ec4d674775e5\mscorlib.ni.dll'.
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))

1

There are 1 answers

0
Codeguard On

We also had this issue, and solved is as in this question: How to get the PDB file for mscorlib.ni.lib (.Net Framework 3.5)

It turned out we used ngen from Framework64 instead of Framework (we needed PDB for 32-bit module)