Question

I just installed VS 11 within Windows 8. When I got the latest of a solution built with VS 2010, then built it, I'm getting this error (in VS 11):

The predefined type 'System.Tuple' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll'

I haven't been able to find an answer via Google. And I don't know what the "global alias" is. Those words are too generic to find via a Google search.

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

I'm not sure what to do. Anyone know how to resolve this error? And what is the global alias?

Edit - These are the references that currently exist in the project

I tried deleting references that weren't used but I still got the error.

enter image description here

Edit 2 - ANSWER

This System.Tuple, within the Raven assembly, conflicts with the .NET 4.0 System.Tuple. Thank you to Christopher Currens for explaining this in his answer.

enter image description here

Was it helpful?

Solution

It looks like Raven.Abstractions is a .NET 3.5 assembly, instead of a .NET 4.0 reference. If you look at the source code for RavenDB Here, you'll notice that it defines a Tuple<T, U> class if it's being built for .NET 3.5.

You must have updated your project from .NET 3.5 to .NET 4.0 at some point, because I also notice you have a reference to System.Core. In .NET 4, System.Core is reference by default and so that reference in your project is redundant.

My suggestion is you find all assemblies that you are already referencing in your project and replace them with .NET 4 versions, if available. I know that .NET has that extra compatibility, in that it allows two versions of the runtime to be loaded in a process at the same time, but I can't imagine that it doesn't affect performance on some level, even if only a tiny bit. The .NET 4 runtime is superior in a lot of ways though, specifically the large object heap. I guess I'm ranting a little bit. Just update what assemblies you can to 4.0, or change your project's version back down to 3.5.

OTHER TIPS

Just have solved same issue. It appeared that I had hardcoded version of FSharp.Core in one of my projects (it was 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 gone.

Run into the same problem. This time my project is in .NET 4.5 and a referencing .NET 3.5 dll. It failed the build because there are multiple assemblies for the system.tuple. To work around this, my colleague suggested changing the referencing project's aliases (under property) from "global" to something else. That fixes the build warning/error.

Thanks, I have

  • unloaded the project, then
  • right click > Edit, and put
  • <Reference Include="FSharp.Core" />

    like you said.

Warnings gone!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top