PC Review


Reply
Thread Tools Rate Thread

CallContext and unloading AppDomain

 
 
Michael Per
Guest
Posts: n/a
 
      2nd Aug 2005
Two features of the framework seem to be conflicting in my ASP.NET
project and I'd appreciate any help on this.

1. I'm using CallContext to persist some values thru the remoting call.
In particular, I grab client's locale info so I can analyze it on the
remoting server.

2. I create a new AppDomain for dynamically compiled code, execute the
code and unload the domain after I'm done to free up the resources.

Both approaches work fine by themselves, however when put it all
together it bombs out. I got CallContextString class implementing
ILogicalThreadAffinative so I can put it into the CallContext. This
class resided in MyCallContext.dll. When I load new AppDomain with the
AppDomain.CreateInstance I get the error that MyCallContext.dll is not
found. That's understandable 'cause the Remoting needs the assembly to
deserialize the CallContext. I put the MyCallContext.dll into the
target directory of the new domain. Now the AppDomain loads and I can
do my stuff. However when I try to unload the AppDomain with
AppDomain.Unload(myDomain) I get the error again: MyCallContext.dll is
not found! And here's where I'm stuck and don't know what to do. I can
only guess that maybe Remoting is trying to serialize the CallContext
to send it further on the call during the AppDomain.Unload, and maybe
MyCallContext.dll is already unloaded at this point. Not sure really.
Any help is greatly appreciated.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unloading AppDomain won't release DLL handles MRe Microsoft C# .NET 2 18th Apr 2010 12:12 AM
C# DLL unloading appdomain Tim Microsoft C# .NET 2 13th Jul 2007 09:29 AM
AppDomain unloading problem =?Utf-8?B?RXRpZW5uZSBGb3J0aW4=?= Microsoft Dot NET Framework 0 1st Sep 2005 05:37 PM
Unloading an AppDomain Phil Jones Microsoft Dot NET Framework 10 16th Apr 2005 10:10 PM
Problem unloading a DLL from a separate AppDomain. Colin Svingen Microsoft Dot NET Framework 1 20th Dec 2003 09:56 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:13 PM.