简体   繁体   English

在Visual Studio 2010中更改目标框架

[英]Changing Target Framework in Visual Studio 2010

I have a Solution with a lot of projects and I rewrote one project with other technologies for which i had to change the target framework from .NET 3.5 to .NET 4.0. 我有一个包含许多项目的解决方案,并且我用其他技术重写了一个项目,为此我不得不将目标框架从.NET 3.5更改为.NET 4.0。 All my other projects are in .NET 3.5 我所有其他项目都在.NET 3.5中

Now none of my references seem to work anymore. 现在,我的参考文献似乎都不再起作用。 I have 2k "Are you missing a using directive or an assembly reference?"-Errors 我有2k“您是否缺少using指令或程序集引用?”-错误

I looked at my references in my other projects and there was a little yellow exclamation mark on the one I changed, that looked a bit like this: 我查看了我其他项目中的参考文献,在我更改的项目上有一个黄色的感叹号,看起来有点像这样:

我想成为混蛋

I tried to add the Reference again, some Errors were gone, but that little exclamation mark was still there 我尝试再次添加参考,一些错误消失了,但是仍然有一点惊叹号

Am I doing something wrong? 难道我做错了什么? How can I get rid of that exclamation mark? 我如何摆脱那个感叹号? Is it bad to have different .Net versions in one Solution? 在一个解决方案中拥有不同的.Net版本是否不好? And will it work if i get my References right? 如果我的参考文献正确无误,它将起作用吗?

Is it bad to have different .Net versions in one Solution? 在一个解决方案中拥有不同的.Net版本是否不好?

It's not usual to have this scenario, but it should work as long as the projects that are still on .NET 3.5 don't depend on the project you upgraded to .NET 4.0. 出现这种情况并不常见,但是只要仍在.NET 3.5上的项目不依赖于升级到.NET 4.0的项目,它就可以正常工作。 It would make things easier to manage if you upgraded all the projects, but it's not essential. 如果您升级了所有项目,这将使事情更容易管理,但这不是必需的。

And will it work if i get my References right? 如果我的参考文献正确无误,它将起作用吗?

Yes. 是。

Try removing and readding the references that are showing the error and also clean and rebuild the solution too. 尝试删除和读取显示错误的参考,然后也清理并重建解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio目标框架不会更改为4.0 - Visual Studio target framework not changing to 4.0 基于目标框架的Visual Studio 2010编译器条件 - visual studio 2010 compiler conditions based on target framework Visual Studio中的“目标框架” - “Target Framework” in Visual Studio 在Visual Studio中更改构建配置时更改应用程序目标框架 - Change the application target framework when changing build configurations in Visual Studio 更改目标框架会导致Visual Studio 2015错误 - changing target-framework causes error in visual studio 2015 Visual Studio 2010 +目标框架3.5。 将使用什么版本的c#编译器? - Visual Studio 2010 + Target Framework 3.5. What version of c# compiler will be used? 在Visual Studio 2012中为Office 2010构建VSTO项目时,出现“未安装Project Target Framework”错误 - “Project Target Framework Not installed” error comes when building the VSTO project for Office 2010 in Visual studio 2012 Visual Studio 2010:无法解析目标框架“.NETFramework,Version=v4.0”的 mscorlib - Visual Studio 2010: Could not resolve mscorlib for target framework '.NETFramework,Version=v4.0' 在Visual Studio命令提示符2010中构建c#dll时如何指定.net目标框架? - How to specify .net target framework when building c# dll in Visual Studio Command Prompt 2010? Visual Studio 2010 - 更改语言属性 - Visual Studio 2010 - changing Language property
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM