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

referencing 2 versions of same assembly

M R
how can i reference two versions of the same assembly? they exist in two
seperate files. since they have the same name they can't simply be
referenced.

(i am writing a program that updates data that was serialized with version 1
of the class/assembly and store it in the class format for version 2)

thanks
m
May 29 '07 #1
5 4480
* M R wrote, On 29-5-2007 13:23:
how can i reference two versions of the same assembly? they exist in two
seperate files. since they have the same name they can't simply be
referenced.

(i am writing a program that updates data that was serialized with version 1
of the class/assembly and store it in the class format for version 2)
I think the only way to do this is to load each assembly in a different
AppDomain. It's not going to be easy. Can't you Update the code in
Assembly 2 to understand the way objects were serialized in Assembly 1?
This is how I usually do this....

Jesse
May 29 '07 #2
"M R" <mo********@zoomix.comschrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP02.phx.gbl...
how can i reference two versions of the same assembly? they exist in two
seperate files. since they have the same name they can't simply be
referenced.
Not tested, but should work:

1 In the propertie window of the reference set specific version to true;
2 For each reference in the propertie window aliases enter an identifier
scecific for the version eg. WidgetsV1 and WidgetsV2
3 In codefiles where you want to referent one or both of that assemblies
enter an extern alias directive with the identifier from point 2.
4 reference the class in following form:
WidgetsV1::NamespaceName.ClassName
This also can be done in a using directive.

HTH
Christof
May 29 '07 #3
M R
thanks for your reply

The problem is that i can't add additional references. i get an error that
says a reference to that component already exists
"Christof Nordiek" <cn@nospam.dewrote in message
news:eN****************@TK2MSFTNGP04.phx.gbl...
"M R" <mo********@zoomix.comschrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP02.phx.gbl...
>how can i reference two versions of the same assembly? they exist in two
seperate files. since they have the same name they can't simply be
referenced.

Not tested, but should work:

1 In the propertie window of the reference set specific version to true;
2 For each reference in the propertie window aliases enter an identifier
scecific for the version eg. WidgetsV1 and WidgetsV2
3 In codefiles where you want to referent one or both of that assemblies
enter an extern alias directive with the identifier from point 2.
4 reference the class in following form:
WidgetsV1::NamespaceName.ClassName
This also can be done in a using directive.

HTH
Christof

May 29 '07 #4
"M R" <mo********@zoomix.comschrieb im Newsbeitrag
news:Of**************@TK2MSFTNGP03.phx.gbl...
thanks for your reply

The problem is that i can't add additional references. i get an error that
says a reference to that component already exists
Did you set "explicit Version" of the first reference to true, before adding
the second reference?

Christof
May 29 '07 #5
M R
yes

"Christof Nordiek" <cn@nospam.dewrote in message
news:u1**************@TK2MSFTNGP04.phx.gbl...
"M R" <mo********@zoomix.comschrieb im Newsbeitrag
news:Of**************@TK2MSFTNGP03.phx.gbl...
>thanks for your reply

The problem is that i can't add additional references. i get an error
that says a reference to that component already exists
Did you set "explicit Version" of the first reference to true, before
adding the second reference?

Christof

May 29 '07 #6

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

Similar topics

3
by: Mart Rogers | last post by:
We have a situation where we have decided (in an attempt to keep things simple) to stick to local assemblies rather than global ones. However we now have the following situation looming AssyA ...
0
by: Ken Durden | last post by:
I'm working on a client-server application where the client is controlling two devices (aka servers) which both implement the same interface contract. We have a set of about 4 assemblies which...
10
by: Doug Crabtree | last post by:
I am kinda new to the whole distribution process. I several programs that I am writing that use common .NET DLLs. I want each program to use the same DLLs in a "COMMON" folder. How do I get...
12
by: Mike | last post by:
I found this question before I asked mine: ----<previous question>---- We are clearly going about this the wrong way so before we get too far I would like some advice. We have all common...
4
by: Christopher C. Bernholt | last post by:
We have a solution which contains 2 projects. The first project is a windows control and it references an assembly. The second project is a test windows application used to test the windows...
1
by: Tim F | last post by:
Problem: I'm receiving the error "File or assembly name XXXXX or one of its dependencies, was not found." when trying to execute code in an assmebly that has both a strong-name and has been...
7
by: Wiebe Tijsma | last post by:
Hi, I'm running a web application application using the Microsoft.Interop.Security.AzRoles version 1.2.0.0 in the GAC. After an upgrade to Vista, I also have a version 2.0.0.0 in the GAC. I...
1
by: Dave Anson | last post by:
What is the recommended practice for referencing assemblies in a project from other solutions? I am using Visual Studio 2005 Team System. I have several assemblies in another solution which will...
3
by: =?Utf-8?B?a3lvbmc=?= | last post by:
Quick question. Say I have a project against the 2.0framework. I also have a dll compiled against 3.5. If I reference the 3.5 dll in the 2.0 project, how would that work? So I'm thinking that...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.