I just learnt about supporting roundtrip in serialization via DataContract. As I'm sure I will be making mistakes with this mechanism, I want to establish a unit test in Visual Studio to test whether the new versions of my files are ok.
In order to achieve this, I would like to
This sounds simple (or maybe not?), my problem is now that the unit test needs a reference to the current version of my application and to an old version of my application at the same time.
So if I now try to create this object, I get an error saying that this type is defined in two assemblies.
So my question is, how can I handle two references to assemblies that have the same exports.
Can I do something like
OldAssembly.MyClass old;
CurrentAssembly.MyClass new;
> how can I handle two references to assemblies that have the same exports.
You can declare an extern alias for every referenced assembly. This alias is usually global
but you can declare your own either as commandline-argument for the compiler or in visual studio under ReferencedAssemlys/{MyAssemly}/Properties/Aliase.
In you Program you can use
old::My.NameSpace.MyClass old;
global::My.NameSpace.MyClass new;