referencing 2 versions of same assembly

  • Thread starter Thread starter Jesse Houwing
  • Start date Start date
J

Jesse Houwing

* 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
 
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 said:
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
 
M R said:
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
 
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
 
Back
Top