The extern alias 'xxx' was not specified in a /reference option

Posted by Brian Ensink on Stack Overflow See other posts from Stack Overflow or by Brian Ensink
Published on 2010-03-23T18:38:18Z Indexed on 2010/03/23 18:43 UTC
Read the original article Hit count: 2252

Filed under:
|

I have two assemblies that unfortunately define the same type in the same namespace. I'm trying to use a an extern alias to work around the problem. In the Visual Studio IDE I have set the "Aliases" property of the reference to my alias. This is supposed to change the C# compiler command line to be something like this:

/reference:MyAlias=MyAssembly.dll

But it doesn't actually do that. The Visual Studio IDE seems to just ignore the Aliases property setting on the reference. So when I go and add the line extern alias MyAlias; at the top of my C# code file I get the error that the alias was not specified in a /reference option to the compiler. I can't figure out what I am doing wrong. Any ideas?

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET