Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language


 
 
Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

C# Programming

referencing 2 versions of same assembly


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

* 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

-----------------------------------------------Reply-----------------------------------------------

"M R" <moshe.r@zoomix.com> schrieb im Newsbeitrag
news:%23Vf43udoHHA.4188@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

-----------------------------------------------Reply-----------------------------------------------

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" <c@nospam.de> wrote in message

news:eN%23s4beoHHA.3660@TK2MSFTNGP04.phx.gbl...

"M R" <moshe.r@zoomix.com> schrieb im Newsbeitrag
news:OfFqZSfoHHA.1216@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

-----------------------------------------------Reply-----------------------------------------------

yes

"Christof Nordiek" <c@nospam.de> wrote in message

news:u1zQiYfoHHA.4220@TK2MSFTNGP04.phx.gbl...

Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc