有关ExtensionAttribute奇怪的警告 [英] strange warning about ExtensionAttribute

查看:660
本文介绍了有关ExtensionAttribute奇怪的警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到一个奇怪的警告:

I'm getting a strange warning:

预定义类型'System.Runtime.CompilerServices.ExtensionAttribute在多个组件定义在全球别名;使用定义由C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll

The predefined type 'System.Runtime.CompilerServices.ExtensionAttribute' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll'

有没有行号给出,所以很难搞清楚什么是对的。

There is no line number given, so it's hard to figure out what it's on about.

编译器错误代码是 CS1685

推荐答案

是否使用的是已经实现了这个属性(完全相同的名称)某人的DLL(或自己)本身采用预NET 3.5的运行时的一些C#3.0的功能的一种手段? (惯常的伎俩)

Are you using someone's dll (or your own) which had implemented this attribute (with exactly the same name) itself as a means of using some c# 3.0 features on pre .Net 3.5 runtimes? (A common trick)

这是可能的原因。由于它使用的是正确的(MS一个在GAC中),这是不是你虽然应该追捕其他并删除它的问题。

This is the probable cause. Since it is using the correct one (the MS one in the GAC) this is not a problem though you should hunt down the other and remove it.

这篇关于有关ExtensionAttribute奇怪的警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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