首页 > 解决方案 > Azure Builds 正在添加一个额外的文件夹 (win-x64) 导致构建中断

问题描述

给定:
Visual Studio 2019 Web API .Net Core 3.1
Wix Toolset 3.1.1(最新)
Wix Toolset Extension for Visual Studio 2019
Windows 2016 Azure DevOps 2019

我要做的就是使用 Wix 工具集为一个非常简单的 WebAPI 项目创建一个 .msi 文件。

该构建当然可以在本地完美运行,但是当它在 Azure Builds 中运行时,我收到以下错误,因为添加了一个额外的文件夹(win-x64)

这是 Azure Pipelines 中的构建脚本片段:

- task: VSBuild@1
  inputs:
    solution: '$(solution)'
    msbuildArgs: '/p:DeployOnBuild=true /p:PublishProfile=FolderProfile'
    configuration: '$(buildConfiguration)'

ication1\bin\Release\netcoreapp3.1\win-x64\publish\WebApplication1.exe'

Link:
  C:\Program Files (x86)\WiX Toolset v3.11\bin\Light.exe -out C:\agent2\_work\4\s\SetupProject1\bin\Release\SetupProject1.msi -pdbout C:\agent2\_work\4\s\SetupProject1\bin\Release\SetupProject1.wixpdb -cultures:null -contentsfile obj\Release\SetupProject1.wixproj.BindContentsFileListnull.txt -outputsfile obj\Release\SetupProject1.wixproj.BindOutputsFileListnull.txt -builtoutputsfile obj\Release\SetupProject1.wixproj.BindBuiltOutputsFileListnull.txt -wixprojectfile C:\agent2\_work\4\s\SetupProject1\SetupProject1.wixproj obj\Release\Product.wixobj
  Windows Installer XML Toolset Linker version 3.11.2.4516
  Copyright (c) .NET Foundation and contributors. All rights reserved.

C:\agent2\_work\4\s\SetupProject1\Product.wxs(28): error LGHT0103: The system cannot find the file 'C:\agent2\_work\4\s\WebApplication1\bin\Release\netcoreapp3.1\win-x64\publish\WebApplication1.exe'. [C:\agent2\_work\4\s\SetupProject1\SetupProject1.wixproj]
##[error]SetupProject1\Product.wxs(28,0): Error LGHT0103: The system cannot find the file 'C:\agent2\_work\4\s\WebApplication1\bin\Release\netcoreapp3.1\win-x64\publish\WebApplication1.exe'.
C:\agent2\_work\4\s\SetupProject1\Product.wxs(31): error LGHT0103: The system cannot find the file 'C:\agent2\_work\4\s\WebApplication1\bin\Release\netcoreapp3.1\win-x64\publish\appsettings.json'. [C:\agent2\_work\4\s\SetupProject1\SetupProject1.wixproj]
##[error]SetupProject1\Product.wxs(31,0): Error LGHT0103: The system cannot find the file 'C:\agent2\_work\4\s\WebApplication1\bin\Release\netcoreapp3.1\win-x64\publish\appsettings.json'.
Done Building Project "C:\agent2\_work\4\s\SetupProject1\SetupProject1.wixproj" (default targets) -- FAILED.
Done Building Project "C:\agent2\_work\4\s\Solution1.sln" (default targets) -- FAILED.

Build FAILED.

标签: azureazure-devopswix

解决方案


推荐阅读