.net 在 Visual Studio 2008 中更改目标框架
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/188091/
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
Changing target framework in Visual Studio 2008
提问by Saif Khan
What's the deal with Visual Studio?
与 Visual Studio 有什么关系?
I tried importing the Caching App Block and got this message:
我尝试导入缓存应用程序块并收到此消息:
The assembly or one of its dependencies you're are trying to import requires a later version of .NET Framework.
您尝试导入的程序集或其依赖项之一需要更高版本的 .NET Framework。
I went to the properties of my application in Visual Studio, but I can't find the dropdown to switch....what's the deal?
我在 Visual Studio 中转到了我的应用程序的属性,但找不到要切换的下拉列表....这是怎么回事?
回答by Saif Khan
Found it....went to "Advanced Compile Options" on Compile Tab.....weird!
发现它......去编译选项卡上的“高级编译选项”......奇怪!
回答by sudarpo.net
I think they make it different for C# project and VB project.
我认为它们使 C# 项目和 VB 项目有所不同。
C# project
C#项目
Solution Explorer --> Project --> Properties and on the Application tab you'll see Target Framework.
解决方案资源管理器 --> 项目 --> 属性,在应用程序选项卡上,您将看到目标框架。
VB project
VB项目
Project Properties --> Compile --> Advanced Compile Options
项目属性 --> 编译 --> 高级编译选项
回答by Michael Murphy
In Visual Studio 2008, the Targeted Framework option was greyed out for me. I had to follow the instructions in article How to: Modify the Target Framework and Platform Toolsetto change the Targeted Framework so that two related projects could work together.
在 Visual Studio 2008 中,目标框架选项对我来说是灰色的。我必须按照如何:修改目标框架和平台工具集一文中的说明更改目标框架,以便两个相关项目可以协同工作。
Basically you unload the project with the wrong framework, open the project file in Visual Studio as a text file, find the line in the XML that specifies the Targeted Framework and change that to the desired framework. Save the file and reload the project.
基本上,您使用错误的框架卸载项目,在 Visual Studio 中将项目文件作为文本文件打开,在 XML 中找到指定目标框架的行并将其更改为所需的框架。保存文件并重新加载项目。
回答by Jon Tackabury
It should be on the Application tab in the project's properties. A great article on how Visual Studio 2008 handles framework targeting is VS 2008 Multi-Targeting Support.
它应该在项目属性的应用程序选项卡上。关于 Visual Studio 2008 如何处理框架目标的一篇很棒的文章是VS 2008 多目标支持。
回答by Jon Tackabury
Go to the properties of a project (Solution Explorer --> Project --> Properties or Menu Bar --> Project --> Properties) and on the Application tab you'll see Target Framework.
转到项目的属性(解决方案资源管理器 --> 项目 --> 属性或菜单栏 --> 项目 --> 属性),在应用程序选项卡上,您将看到目标框架。

