简体   繁体   中英

Setup project in Visual Studio 2017

I have migrated a windows service developed in .Net 2.0 using VS 2010 to .Net 4.7.2 on VS 2017. There is a setup project which failed migration because VS 2017 does not support this project type. As Microsoft suggests here I am creating setup project using wix and have downloaded and installed wix toolset 3.11.1, Wix Extension for Visual Studio 2017 and wix VS Designer in this order and followed the tutorials to create the set up project. But I am getting the error Could not load file or assembly 'wix, Version=4.0.0.0, Culture=neutral, PublicKeyToken=c9acf360d0e036e3' or one of its dependencies.

The wix target file has the following code:

<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>

Since MSBuildToolsVersion is 15 it should pick up the right target file which is wix2010.targets. Looking into this file, the $(WixInstallPath) reads its value from $(Registry:HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Installer XML\\3.11@InstallRoot). Now I do not have this path (no Windows Installer XML in the path). I do not know much about wix toolset. It appears to me that the installation has not gone through correctly though I did not receive any errors during installation. Since then I have uninstalled and reinstalled wix toolset and extension for VS 2017 but have had no luck. Has anyone else done the migration and used wix toolset in VS 2017 to create setup project and faced this issue?

It may be easier for you to just use the installer project add-on and migrate your existing setup project. It's at the marketplace:

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

The link you posted does refer to these, so perhaps you've decided to go with WiX anyway.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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