1

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))
Nadzzz
  • 530
  • 3
  • 12
  • which Windows do y use? I tested it in Windows 8 and it works: http://pastebin.com/jxVLVNvM – magicandre1981 Jun 19 '15 at 17:16
  • Tested on two types of azure virtual machines The one with the described logs is Winfows Server 2012 R2 Datacenter the other one is a windows server 2008 – Nadzzz Jun 19 '15 at 18:43
  • which .net version do you have installed? I tested it with .net 4.5.2. – magicandre1981 Jun 20 '15 at 05:44
  • Can you use NGen from Framework 4.x to produce a PDB from mscorlib 2.x? Usually these sort of things work best when you match the framework versions. – Wonko Jun 28 '15 at 08:21
  • It look like when I run ngen to see its command line options in the 2.0 .net framework on the azure VM, it does not offer the option of createpdb. meanwhile the 4.0 version offer the createpdb. – Nadzzz Jun 29 '15 at 13:39

1 Answers1

0

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)

Community
  • 1
  • 1
Codeguard
  • 7,787
  • 2
  • 38
  • 41