如何查找 Visual Studio 项目的 .NET 框架版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3231632/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-03 14:31:03  来源:igfitidea点击:

How to find the .NET framework version of a Visual Studio project?

.netversion

提问by Novice Developer

I have a project in Visual Studio. How can I find out which .NET Framework version it's for?

我在 Visual Studio 中有一个项目。如何找出它适用于哪个 .NET Framework 版本?

回答by SLaks

It depends which version of Visual Studio:

这取决于哪个版本的 Visual Studio:

  • In 2002, all projects use .Net 1.0
  • In 2003, all projects use .Net 1.1
  • In 2005, all projects use .Net 2.0
  • In 2008, projects use .Net 2.0, 3.0, or 3.5; you can change the version in Project Properties
  • In 2010, projects use .Net 2.0, 3.0, 3.5, or 4.0; you can change the version in Project Properties
  • In 2012, projects use .Net 2.0, 3.0, 3.5, 4.0 or 4.5; you can change the version in Project Properties
  • 2002年,所有的项目都使用的.Net 1.0
  • 2003,所有的项目都使用的.Net 1.1
  • 2005年,所有的项目都使用的.Net 2.0
  • 2008年,项目中使用的.Net 2.0,3.0,或3.5; 您可以在项目属性中更改版本
  • 2010,项目中使用的.Net 2.0,3.0,3.5,或4.0; 您可以在项目属性中更改版本
  • 2012,项目中使用的.Net 2.0,3.0,3.5,4.0或4.5; 您可以在项目属性中更改版本

Newer versions of Visual Studio support many versions of the .Net framework; check your project type and properties.

较新版本的 Visual Studio 支持许多版本的 .Net 框架;检查您的项目类型和属性。

回答by Jonathan Allen

  • VB
  • VB

Project Properties -> Compiler Tab -> Advanced Compile Options button

项目属性 -> 编译器选项卡 -> 高级编译选项按钮

  • C#
  • C#

Project Properties -> Application Tab

项目属性 -> 应用程序选项卡

回答by Chetan S

The simplest way to find the framework version of the current .NET project is:

查找当前 .NET 项目的框架版本的最简单方法是:

  1. Right-click on the project and go to "Properties."
  2. In the first tab, "Application," you can see the target framework this project is using.
  1. 右键单击该项目并转到“属性”。
  2. 在第一个选项卡“应用程序”中,您可以看到该项目正在使用的目标框架。

回答by uglydawg

You can also search the Visual Studio project files for the XML tag RequiredTargetFramework. This tag seems to exist on .NET 3.5 and higher.

您还可以在 Visual Studio 项目文件中搜索 XML 标记 RequiredTargetFramework。此标记似乎存在于 .NET 3.5 及更高版本上。

For example: <RequiredTargetFramework>3.5</RequiredTargetFramework>

例如: <RequiredTargetFramework>3.5</RequiredTargetFramework>

回答by 404 Not found

Simple Right Click and go to Properties Option of any project on your Existing application and see the Application option on Left menu and then click on Application option see target Framework to see current Framework version .

简单的右键单击并转到现有应用程序上任何项目的属性选项,然后查看左侧菜单上的应用程序选项,然后单击应用程序选项查看目标框架以查看当前框架版本。

回答by Jiby Matthews

It's as easy as in your Visual studio.

这就像在您的 Visual Studio 中一样简单。

  1. go to the 4th menu option on top, 'website'.
  2. under websites go to option, 'start options'.
  3. under start options, go to 'build' option.
  4. change the target framework there to what so ever framework.
  1. 转到顶部的第四个菜单选项“网站”。
  2. 在网站下转到选项,“开始选项”。
  3. 在开始选项下,转到“构建”选项。
  4. 将那里的目标框架更改为任何框架。

回答by Tahir77667

With Respect to .NET Framework 4.6 and Visual Studio 2017 you can take the below steps:

对于 .NET Framework 4.6 和 Visual Studio 2017,您可以采取以下步骤:

  1. On the option bar at the top of visual studio, select the 4th option "Project" and under that click on the last option which says [ProjectName]Properties.Click on it & you shall see a new tab has been opened.Under that select the Application option on the left and you will see the .NET Framework version by the name "Target Framework".
  2. Under Solution Explorer's tab select your project and press Alt + Enter.
  3. OR simply Right-click on your project and click on the last option which says Properties.
  1. 在visual studio顶部的选项栏上,选择第四个选项“Project”,然后点击最后一个选项[ ProjectName]Properties。点击它,你会看到一个新选项卡已经打开。在该选项下选择左侧的 Application 选项,您将看到名为“Target Framework”的 .NET Framework 版本。
  2. 在解决方案资源管理器的选项卡下选择您的项目并按Alt + Enter
  3. 或者只需右键单击您的项目,然后单击最后一个选项Properties

回答by Mellina

You can't change the targeted version of either Windows or the .NET Framework if you create your project in Visual Studio 2013. That option is not available anymore.

如果在 Visual Studio 2013 中创建项目,则无法更改 Windows 或 .NET Framework 的目标版本。该选项不再可用。

Look that link from Microsoft: http://msdn.microsoft.com/en-us/library/bb398202.aspx

查看来自 Microsoft 的链接:http: //msdn.microsoft.com/en-us/library/bb398202.aspx