Problem with loading custom objects

Topics: General discussion
Jun 16, 2009 at 9:48 PM

Hi, the scenario I'm facing is that if I have a custom tracelistener and a custom exception handler in a single assembly, I would have to reopen the visual studio in order to load both of them.  For example, I would use my custom tracelistener in my config by using the type selector.  I would browse to the location of the assembly using the Load From File button, great, it was able to see my custom tracelistener.  But when I want to load my custom exception handler, I could no longer get the type selector to load it.  Is this an expected behavior? Is there any way I can load the second one without reopening visual studio?

Thanks.

 

hama

Jun 17, 2009 at 1:36 AM

Yes, that is expected but the reason behind is more of how .NET works and not with how EntLib is designed.  What explains the scenario you are encountering is that when you try to load an assembly which is already loaded in the current appdomain, it will return the same assembly that is loaded even if it has a newer version.  So the easiest workaround is really to restart the Visual Studio.

 

Sarah Urmeneta
Global Technology & Solutions
Avande, Inc.
entlib.support@avanade.com

Jun 17, 2009 at 1:58 AM
Edited Jun 17, 2009 at 2:24 AM

Thanks for your reply.  I'm still not sure about this, why doesn't the config tool have a way around it? 

hama

Jun 17, 2009 at 2:29 AM

The tool doesn't own the AppDomain so it cannot unload it.  This thread explains it further - http://entlib.codeplex.com/Thread/View.aspx?ThreadId=34063

 

Sarah Urmeneta
Global Technology & Solutions
Avande, Inc.
entlib.support@avanade.com