I know this is old, but there's an easier way than the listed. This works when you reference two assemblies that share types with the exact same name and namespace.
If you right-click on the Reference to your DLL and select Properties, you will see that here's a property called "Aliases"
The default value is "global". For one of the conflicting assemblies change this to any other value. In the example below, I've changed it from "global" to "destination".
Next, in your code file, you will have to use the extern keyword to use this alias as the root-level namespace for these types. In this example, you would place the following at the top of your .cs file:
extern alias destination
Now, within this file, you can reference both types.
extern alias destination;
namespace Test
{
public static class TestClass
{
public static void Success()
{
var foo = destination::Some.Duplicate.Namespace.SomeDuplicateType();
var bar = Some.Duplicate.Namespace.SomeDuplicateType();
}
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…