【问题标题】:Setup project in Visual Studio 2017在 Visual Studio 2017 中设置项目
【发布时间】:2018-07-06 10:30:25
【问题描述】:

我已将使用 VS 2010 在 .Net 2.0 中开发的 Windows 服务迁移到 VS 2017 上的 .Net 4.7.2。有一个安装项目迁移失败,因为 VS 2017 不支持此项目类型。正如 Microsoft 建议的 here 我正在使用 wix 创建设置项目,并按此顺序下载并安装了 wix 工具集 3.11.1、Wix Extension for Visual Studio 2017 和 wix VS Designer,并按照教程创建设置项目。但我得到了错误 Could not load file or assembly 'wix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=c9acf360d0e036e3' or one of its dependencies.

wix目标文件代码如下:

<PropertyGroup>
    <WixTargetsImported>true</WixTargetsImported>

    <!-- MSBuild 4.0 -->
    <!-- MSBuild does not do short circuit evaluation of the AND operator, so we cannot have
         something like '$(MSBuildToolsVersion)' != '' AND '$(MSBuildToolsVersion)' &gt;= '4.0'
         instead set as default and override -->
    <WixVersionTargetsPath>wix2010.targets</WixVersionTargetsPath>
    <!-- MSBuild 2.0 - 3.5 -->
    <WixVersionTargetsPath Condition=" '$(MSBuildToolsVersion)' == '' OR '$(MSBuildToolsVersion)' &lt; '4.0' ">wix200x.targets</WixVersionTargetsPath>
  </PropertyGroup>

由于 MSBuildToolsVersion 为 15,它应该选择正确的目标文件,即 wix2010.targets。查看此文件,$(WixInstallPath) 从 $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Installer XML\3.11@InstallRoot) 读取其值。现在我没有这个路径(路径中没有 Windows Installer XML)。 我对 wix 工具集不太了解。在我看来,虽然我在安装过程中没有收到任何错误,但安装并没有正确完成。从那时起,我已经卸载并重新安装了 VS 2017 的 wix 工具集和扩展,但没有运气。有没有其他人完成迁移并在 VS 2017 中使用 wix 工具集创建安装项目并遇到此问题?

【问题讨论】:

    标签: wix setup-project wix-extension


    【解决方案1】:

    仅使用安装程序项目插件并迁移现有设置项目可能会更容易。它在市场上:

    https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects

    您发布的链接确实提到了这些,所以也许您还是决定使用 WiX。

    【讨论】:

    • 页面上的链接将我带到 Microsoft Visual Studio 2013 Installer Projects,这显然是不正确的,我也懒得单独搜索 Visual Studio Installer Projects 扩展。页面上的链接打开marketplace.visualstudio.com/…
    猜你喜欢
    • 1970-01-01
    • 2018-04-27
    • 1970-01-01
    • 2019-07-22
    • 2018-04-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-06-11
    相关资源
    最近更新 更多