【问题标题】:Error occurred while restoring NuGet packages: The MSBuildProjectExtensionsPath MSBuild property could not be found for project Setup.wixproj还原 NuGet 包时出错:找不到项目 Setup.wixproj 的 MSBuildProjectExtensionsPath MSBuild 属性
【发布时间】:2019-10-25 20:40:11
【问题描述】:

我们有旧版的 Visual Studio 和 Wix 创建的旧版应用程序。使用的最后一个版本是 Visual Studio 2015。 使用 VS2019 后,我们开始在恢复包时遇到问题: 还原 NuGet 包时出错:找不到项目 Setup.wixproj 的 MSBuildProjectExtensionsPath MSBuild 属性

WiX 3.11.4516.0 版本 Visual Studio 版本:Visual Studio 2019 (16.3.6) WiX 工具集 Visual Studio 扩展 1.0.0.4 这些项目使用 .NET 框架 4.5.2

当我创建一个新的 wixsetup 项目时,我注意到布局不同。 我试图一一更改属性以找出问题所在,但我从未设法摆脱错误

这是我的wixproj

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">x64</Platform>
    <ProductVersion>3.0</ProductVersion>
    <ProjectGuid>{99f1ae14-c5d9-4153-b9be-d4e5d6da2a2c}</ProjectGuid>
    <SchemaVersion>2.0</SchemaVersion>
    <OutputName>Setup</OutputName>
    <OutputType>Package</OutputType>
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
    <WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
    <SccProjectName>SAK</SccProjectName>
    <SccProvider>SAK</SccProvider>
    <SccAuxPath>SAK</SccAuxPath>
    <SccLocalPath>SAK</SccLocalPath>
    <RunWixToolsOutOfProc>True</RunWixToolsOutOfProc>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
    <DefineConstants>Debug</DefineConstants>
    <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
    <OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
    <IntermediateOutputPath>obj\$(Platform)\$(Configuration)\</IntermediateOutputPath>
    <SuppressAllWarnings>False</SuppressAllWarnings>
    <Pedantic>True</Pedantic>
  </PropertyGroup>
  <ItemGroup>
    <Compile Include="UI_InstallDir.wxs" />
    <Compile Include="Product.wxs" />
  </ItemGroup>
  <ItemGroup>
    <ProjectReference Include="..\WindowsService1\WindowsService1.csproj">
      <Name>WindowsService1</Name>
      <Project>{720823ef-c775-4112-a906-b079ea977513}</Project>
      <Private>True</Private>
    </ProjectReference>
  </ItemGroup>
  <ItemGroup>
    <WixExtension Include="WixNetFxExtension">
      <HintPath>$(WixExtDir)\WixNetFxExtension.dll</HintPath>
      <Name>WixNetFxExtension</Name>
    </WixExtension>
    <WixExtension Include="WixUtilExtension">
      <HintPath>$(WixExtDir)\WixUtilExtension.dll</HintPath>
      <Name>WixUtilExtension</Name>
    </WixExtension>
    <WixExtension Include="WixUIExtension">
      <HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
      <Name>WixUIExtension</Name>
    </WixExtension>
  </ItemGroup>
  <ItemGroup>
    <Folder Include="Images\" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Images\Banner.bmp" />
    <Content Include="Images\Dialog.bmp" />
    <Content Include="project.json" />
  </ItemGroup>
  <Import Project="$(WixTargetsPath)" />

</Project>

【问题讨论】:

  • 您在新的 wix 项目中是否遇到同样的错误?您是比较所有差异,还是只比较属性?

标签: msbuild wix nuget


【解决方案1】:

我将通过发布我所做的来回答,尽管我不确定背后的机制: 自 MSBuild 15 (visual studio 2017) 以来发生了一些重大变化,Wix 团队似乎更新了他们的 Wixproj 模板格式以支持它:https://github.com/wixtoolset/issues/issues/5525 我只需要从新模板创建一个新项目(将我的项目移动到项目中)并构建。它似乎可以解决问题。

【讨论】:

    猜你喜欢
    • 2020-04-10
    • 1970-01-01
    • 2018-07-31
    • 2017-04-16
    • 1970-01-01
    • 1970-01-01
    • 2014-04-13
    • 2013-06-13
    • 2015-07-06
    相关资源
    最近更新 更多