[英]how to open and compile .net 4.5 winform app in visual studio 2008
I have developed a program in visual studio 2012, my targeting framework was 4.5 and now i want it to be open in vs 2008. I tried to edit cs file in notepad and edited it, but could not compile. 我已经在Visual Studio 2012中开发了一个程序,我的目标框架是4.5,现在我想在vs 2008中打开它。我试图在记事本中编辑CS文件并对其进行编辑,但无法编译。 Is there any workaround? 有什么解决方法吗? Any help will be highly appreciated. 任何帮助将不胜感激。
Visual Studio 2008 doesn't support the .NET 4.5 Framework. Visual Studio 2008不支持.NET 4.5 Framework。 The maximum it supports is 3.5. 它支持的最大值为3.5。
Similarly, the maximum VS 2010 supports is .NET 4.0. 同样,VS 2010最多支持.NET 4.0。
You can try changing the target framework to 3.5 before opening it in VS2008, but if you're using anything from the newer frameworks, it won't compile. 您可以尝试在VS2008中将目标框架更改为3.5之前将其打开,但是如果您使用的是较新框架中的任何内容,它将无法编译。
Additionally, here's a Wikipedia article with the supported framework (and other information) for each Visual Studio release. 此外,这是Wikipedia文章 ,其中包含每个Visual Studio版本所支持的框架(和其他信息)。
From ScottGu's blog: http://weblogs.asp.net/scottgu/archive/2009/08/27/multi-targeting-support-vs-2010-and-net-4-series.aspx 来自ScottGu的博客: http : //weblogs.asp.net/scottgu/archive/2009/08/27/multi-targeting-support-vs-2010-and-net-4-series.aspx
There isn't any way to target .NET 4 from VS08 and use new features. 无法通过VS08定位.NET 4并使用新功能。 Having said that, .NET4 is upwards comaptible with .NET 3.5 - so applications you build targeting .NET 3.5 with VS08 should work fine on top of .NET 4. 话虽如此,.NET4仍可与.NET 3.5向上兼容-因此,以VS08为目标的.NET 3.5构建的应用程序应能在.NET 4上正常运行。
So in simple words you just can not! 简单来说,你就是不能!
Are you actually using features from the 4.5 framework? 您实际上是在使用4.5框架中的功能吗? There's no IDE-supported way to do this, as other answerers have pointed out. 正如其他答复者指出的那样,没有IDE支持的方法来执行此操作。 What you can do is this: 您可以执行以下操作:
Depending on what you're actually using in code, this may entail a lot of work or very little. 根据您实际在代码中使用的内容,这可能需要大量的工作或很少的工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.