Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

AppDomain.Unload hangs.

393 views
Skip to first unread message

dlgproc

unread,
Feb 9, 2009, 1:25:11 PM2/9/09
to
I have a Windows Forms app written in C# running under the 3.5sp1 framework.
I create an AppDomain to load in an assembly and execute it’s code. Sometimes
the application hangs when calling AppDomain.Unload(). What would make
AppDomain.Unload() hang? What things should I look into when debugging this
issue?

Any suggestions are greatly appreciated.

ri...@lander.ca

unread,
Feb 11, 2009, 8:57:57 AM2/11/09
to
Do you have a reliable repro that we could look at?

Rich Lander
CLR Program Manager
Microsoft

dlgproc

unread,
Feb 11, 2009, 10:25:02 AM2/11/09
to
No, sorry. I wish I did. Part of the problem is that it’s intermittent and I
don’t know under what circumstances it’s happening. I was hoping someone
could give me some things to look for in my code as possible suspects.

Günter Prossliner

unread,
Feb 11, 2009, 11:03:12 AM2/11/09
to
Hello!

> No, sorry. I wish I did. Part of the problem is that it's
> intermittent and I don't know under what circumstances it's
> happening. I was hoping someone could give me some things to look for
> in my code as possible suspects.

The first thing to analyse this would be to take a dump when the hang
occures (If it is reproducable on your box and not only in production /
customer side, then you may also use interactive debugging).

Download the "Debugging Tools for Windows", and use windbg / cdbg to dump
your process.

You may also use the "adplus.vbs" which utilizes cdbg and provides a various
cmd-line args.

Just execute: "adplus -hang -p 1234" where 1234 is the PID of your app. When
the process is finished, you find a .dmp file within a subfolder of the
installation directory of the Debugging Tools for Windows.

Load this dump into windbg and look at the (managed and unmanaged) callstack
of the executing threads. When it comes to unmanaged debugging (basically
into mscorwks) you should ensure that you have the symbol server configured.

There is a very good msdn blog that covers that topic:

http://blogs.msdn.com/tess


If you have further questions feel free to ask!

GP


dlgproc

unread,
Feb 11, 2009, 1:17:01 PM2/11/09
to
Cool. I'll give that a shot the next time it hangs on me.
Thanks!

Phil Wilson

unread,
Feb 12, 2009, 7:13:42 PM2/12/09
to
Do you use Finalizers much? That's a possible source of problems like this.
--
Phil Wilson
Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"dlgproc" <dlg...@discussions.microsoft.com> wrote in message
news:4A1C646A-0C6F-4201...@microsoft.com...

0 new messages