我正在尝试让我的新项目安装Windows 7 64位。当我尝试编译项目时,我多次收到以下错误:
Error 11 Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor'
我已经阅读了同一个错误的多个问题,但没有一个解决方案似乎有效,并且与其他目标框架或不同版本的MVC相关。更令人沮丧的是,这个完全相同的项目完全适用于我的同事计算机。
根据我的理解,我收到此错误的原因是因为该项目正在System.Core中查找System.Runtime.CompilerServerices但它已移至mscorlib。
我正在尝试重新添加mscorlib,但是当我尝试将其添加为已编译的引用时,我会收到以下消息:
当我尝试添加mscorlib.dll 2.0时:
A reference to 'mscorlib.dll' could not be added. The ActiveX type library 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.tlb' was exported from a .NET assembly and cannot be added as a reference. Add a reference to the .NET assembly instead.
当我尝试添加mscorlib.dll 2.4时:
A reference to 'mscorlib.dll' could not be added. The ActiveX type library 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.tlb' was exported from a .NET assembly and cannot be added as a reference. Add a reference to the .NET assembly instead.
因此,当我尝试将mscorlib v4.0.0.0添加为.NET参考时,我收到以下错误消息:
A reference to 'mscorlib' could not be added. This component is already automatically referenced by the build system.
我错过了具体的更新吗?我需要重新引用mscorlib吗?如果是这样我该怎么办呢?有没有办法让项目使用System.Core.dll而不是mscorlib?
答案 0 :(得分:1)
经过一些帮助后,我卸载了.Net 4.5并安装了4.0,允许项目编译,但是我收到了以下错误:
Could not load file or assembly 'Microsoft.VisualBasic.Activities.Compiler' or one of its dependencies. An attempt was made to load a program with an incorrect format.
要解决此问题,我必须重新安装.Net 4.5并重新应用VS 2010 SP1。该项目现在正在运作!