我试图让一个旧的项目工作,我的新安装Windows 7 64位。当我试图编译该项目时,我多次得到以下错误:
Error 11 Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor'
我读过关于同一错误的多个问题,但似乎没有一个解决方案有效,并且与其他目标框架或MVC的不同版本有关。更令人沮丧的是,这个完全相同的项目在我的同事电脑上编译得很完美。
据我所知,我之所以会出现这个错误,是因为该项目正在寻找System.Runtime.CompilerServerices中的System.Core,但它被移到了mscorlib。
我试图重新添加m斯科利布,但当我试图将它添加为编译后的引用时,我会得到以下消息:
当我尝试添加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.
因此,当我尝试添加mscilbv4.0.0.0作为.NET引用时,会得到以下错误消息:
A reference to 'mscorlib' could not be added. This component is already automatically referenced by the build system.
我是不是漏掉了一个具体的更新?我需要重新引用m斯科利布吗?如果是的话,我该怎么做呢?是否有一种方法可以让项目使用System.Core.dll而不是mscorlib?
发布于 2014-12-29 19:10:06
经过一些帮助,我已经卸载了.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。这个项目现在开始工作了!
https://stackoverflow.com/questions/27693797
复制相似问题