Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / April 2008

Tip: Looking for answers? Try searching our database.

How to debug system.typeloadexception

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Morris - 09 Apr 2008 18:59 GMT
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
Jeroen Mostert - 09 Apr 2008 22:15 GMT
> 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).

Try enabling Fusion logging:
http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx

> 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.

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.

> I have reviewed the approximately 50 DLL's and can't come up with
> anything that is missing.
[quoted text clipped - 4 lines]
> the application directory and at least some of them load because the window
> starts to appear. Here is that trace:

<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.

Signature

J.

David Morris - 09 Apr 2008 23:46 GMT
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

> > 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
[quoted text clipped - 47 lines]
> internal CLR errors, if you're so inclined). If you don't need to go that
> deep, managed debugging is a lot more convenient.
Jeffrey Tan[MSFT] - 10 Apr 2008 09:11 GMT
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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.