[英]How do I change the .Net Framework from version 3.5 to version 4.0
I have created a class library in .NET Framework 3.5. 我已经在.NET Framework 3.5中创建了一个类库。 Now I want to change the .NET Framework Version to 4.0.
现在,我想将.NET Framework版本更改为4.0。
How can I do this? 我怎样才能做到这一点?
In Visual Studio: 在Visual Studio中:
If you are not seeing .NET Framework 4 as an option there, ensure you have it installed. 如果没有在其中看到.NET Framework 4 ,请确保已安装。
EDIT 编辑
I don't think this is what you're asking, but for completeness, one can also point an existing DLL to a later version of the .NET Framework without recompiling using Binding Redirects . 我认为这不是您要的,但是为了完整起见,也可以将现有DLL指向.NET Framework的更高版本,而无需使用Binding Redirects重新编译。
Right click on the project in the solution explorer and select Properties . 在解决方案资源管理器中的项目上单击鼠标右键,然后选择“ 属性” 。
Make sure that the Application tab is selected. 确保已选择“ 应用程序”选项卡。
In the Target framework dropdown select the desired framework, eg .NET Framework 4 . 在“ 目标框架”下拉列表中,选择所需的框架,例如.NET Framework 4 。
Unfortunately this cannot be done once dll
has been created. 不幸的是,一旦创建了
dll
就无法完成此操作。 For this you need to have source of your class library. 为此,您需要具有类库的源代码。
Select Properties from Right clicking on the project in the solution explorer. 从解决方案资源管理器中的项目上单击鼠标右键,选择“ 属性 ”。
In Application Tab change Target Framework to Desired one . 在“ 应用程序”选项卡中,将“ 目标框架”更改为所需的 框架 。
FYI - there's a "Target Framework Migrator" extension tool for Visual Studio (2013, 2015) that will do all projects in your solution in one go. 仅供参考-Visual Studio有一个“ Target Framework Migrator”扩展工具(2013年,2015年),可以一次性完成解决方案中的所有项目。
I'm working on a solution at the moment with a 100+ projects in it and it's not practicable to do each project one at a time IMO. 我目前正在开发一个解决方案,其中包含100多个项目,而一次IMO进行每个项目都不可行。
In Visual Studio 2010 : 在Visual Studio 2010中 :
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.