PC Review


Reply
Thread Tools Rate Thread

AppDomains and Dynaimc Loading problem

 
 
=?Utf-8?B?Sm9uUy4=?=
Guest
Posts: n/a
 
      15th Feb 2005
Hi,

I posted this article (
http://msdn.microsoft.com/newsgroups...aea&sloc=en-us
) last week, and have yet to receive any replies. If someone could please
give me further information I would greatly appreciate it.

Sincerely,

Jon
 
Reply With Quote
 
 
 
 
Dmitriy Lapshin [C# / .NET MVP]
Guest
Posts: n/a
 
      15th Feb 2005
Hi,

I remember there are two solutions:

a) Playing with AppDomainSetup and AppDomain properties to ensure proper
values of PrivateBinPath and other properties used by the Fusion assembly
loader to locate assemblies.

b) Attaching a handler to the AssemblyResolve event and loading a requested
assembly with Assembly.LoadFrom from a known location.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"JonS." <(E-Mail Removed)> wrote in message
news:62FD5FEE-82A1-4E37-BB36-(E-Mail Removed)...
> Hi,
>
> I posted this article (
> http://msdn.microsoft.com/newsgroups...aea&sloc=en-us
> ) last week, and have yet to receive any replies. If someone could please
> give me further information I would greatly appreciate it.
>
> Sincerely,
>
> Jon


 
Reply With Quote
 
=?Utf-8?B?Sm9uUy4=?=
Guest
Posts: n/a
 
      15th Feb 2005
Hey Dmitriy,

I've been working with your first solution idea. The problem is, as I
belive I stated in the first post, it seems to me that even though I'm
unwrapping the loader in the new appdomain the remote loader, when I use the
AppDomain.CurrentDomain.BasePath it returns the base path of the AppDomain
the main application is running in, and not the new AppDomain I created the
loader in. Also, when I force load the path into the loader it returns a
serialization error stating that it doesn't have enough information or some
such.

Again, this is just driving my crazy trying to figure it out.

Sincerely,

Jon

"Dmitriy Lapshin [C# / .NET MVP]" wrote:

> Hi,
>
> I remember there are two solutions:
>
> a) Playing with AppDomainSetup and AppDomain properties to ensure proper
> values of PrivateBinPath and other properties used by the Fusion assembly
> loader to locate assemblies.
>
> b) Attaching a handler to the AssemblyResolve event and loading a requested
> assembly with Assembly.LoadFrom from a known location.
>
> --
> Sincerely,
> Dmitriy Lapshin [C# / .NET MVP]
> Bring the power of unit testing to the VS .NET IDE today!
> http://www.x-unity.net/teststudio.aspx
>
> "JonS." <(E-Mail Removed)> wrote in message
> news:62FD5FEE-82A1-4E37-BB36-(E-Mail Removed)...
> > Hi,
> >
> > I posted this article (
> > http://msdn.microsoft.com/newsgroups...aea&sloc=en-us
> > ) last week, and have yet to receive any replies. If someone could please
> > give me further information I would greatly appreciate it.
> >
> > Sincerely,
> >
> > Jon

>
>

 
Reply With Quote
 
Dmitriy Lapshin [C# / .NET MVP]
Guest
Posts: n/a
 
      15th Feb 2005
Jon,

As far as I remember, when you load an assembly to an AppDomain, you have to
load all referenced assemblies as well. Handling the AssemblyResolve event
really helps in troubleshooting such problems, and this is the approach I'd
recommend you tried.

--
Sincerely,
Dmitriy Lapshin [C# / .NET MVP]
Bring the power of unit testing to the VS .NET IDE today!
http://www.x-unity.net/teststudio.aspx

"JonS." <(E-Mail Removed)> wrote in message
news:62A2C46E-C13B-4814-B56D-(E-Mail Removed)...
> Hey Dmitriy,
>
> I've been working with your first solution idea. The problem is, as I
> belive I stated in the first post, it seems to me that even though I'm
> unwrapping the loader in the new appdomain the remote loader, when I use
> the
> AppDomain.CurrentDomain.BasePath it returns the base path of the AppDomain
> the main application is running in, and not the new AppDomain I created
> the
> loader in. Also, when I force load the path into the loader it returns a
> serialization error stating that it doesn't have enough information or
> some
> such.
>
> Again, this is just driving my crazy trying to figure it out.
>
> Sincerely,
>
> Jon
>
> "Dmitriy Lapshin [C# / .NET MVP]" wrote:
>
>> Hi,
>>
>> I remember there are two solutions:
>>
>> a) Playing with AppDomainSetup and AppDomain properties to ensure proper
>> values of PrivateBinPath and other properties used by the Fusion assembly
>> loader to locate assemblies.
>>
>> b) Attaching a handler to the AssemblyResolve event and loading a
>> requested
>> assembly with Assembly.LoadFrom from a known location.
>>
>> --
>> Sincerely,
>> Dmitriy Lapshin [C# / .NET MVP]
>> Bring the power of unit testing to the VS .NET IDE today!
>> http://www.x-unity.net/teststudio.aspx
>>
>> "JonS." <(E-Mail Removed)> wrote in message
>> news:62FD5FEE-82A1-4E37-BB36-(E-Mail Removed)...
>> > Hi,
>> >
>> > I posted this article (
>> > http://msdn.microsoft.com/newsgroups...aea&sloc=en-us
>> > ) last week, and have yet to receive any replies. If someone could
>> > please
>> > give me further information I would greatly appreciate it.
>> >
>> > Sincerely,
>> >
>> > Jon

>>
>>


 
Reply With Quote
 
=?Utf-8?B?Sm9uUy4=?=
Guest
Posts: n/a
 
      16th Feb 2005
I've found the answer to this, and most other dynamic loading and unloading
problems at the following location:

http://www.codeproject.com/csharp/Dy...sp#xx1025463xx

I know I'm not the only one who would have these problems, which is why I'm
so surprised to find so little information on it. Anyways, please let me
know if there are any further questions.

Sincerely,

Jon

"JonS." wrote:

> Hi,
>
> I posted this article (
> http://msdn.microsoft.com/newsgroups...aea&sloc=en-us
> ) last week, and have yet to receive any replies. If someone could please
> give me further information I would greatly appreciate it.
>
> Sincerely,
>
> Jon

 
Reply With Quote
 
Colin Stutley
Guest
Posts: n/a
 
      17th Feb 2005
If the base directory of your new domain is not a sub-directory of the
existing domain then you will have problems with this code "as is", but it
should give you the pointers you need [no pun]. The problem with this is
that the loader class needs to be accessible from both assemblies, and it
also has the issue that is a 'dll' is located in both the main directory and
the sub-directory then the main one will load first (yeah, should not
happen, but I have seen users drag copies of old files all over the place).

Did'nt see you post until now - but if you are still getting stuck continue
the thread as I will put a watch point against it.
Not an expert by no means, but ...

- Colin.

"JonS." <(E-Mail Removed)> wrote in message
news:B11CC66A-AEF4-4759-83D0-(E-Mail Removed)...
> I've found the answer to this, and most other dynamic loading and

unloading
> problems at the following location:
>
> http://www.codeproject.com/csharp/Dy...sp#xx1025463xx
>
> I know I'm not the only one who would have these problems, which is why

I'm
> so surprised to find so little information on it. Anyways, please let me
> know if there are any further questions.
>
> Sincerely,
>
> Jon
>
> "JonS." wrote:
>
> > Hi,
> >
> > I posted this article (
> >

http://msdn.microsoft.com/newsgroups...aea&sloc=en-us
> > ) last week, and have yet to receive any replies. If someone could

please
> > give me further information I would greatly appreciate it.
> >
> > Sincerely,
> >
> > Jon



 
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
Complex Problem with AppDomains, Assembly Loading Contexts and COM Interop ObsessivelyCurious Microsoft Dot NET Framework 0 28th Aug 2006 08:49 PM
Loading plugins in separate AppDomains Pete Davis Microsoft C# .NET 6 11th Nov 2005 09:24 PM
AppDomains and Dynamic un/re-loading =?Utf-8?B?QVNheXJl?= Microsoft C# .NET 1 5th Jun 2005 07:29 AM
My other post isn't loading... IE problem loading pages Leuk2 Windows XP Internet Explorer 1 4th Jan 2004 12:24 PM
Serialization w/ AppDomains problem Alan Seunarayan Microsoft Dot NET Framework 2 22nd Dec 2003 09:33 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:48 PM.