Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在VisualStudio2010中引用mscorlib 我的目标框架是.NETFramework4 该项目是一个MVC3项目 我正在使用VisualStudio2010 Windows 7 64位_C#_.net_Asp.net Mvc_Visual Studio 2010_Visual Studio - Fatal编程技术网

C# 在VisualStudio2010中引用mscorlib 我的目标框架是.NETFramework4 该项目是一个MVC3项目 我正在使用VisualStudio2010 Windows 7 64位

C# 在VisualStudio2010中引用mscorlib 我的目标框架是.NETFramework4 该项目是一个MVC3项目 我正在使用VisualStudio2010 Windows 7 64位,c#,.net,asp.net-mvc,visual-studio-2010,visual-studio,C#,.net,Asp.net Mvc,Visual Studio 2010,Visual Studio,我正在尝试让一个旧项目在新安装的64位Windows 7上运行。当我尝试编译项目时,多次出现以下错误: Error 11 Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor' 我已经阅读了关于这个错误的多个问题,但是没有一个解决方案是有效的,并且与其他目标框架或不同版本的MVC相关。更令人沮丧的是,这个完全相同的项目在我同事的电脑上编译得非常完美 据我所知,我

我正在尝试让一个旧项目在新安装的64位Windows 7上运行。当我尝试编译项目时,多次出现以下错误:

 Error  11  Missing compiler required member 'System.Runtime.CompilerServices.ExtensionAttribute..ctor'
我已经阅读了关于这个错误的多个问题,但是没有一个解决方案是有效的,并且与其他目标框架或不同版本的MVC相关。更令人沮丧的是,这个完全相同的项目在我同事的电脑上编译得非常完美

据我所知,我之所以出现此错误,是因为项目正在System.Core中查找System.Runtime.CompilerServers,但它已被移动到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?

在获得一些帮助后,我卸载了.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.

为了解决这个问题,我必须重新安装.NET4.5并重新应用VS2010SP1。该项目正在进行中

是否已安装VS 2010 SP1和所有更新?是的,已安装所有windows 7更新和VS 2010 SP1。我当前正在重新应用SP1,以确保其安装正确。可能存在错误引用的问题。你确定你的项目/解决方案指向的是框架的正确版本吗?@WarGravy-我指的是所有VS 2010更新,例如Web工具更新和Web标准更新。。。