Groups | Blog | Home
all groups > dotnet clr > april 2008 >

dotnet clr : How to debug system.typeloadexception


David Morris
4/9/2008 10:59:03 AM
I created an installer package and it works on some machines and not others.
I get an error "system.typeloadexception", which I believe is telling me that
an assembly that is loaded in the GAC on my development machine is missing on
the target machine. Unfortunately, I can't identify the missing assembly from
the message. The target machine is a VM that I can restore so I am looking
for advice on how I can get more information (like a stack trace).

I tried installing the SDK and Visual Studio Express on the target machine
but I still don't have the dbgclr.exe -- I am not sure why. I have reviewed
the approximately 50 DLL's and can't come up with anything that is missing.

How can I identify the missing assembly (if that is the problem). I did
install windbg, which seems to indicate an Infragistics dll may be the
problem but all of the Infragistics dlls from my development machine are in
the application directory and at least some of them load because the window
starts to appear. Here is that trace:

ModLoad: 636d0000 63712000 image636d0000
ModLoad: 636d0000 63712000 C:\Program
Files\HazCat\Client\Infragistics2.Win.UltraWinTabControl.v7.3.dll
(ad4.7b8): C++ EH exception - code e06d7363 (first chance)
(ad4.7b8): C++ EH exception - code e06d7363 (first chance)
ModLoad: 642b0000 6431c000 image642b0000
ModLoad: 642b0000 6431c000 C:\Program
Files\HazCat\Client\Infragistics2.Win.UltraWinEditors.v7.3.dll
(ad4.7b8): C++ EH exception - code e06d7363 (first chance)
(ad4.7b8): C++ EH exception - code e06d7363 (first chance)
ModLoad: 4ec50000 4edf3000
C:\WINDOWS\WinSxS\x86_Microsoft.Windows.GdiPlus_6595b64144ccf1df_1.0.2600.2180_x-ww_522f9f82\gdiplus.dll
ModLoad: 10000000 10020000 System.EnterpriseServices.Wrapper.dll
ModLoad: 10020000 1006e000
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System.EnterpriseSe#\646131eda5f21f4e6216733d49c22c56\System.EnterpriseServices.Wrapper.dll
ModLoad: 10000000 10020000
C:\WINDOWS\assembly\GAC_32\System.EnterpriseServices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.Wrapper.dll
(ad4.7b8): CLR exception - code e0434f4d (first chance)
(ad4.7b8): CLR exception - code e0434f4d (!!! second chance !!!)
eax=0012ec90 ebx=e0434f4d ecx=00000000 edx=00000029 esi=0012ed1c edi=00180f28
eip=7c812a5b esp=0012ec8c ebp=0012ece0 iopl=0 nv up ei pl nz na po nc
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000202
*** ERROR: Symbol file could not be found. Defaulted to export symbols for
C:\WINDOWS\system32\KERNEL32.dll -
KERNEL32!RaiseException+0x52:
7c812a5b 5e pop esi
*** ERROR: Symbol file could not be found. Defaulted to export symbols for
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll -
*** WARNING: Unable to verify checksum for
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\32e6f703c114f3a971cbe706586e3655\mscorlib.ni.dll
*** ERROR: Module load completed but symbols could not be loaded for
C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\32e6f703c114f3a971cbe706586e3655\mscorlib.ni.dll

Thanks,

David Morris
4/9/2008 3:46:01 PM
Thanks for the help. Based on your post, I was able to see the problem when I
installed the right .NET Framework SDK and ran DbgClr.exe. It looks like a
class that is loaded dynamically did not get output by the setup project. I
had installed the 3.5 SDK thinking it was a superset of the 2.0 SDK. It
appears as if it doesn't include the CLR debugger.

Thanks,

David Morris

[quoted text, click to view]
Jeroen Mostert
4/9/2008 11:15:21 PM
[quoted text, click to view]
Try enabling Fusion logging:
http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx

[quoted text, click to view]

dbgclr is installed with the .NET SDK
(http://www.microsoft.com/downloads/details.aspx?FamilyID=fe6f2099-b7b4-4f47-a244-c96d69c35dec).
After that it should be in the "Tools" map of the SDK entry on the Start Menu.

The .NET SDK is not the .NET redistributable, not the Platform SDK, and not
Visual Studio, and dbgclr is included with none of those. There's also
cordbg and mdbg and of course ntsd, cdb and windbg! There's certainly no
shortage of debugging options for Windows.

[quoted text, click to view]
<snip>
Quite useless, I'm afraid.

I have little experience using the managed debuggers (other than VS itself),
but if neither Fusion logs nor dbgclr can help you out, windbg can still
tell you what happened by leveraging some extensions. Try entering the
following when you get a managed exception:

..symfix
..reload
..loadby sos mscorwks
!pe -nested

The latter command prints details of the managed exception. Another useful
command is "!dumpstack -ee" for the managed call stack at the time of the
exception ("!dumpstack" to include unmanaged functions).

Overall, the native debuggers are best at diagnosing interop problems (and
internal CLR errors, if you're so inclined). If you don't need to go that
deep, managed debugging is a lot more convenient.

--
jetan@online.microsoft.com (
4/10/2008 8:11:16 AM
Hi David,

So, if I understand your completely, you have found the class assembly that
is not generated by your setup project, yes? Then, have you managed to
resolve this problem? Do you still need any help on this issue? Thanks.

Best regards,
Jeffrey Tan
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msdnmg@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.


AddThis Social Bookmark Button