简体   繁体   English

如何在Visual Studio 2008中打开和编译.net 4.5 Winform应用程序

[英]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: 您可以执行以下操作:

  1. Create a new project in Visual Studio 2008. 在Visual Studio 2008中创建一个新项目。
  2. Add your files to it. 将文件添加到其中。
  3. Go through and remove any references to .NET 4.5 and ensure it builds cleanly under .NET 2.0 or whatever VS2008-compatible framework you're targeting. 仔细阅读并删除对.NET 4.5的所有引用,并确保它在.NET 2.0或您要定位的任何与VS2008兼容的框架下都能干净地构建。
  4. Rinse and repeat until you get a clean build. 冲洗并重复直到获得干净的外观。

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.

相关问题 .NET 4.5 dll在Visual Studio 2008中可以工作吗? - can .NET 4.5 dll work in Visual Studio 2008? .NET,Visual Studio 2008,SVN - 在编译时读取修订版号? - .NET, Visual Studio 2008, SVN - Reading revision number at compile time? 如何防止Visual Studio提示将项目.NET 4升级到.NET 4.5 - How to prevent Visual Studio to prompt to upgrade projects .NET 4 to .NET 4.5 如何打开“测试项目”代码文件夹中的文件? (Visual Studio 2008和.NET C#) - How to open a file inside a Test Project code folder? (Visual Studio 2008 and .NET C#) 如何在WinForm和C#中使用.Net Native(Visual Studio 2015)? - How to use .Net Native in WinForm and C# (Visual Studio 2015)? 如何在Visual Studio 2010中创建Winform应用程序以托管WCF服务 - How to create a winform app in visual studio 2010 to host a wcf service Visual Studio 2010对.NET 4.5的支持 - Visual Studio 2010's support for .NET 4.5 一旦我压缩文件(它们从 Visual Studio 中的文件路径引用打开),如何让我的应用程序从单独的 Winform 打开? (C#) - How do I get my app to open from a separate Winform once I ZIP the files (they open from a file path reference in Visual Studio)? (C#) 运行asp.net 4.5 app visual studio 2017“您的互联网访问被阻止” - Running asp.net 4.5 app visual studio 2017 “your internet access is blocked” 如何将Visual Studio .NET 2008解决方案转换为Visual Studio .NET 2005? - How does one convert a Visual Studio .NET 2008 solution to Visual Studio .NET 2005?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM