简体   繁体   English

Visual Studio目标框架不会更改为4.0

[英]Visual Studio target framework not changing to 4.0

I am writing a Windows Forms program which doesn't use any new tech from .net framework 4.5-4.7, but unfortunately I started the project with .net Framework set to 4.6.2. 我正在编写一个Windows Forms程序,该程序未使用.net Framework 4.5-4.7中的任何新技术,但不幸的是,我将.net Framework设置为4.6.2开始了该项目。 (Because in the beginning the company told me they only want to use it on win 7/8.1/10, later they changed their mind) I know Windows XP is obsolete, but I have to run this program on a XP machine as well. (因为公司一开始就告诉我他们只想在win 7 / 8.1 / 10上使用它,后来他们改变了主意)我知道Windows XP已过时,但是我也必须在XP机器上运行该程序。

I already tried to set the targeting framework to .NET 4.0, but when I try on the XP machine with a .msi installer, it throws an error, that I cannot run a .net 4.6.2 dependent program, even before it starts the install process. 我已经尝试将目标框架设置为.NET 4.0,但是当我尝试使用.msi安装程序在XP计算机上运行时,它会引发错误,即使在启动.net 4.6.2依赖程序之前,我也无法运行。安装过程。

Can I “convert” the whole project to .net 4.0, or I have to copy all buttons, textboxes, couple thousands lines of code, etc. to a new project which only uses .net 4.0? 我可以将整个项目“转换”为.net 4.0,还是必须将所有按钮,文本框,成千上万行代码等复制到仅使用.net 4.0的新项目中? I'm using Visual Studio 2017. 我正在使用Visual Studio 2017。

Looking at the log you shared I can see DIRCA_CheckFX so I'm guessing the setup project is a vdproj which has been deprecated in favour of a framework like WiX . 查看您共享的日志,我可以看到DIRCA_CheckFX,所以我猜安装项目是一个vdproj,由于支持WiX之类的框架而已被弃用。

The CheckFX step is a launch condition which you should be able to delete/manipulate, by opening the project and finding the launch conditions: CheckFX步骤是一个启动条件,您应该可以通过打开项目并找到启动条件来删除/操作:

View -> Editor -> Launch conditions 查看->编辑器->启动条件

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM