如何在VS 2017中配置Windows Installer应安装的.NET版本 [英] How can I configure what .NET version should be installed by windows installer in VS 2017

查看:418
本文介绍了如何在VS 2017中配置Windows Installer应安装的.NET版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在开发一个需要.NET 4.0才能正常工作的项目,但是当我配置Windows Installer并尝试安装它时,它正在尝试安装最新版本的.NET。因此,如何配置Windows安装程序以安装在其上创建项目的.NET版本。我也想知道如何在安装程序中包括Visual C ++ Redistributable。

Currently I am working on a project that needs .NET 4.0 to work properly but when I configure the windows installer and try to install it is trying to install the latest version of .NET. So how can I configure the windows installer to install the .NET version on which the project was created. Also I would like to know how to include the Visual C++ Redistributable in my installer.

推荐答案

创建安装项目并将项目的主要输出添加到安装项目时,安装项目会自动检测依赖项,包括 Microsoft .Net Framework 。要查看检测到的依赖项是否正确,您可以看到以下位置:

When you create a setup project and add primary output of a project to the setup project, the setup project automatically detect dependencies including Microsoft .Net Framework. To see if the detected dependency is correctly what you need, you cam see the following locations:


  1. 首先,右键单击 Dependencies ,然后单击 Refresh Dependencies

检查项目的先决条件:


  • 右键单击安装项目,然后选择 Properties

  • 在属性对话框中,从配置组合框选择配置,然后对 Debug Release 重复以下步骤。

  • 单击先决条件... 按钮以打开先决条件

  • 先决条件对话框中,选中所需的.Net Framework版本。

  • 按确定,并确保对 Debug Release 重复上述步骤。
  • >
  • Right click on setup project and choose Properties.
  • In Properties dialog, from the Configurations combo box choose the configuration, and repeat the following steps for both Debug and Release.
  • Click on Prerequisites... button to open Prerequisites.
  • In the Prerequisites dialog, check the desired .Net Framework version.
  • Press OK and Make sure you repeat above steps for both Debug and Release.

为安装项目检查启动条件


  • 右键单击安装项目,然后来回m 查看选择启动条件

  • 然后在启动条件节点下,选择 .Net框架节点,右键单击并选择属性窗口

  • 属性窗口中检查版本 .Net Framework 启动条件的em>属性。

  • Right click on setup project and from View select Launch Conditions:
  • Then under Launch COnditions node, select .Net Framework node and right click and select Properties Window.
  • In Properties Window check the Version property for .Net Framework launch condition.

这篇关于如何在VS 2017中配置Windows Installer应安装的.NET版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆