[英]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.