所以,(貌似)出蓝色的,我的项目开始获得编译器警告1685:C#编译器警告1685
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'
困惑,我研究的MSDN文章,找出其原因。这里是我发现的信息:
Visual C# Reference: Errors and Warnings Compiler Warning (level 1) CS1685
Error Message The predefined type 'System.type name' is defined in multiple assemblies in the global alias; using definition from 'File Name'
This error occurs when a predefined system type such as System.int32 is found in two assemblies. One way this can happen is if you are referencing mscorlib from two different places, such as trying to run the.Net Framework versions 1.0 and 1.1 side-by-side.
The compiler will use the definition from only one of the assemblies. The compiler searches only global aliases, does not search libraries defined /reference. If you have specified /nostdlib, the compiler will search for Object, and in the future start all searches for predefined types in the file where it found Object.
现在我真的很挠我的脑袋。
我不是运行两个不同的版本 .NET框架 的(除非你把2.0和3.5)。
我没有参考任何奇怪的 程序集,可能会使我 可疑。
我不记得对我的应用程序进行任何可能会引发此更改的更改。
我已验证所有组件的目标是.NET Framework版本v2.0.50727。
我很乐意接受有关如何解决此问题的建议或想法。我把警告视为错误,这让我发疯。
真的让我感到困扰的是,我不知道为什么它的发生。发生的事情应该有一个可辨别的原因,我应该知道他们为什么发生。如果我无法解释它,我无法准确补救它。猜测永远不会令人满意。
该应用程序很简单,由一个类库和一个Windows窗体应用程序组成。
C#类库DLL提供封装数据库访问的基本功能。该DLL引用以下组件:
- 系统
- System.Core程序
- System.Core.Data
- System.Data
- System.Data.DataSetExtensions
- System.Data.OracleClient的
- System.Drawing
- System.Windows.Forms
- 的System.Xml
- System.Xml.Linq的
一个C#Windows窗体应用程序提供UI。此应用程序引用以下组件:
- CleanCode
- CleanCodeControls(这些提供语法编辑器支持,并建立本地对.NET 3.5)。
- LinqBridge
- Roswell.Framework(上面的类库)
- 系统
- System.Core程序
- System.Data
- System.Data.DataSetExtensions
- System.Data.OracleClient的
- System.Deployment
- System.Design
- System.Drawing中
- System.Windows.Forms的
- 的System.Xml
- System.Xml.Linq的
让我知道如果你需要更多信息,我会很乐意提供它。
看到以下内容:http://stackoverflow.com/questions/546819/strange-警告关于扩展属性 建议你关闭这个问题它是一个确切的重复 – ShuggyCoUk 2009-03-02 16:22:46
顺便说一句,这确实是LinqBridge这是造成这种情况,你不再需要它 – ShuggyCoUk 2009-03-02 16:23:26
我做了一个警告号码搜索,找不到任何问题包含它;我为重复道歉。顺便说一句,LinqBridge事实上是这个问题。谢谢! – 2009-03-02 16:29:22