0

I added a reference (LinqBridge.dll) to my existing project and the references are conflicted like below.

Error 74 The type 'System.Action' exists in both 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll' and 'G:\Projects\Test1\Test.UI\Bin\LinqBridge.dll' G:\Projects\Test1\Test.UI\App_Code\Tools\UrlMap.cs 50 88 G:...\Test.UI\

What is the best way to solve this issue ?

Thanks in advance,

I found something related on this issue but I didnt undestand what exactly I should do.

With NAnt, How to use C# 3.0 compiler while targetting .NET 2.0 runtime?

Reference 2 dlls using the same namespace in vb.net 3.5 project?

Community
  • 1
  • 1
Barış Velioğlu
  • 5,709
  • 15
  • 59
  • 105

2 Answers2

2

You can you etern aliases. This allows you to define fully-qualified types when the project is compiled.

Go to Solution Explorer. Expand the References tab of your project so that you can see the list of referenced assemblies. Click on the assembly that you wish to assign an alias name. Now look in the Properties Window for the "Aliases" property. Notice that the default value is "global". Change it to anything that you wish.

In code you would reference the namespace using the full-qualified namespace, using the alias.

using linqBridge::System.Action;

In essence this uses the /r switch on the command line when the project is compiled.

/r:linqBridge=LinqBridge.dll
TheCodeKing
  • 19,064
  • 3
  • 47
  • 70
0

You will have to assign an extern alias to your reference to LinqBridge.dll and refer to its types in your program through that alias, e.g. bridge::LinqBridge.Types.Foo, or with a using directive like

using LinqBrigdeTypes = bridge::LinqBridge.Types ;
Anton Tykhyy
  • 19,370
  • 5
  • 54
  • 56