System.Tuple在多个组件定义 [英] System.Tuple defined in multiple assemblies

查看:131
本文介绍了System.Tuple在多个组件定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

,然后建立它,我得到这个错误(在VS 11):

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):

在predefined型'System.Tuple在多个组件定义   在全球的别名;使用定义的C:\ Program Files文件   (86)\参考   大会\微软\ Framework.NETFramework \ V4.0 \ mscorlib.dll中'

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自动地做了一些改变,让我解开这些,重新编译,并得到了同样的错误。

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?

修改 - 这是当前存在于项目中的引用

我尝试删除未使用的引用,但我仍然得到了错误。

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

修改2 - 答案

System.Tuple ,乌鸦组件内,与.NET 4.0的冲突 System.Tuple 。感谢您对克里斯托弗Currens在他的回答说明这一点。

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.

推荐答案

看起来Raven.Abstractions是不是一个.NET 4.0参考.NET 3.5组件。如果你看一下源$ C ​​$ C 为RavenDB这里,你会发现,它定义了一个元组LT; T,U> 类,如果它被建为.NET 3.5

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.

您必须升级您的项目从.NET 3.5到.NET 4.0在某些时候,因为我也注意到你有一个参考来System.Core程序。在.NET 4中,System.Core程序是默认的基准,因此,在您的项目引用是多余的。

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.

我的建议是,你发现你已经在你的项目中引用的所有组件,并与.NET更换4个版本,如果有的话。我知道,.NET有额外的兼容性,因为它允许在一个进程的同时加载两个版本的运行时间,但我无法想象它不会影响在一定程度上表现的 的,哪怕只是一点点。在.NET 4运行时是在很多方面都优于虽然,特别是大型对象堆。我想我咆哮一点点。刚刚更新哪些组件,你可以到4.0,或向下改变你的项目的版本回到3.5。

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.

这篇关于System.Tuple在多个组件定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆