I have the the following problem that starts to drive me nuts.
I have a class say Class1
in Assembly1. I moved Class1
to Assembly2 and obsoleted Class1
in Assembly2 (Kept the same namespace and I can't remove it now to avoid a breaking change for my users).
Now I have a unit test assembly, TestAssembly2 that references both assemblies Assembly1 and Assembly2. Now I get a compilation problem Class1
ambiguity when trying to use Class1
in my unit tests. This makes sense as I have two Class1
in both assemblies Assembly1 and Assembly2.
QUESTION
Is there a way to tell the compiler to use Class1
defined in Assembly2 (as the one in Assembly1 is obsolete) not Assembly1?
EDIT I can't use type forwarding as Assembly1 must not have a reference to Assembly2 :(