System.Tuple defined in multiple assemblies

I just installed VS 11 on Windows 8. When I got the latest solution built on VS 2010, then built it, I get this error (in VS 11):

The predefined type "System.Tuple" is defined in several assemblies in a global alias; using the definition from 'c: \ Program Files (X86) \ Assembly Link \ Microsoft \ Framework.NETFramework \ v4.0 \ mscorlib.dll'

I could not find the answer through Google. And I do not know what a "global alias" is. These words are too universal to search through a Google search.

VS 11 automatically made some changes, so I unzipped them, recompiled, and got the same error.

I'm not sure what to do. Does anyone know how to resolve this error? And what is a global alias?

Edit - these are the links that currently exist in the project

I tried to remove links that were not used, but I still have an error.

enter image description here

Change 2 - ANSWER

This System.Tuple , inside the Raven assembly, conflicts with the .NET 4.0 System.Tuple . Thanks to Christopher Carrens for explaining this in his answer.

enter image description here

+6
source share
4 answers

Raven.Abstractions seems to be a .NET 3.5 build, not a .NET 4.0 link. If you look at the source code for RavenDB here , you will notice that it defines the class Tuple<T, U> if it is created for .NET 3.5.

At some point, you should upgrade your project from .NET 3.5 to .NET 4.0, because I also notice that you have a link to System.Core. In .NET 4, System.Core is the default link and therefore the link in your project is redundant.

My suggestion is that you will find all the assemblies that you have already specified in your project, and replace them with .NET 4 versions, if available. I know that .NET has such additional compatibility because it allows you to simultaneously load two versions of the runtime into a process, but I can’t imagine that this does not affect performance at some level, even if only a little. The .NET 4 runtime is superior in many ways, in particular a large bunch of objects. I guess I was a little ranted. Just update which builds you can add in 4.0, or change the version of your project to 3.5.

+5
source

Just solved the same problem. It turned out that I had a hard-coded version of FSharp.Core in one of my projects (it was a C # project, btw). After changing <Reference Include="FSharp.Core, Version=2.3.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" /> to <Reference Include="FSharp.Core" /> warning has passed.

+3
source

Run the same problem. This time my project is in .NET 4.5 and is referencing DLL.NET 3.5. This failed because there are several builds for system.tuple. To get around this, my colleague suggested changing the project’s reference aliases (under the property) from “global” to another. This fixes a warning / build error.

+1
source

Thanks i have

  • uploaded the project, then
  • right click> Modify and set
  • <Reference Include="FSharp.Core" />

    as you said.

Warnings are gone!

0
source

Source: https://habr.com/ru/post/909868/


All Articles