Wednesday, January 18, 2012

Alias for reference project in .Net

Sometimes I need to have a project in C#, that refers to two different assemblies that, however, contain one or more same classes.
This should not happen final products, but it can happen when testing or debugging.

Here is how to resolve the issue:

1. In reference properties add alias, e.g. aliases: global, custom
2. In the file that uses the classes that appear in two references:

extern alias custom;

using custom::MyPackage;