简体   繁体   English

如何更改.NET版本目标

[英]How to Change .NET Version Target

I am creating a service which was originally targeting .NET 4.5 . 我正在创建最初面向.NET 4.5

I changed this to .NET 3.5 in the Project Properties: 我在项目属性中将其更改为.NET 3.5

在此处输入图片说明

I also updated all of the .resx files to contain Version=2.0.0.0 instead of Version=4.0.0.0 (as the compiler was complaining about this), and I also removed .NET 4.5 from the list of prerequisites. 我还更新了所有.resx文件,使其包含Version=2.0.0.0而不是Version=4.0.0.0 (因为编译器对此有所抱怨),并且我还从必备组件列表中删除了.NET 4.5

However, when I generate a new MSI and try to run I am seeing this message: 但是,当我生成一个新的MSI并尝试运行时,我看到此消息:

This setup requires the .NET Framework version 4.5. 此设置需要.NET Framework 4.5版。 Please install the .NET Framework and run this setup again. 请安装.NET Framework,然后再次运行此安装程序。 The .NET Framework can be obtained from the web. 可以从Web获得.NET Framework。 Would you like to do this now? 您现在要这样做吗?

The machine I am trying to install this on has .NET 3.5 installed and so this should run without issue. 我尝试在其上安装此机器的计算机已安装.NET 3.5 ,因此它应该可以正常运行。

I am not sure what else to check in my project - does anyone have any ideas of what might be causing this? 我不确定我的项目中还要检查什么-有人对导致这种情况的原因有任何想法吗? Is there some way of "refreshing" the settings to ensure that the new framework is used by the installer? 是否有某种“刷新”设置以确保安装程序使用新框架的方法?

Change Target Framework in Project Properties and Recompile. 在项目属性中更改目标框架并重新编译。 That's all... 就这样...

I was able to resolve this by going into the Setup Project's Detected Dependancies : 我可以通过进入安装项目的Detected Dependancies来解决此问题:

在此处输入图片说明

For some reason this was set to .NET 4.5 . 由于某种原因,它被设置为.NET 4.5

Changing this to the required version fixed my problem. 将此更改为所需版本可以解决我的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何更改ASP 5项目的目标框架版本? - How to change the target framework version of asp 5 project? 如何更改sageframe的.net框架版本? - How to change .net framework version for sageframe? 无法在VS 2015 C ++项目中更改.NET Target Framework版本 - Can't change .NET Target Framework Version in VS 2015 C++ project VS 2010无法加载来自早期.NET版本的引用,也无法更改新项目的目标框架 - VS 2010 unable to load references from previous .NET version and unable to change target framework for new projects 如何将 Visual Studio 2019 中的 .NET 版本更改为 .NET Framework 4.7.2? - How to change .NET version in Visual Studio 2019 to .NET Framework 4.7.2? Target.NET 框架版本与安装的 .NET 框架版本 - Target.NET framework version vs .NET framework version installed 为什么具有相同目标框架版本的两个应用程序的.NET版本不同 - Why .NET version is different for two app with same target framework version 运行时使用的应用程序框架版本目标和Net Framework版本 - Application framework version target and Net Framework version used in runtime Visual Studio扩展项目:如何更改目标Visual Studio版本? - Visual Studio extension project: how to change target Visual Studio version(s)? 我更改了目标.net版本,它导致了许多数据集错误,我该如何解决? - I changed target .net version and it caused a bunch of data set errors how do i fix it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM