473,322 Members | 1,718 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,322 software developers and data experts.

Reflection with .NET2.0

Hello,
I've a problem with loading classes with the Reflection API of .NET2.0.

What I want to do is the following:
I have a directory which has several subdirectories with DLLs and an EXE File.
The EXE File contains a Class which I want to load and create an instance of.
These projects are auto-generated.
All of them have the same namespace and Classname (i.e.: ns: Converter cn:
Conv).
As I work with Threads, I will happen, that two or more of the Classes (with
same name and namespace) will be loaded parallel. It can of course happen,
that the same class will be loaded at the same time.

My problem is the following:
I load the Class "Converter.Conv" from the file
"C:\Converters\Conv1\conv.exe".
I create an object and call a method of it.
But when the next Converter should be loaded from
"C:\Converters\Conv2\conv.exe" the old one gets loaded (the one from
"Conv1\conv.exe").

I use the Assembly.LoadFrom(path); Method. The path is different, but the
resulting Assembly object contains the old reference.

I don't know why this problem occures, as the path is a different one. I
tried to give the class, which I want to load, another name. So the
"Converter.Conv" class is named "Converter.Conv1", "Converter.Conv2",... but
the same problem occurs.

I hope someone understands my problem and can help me to solve it.

greetings

Florian
Nov 25 '05 #1
1 1269
I use the Assembly.LoadFrom(path); Method. The path is different, but the
resulting Assembly object contains the old reference.


The path is irrelevant here since it's not part of the assembly
identity. You need assemblies with different names. Have you tried
compiling them to Conv1.exe and Conv2.exe respectively?
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Nov 25 '05 #2

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

Similar topics

5
by: Scott H | last post by:
I spent most of yesterday looking into this, and still didn't really find an answer... I have a .NET2.0 app that I need to install on a server, and then possibly several other servers later, it...
2
by: bb | last post by:
i use the losformatter to serialise a hashtable and the store in the database. (i save some urls so they can be reconstructed) we have moved the project from asp.net1 to asp.net2 now whenever...
2
by: D. Shane Fowlkes | last post by:
ASP.NET 2 (VB) I'm experimenting with MS VWD and .NET2. I'm tinkering with the Code Behind method as demonstrated on MS's tutorial at...
2
by: Patrick Smacchia | last post by:
Hi, I've just released the book Practical .NET2 and C#2. More info is available on the site http://www.PracticalDOT.NET You can download sample chapters about CLR, Security, Threading/Synchro...
1
by: Winista | last post by:
I have a library that reads PDF file and manipilates its content. And I use SharpZip library to decompress the streams included in PDF file. All well and good. I have 3 lines of my test code that...
4
by: hvj | last post by:
I need to run a .NET1.1 program in a .NET2.0 CLR. The .NET1.1 exe starts correctly in .NET2.0. Now I want to debug in Visual Studio 2005. But when I try to open the .NET1.1 project, Visual Studio...
4
by: InnoCreate | last post by:
Hi everyone, I've developed a couple of asp.net1.1 websites and these are viewable using my mobile phone. I've now moved over to asp.net2 and i'm unable to view asp.net2 websites on my phone. I've...
0
by: Groove | last post by:
(repost!) I have a simple and common scenario. I'm developing pages in VWD and FTP-ing them over to a test servr running Window 2003, NET2 Framework. On my page, I have a DDL that causes a...
4
by: dreamamit2001 | last post by:
Hi, I would like to know the ASP.NET2.0's(Controls, Menubar, Validations, Object Data Souce Controls, Treeview Control) compatibility with IE5.0 browser on Mac OS. If I don't use Client side...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
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: 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....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.