Visual Studio 2010中不能再构建.NET v3.5版本 [英] Visual Studio 2010 Can no longer build .NET v3.5

查看:258
本文介绍了Visual Studio 2010中不能再构建.NET v3.5版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个针对.NET v3.5版本2010年的项目。令人费解的是我不能再建V3.5项目。该项目没有添加任何引用。它甚至不会让我添加的引用System.Core程序,因为它是由构建系统的补充。

I have a 2010 project that is targeting .NET v3.5. Inexplicably I can no longer build v3.5 projects. The project doesn't have ANY references added. It won't even let me add a reference to System.Core as it is added by the 'build system'.

警告CS1685:在predefined型'System.Func中定义   在全球多个程序集   别名;使用定义   C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ mscorlib.dll中'

warning CS1685: The predefined type 'System.Func' is defined in multiple assemblies in the global alias; using definition from 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll'

IFilter.cs(82,49):错误CS0433:类型System.Func   存在于两个C:\ Program Files文件   (86)\参考   大会\微软\框架\器v3.5 \ System.Core.dll的'   和   C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319 \ mscorlib.dll中'

IFilter.cs(82,49): error CS0433: The type 'System.Func' exists in both 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\mscorlib.dll'

看起来像是被抓到4.0,但我不太清楚如何解决它。任何其他人碰到这种?

Looks like something is grabbing onto 4.0 but I'm not quite sure how to fix it. Any one else run into this?

同事有同样的问题。花的Windows重新安装到纠正问题

Coworker had this same issue. It took a reinstall of Windows to correct the problem

我已经开了这一个错误:<一href="https://connect.microsoft.com/VisualStudio/feedback/details/558245/warning-cs1685-when-compiling-a-v3-5-net-application-in-visual-studio-2010">https://connect.microsoft.com/VisualStudio/feedback/details/558245/warning-cs1685-when-compiling-a-v3-5-net-application-in-visual-studio-2010

I've opened a bug on this one: https://connect.microsoft.com/VisualStudio/feedback/details/558245/warning-cs1685-when-compiling-a-v3-5-net-application-in-visual-studio-2010

如果编译器设置为verbose我看到这样的:

If the compiler is set to verbose I see this:

FrameworkPathOverride =   C:\ WINDOWS \ Microsoft.NET \框架\ v4.0.30319

FrameworkPathOverride = C:\Windows\Microsoft.NET\Framework\v4.0.30319

这是定义为:

指定mscorlib.dll中的位置   和microsoft.visualbasic.dll中。本   参数相当于   /在VBC.EXE的sdkpath开关   编译器。

Specifies the location of mscorlib.dll and microsoft.visualbasic.dll. This parameter is equivalent to the /sdkpath switch of the vbc.exe compiler.

其他一些有趣的花絮:我创建了一个新的项目一起,不能建立V3.5的。我可以建立2.0,3.0,3.5客户端配置文件,4.0和4.0客户端配置文件没有问题。 VB.NET可以建立V3.5,但C#不能。我已经试过了.NET 3.5,4.0,重新安装和Visual Studio 2010,但没有成功。所示的Visual Studio调试日志什么有趣和安全模式是行不通的。

Some other interesting tidbits: I've created a new project all together and cannot build v3.5 at all. I can build 2.0, 3.0, 3.5 Client Profile, 4.0 and 4.0 Client Profile with no problem. VB.NET can build v3.5 but C# cannot. I've tried a reinstall of .NET 3.5, 4.0 and Visual Studio 2010 with no success. Visual Studio debug logs shown nothing interesting and Safe Mode does not work.

试图避免在Windows重装......

Trying to avoid a Windows reinstall...

编辑:我已经认识到别人都面临这个问题为好。 <一href="http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/b2c30611-633e-4c14-9a6a-257fee9ddf6a">Link, <一href="http://social.msdn.microsoft.com/Forums/en/setup$p$prelease/thread/fe431ea3-4760-43b3-a5c1-2ccb2d2c158d">Link, <一href="http://social.msdn.microsoft.com/Forums/en/sharepointdevelopment$p$prelease/thread/05a9eb3e-eb90-4110-98ca-6b6396ecad4a">Link

I've come to realize others are facing this issue as well. Link, Link, Link

重新安装好几次。 Visual Studio中卸载后,自己不清理。我已经剥离了一个虚拟机来开发的,直到我有机会重新安装我的主要操作系统。

Reinstalled several times. Visual Studio uninstalls do not clean up after themselves. I've spun up a VM to develop on until I have a chance to reinstall my main OS.

推荐答案

这个问题是造成本<一所做的更改href="http://stackoverflow.com/questions/2094694/launch-powershell-under-net-4/2096906#2096906">post.强制的最新CLR版本的装载是什么原因造成的问题。小心!

The problem was the caused by the changes made in this post. Forcing the loading of the latest CLR version is what caused the problem. Be careful!

这篇关于Visual Studio 2010中不能再构建.NET v3.5版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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