473,323 Members | 1,537 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

AppDomains and Dynaimc Loading problem

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
Nov 16 '05 #1
5 2026
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." <Jo**@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com...
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


Nov 16 '05 #2
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." <Jo**@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com...
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


Nov 16 '05 #3
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." <Jo**@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com...
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." <Jo**@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com...
> 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



Nov 16 '05 #4
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

Nov 16 '05 #5
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." <Jo**@discussions.microsoft.com> wrote in message
news:B1**********************************@microsof t.com...
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

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sam Martin | last post by:
Hi All, I've got a problem where my application loads an assembly in the running AppDomain when it shouldn't. Ok, I've got a RemotingHost application that configs the remoting stuff and...
1
by: ASayre | last post by:
I'm currently developing a client that connects to a server and exchanges data with the server back and forth. The client retains the data in specified classes depending on what was received. While...
6
by: Pete Davis | last post by:
I'm confused about what precisely the limitations are on loading plugins in separate app domains. In all my previous apps that supported plugins, I've loaded them into the same domain as the app,...
18
by: Joe Fallon | last post by:
I have some complex logic which is fairly simply to build up into a string. I needed a way to Eval this string and return a Boolean result. This code works fine to achieve that goal. My...
2
by: Jody L. Whitlock | last post by:
Okay, I've banged my head against a wall for over a year now. Maybe I'm just a rock when it comes to this. I've got a new project, a Windows Service. The "application" itself is in a DLL that...
8
by: Michael Bray | last post by:
I'm writing a library to provide plugin capability to my applications. It does this by loading DLL's into a new AppDomain for each plugin that is loaded. Now obviously when I write a plugin, I...
8
by: Fred Mertz | last post by:
I'm working towards an MCTS cert and I'm having to learn a bunch of stuff that I doubt I'd stumble across on my own. One such feature of .NET is AppDomains; programatically creating new AppDomains...
3
by: | last post by:
If this is simple, forgive my ignorance, but I'm coming from the CompactFramework where we don't use AppDomains. I did a fair bit of archive searching and couldn't find an answer and I got no...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.