.net core 运行GitLab CI作业时,指定的任务可执行文件位置无效

.net core 运行GitLab CI作业时,指定的任务可执行文件位置无效,.net-core,continuous-integration,gitlab,gitlab-ci,continuous-delivery,.net Core,Continuous Integration,Gitlab,Gitlab Ci,Continuous Delivery,我正在尝试使用GitLab CI为我的.NET核心应用程序设置CICD 让我们从我的.gitlab ci.yml image : microsoft/dotnet:latest before_script: - 'cd Backend' - 'dotnet restore' build: stage: build script: - 'dotnet build -c Release /p:DeployOnBuild=true /p:PublishProfile=Propertie

我正在尝试使用GitLab CI为我的.NET核心应用程序设置CICD

让我们从我的
.gitlab ci.yml

image : microsoft/dotnet:latest
before_script:
  - 'cd Backend'
  - 'dotnet restore'
build:
 stage: build
 script:
  - 'dotnet build -c Release /p:DeployOnBuild=true /p:PublishProfile=Properties/PublishProfiles/WebioProfile.pubxml'
 only:
   - cicd_test
WebioProfile
我正在使用

<?xml version="1.0" encoding="utf-8"?>

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish>http://xxx.hostingasp.pl/</SiteUrlToLaunchAfterPublish>
    <ExcludeApp_Data>False</ExcludeApp_Data>
    <ProjectGuid>03120c29-ae98-4c30-9b8c-7ec70f6642fd</ProjectGuid>
    <MSDeployServiceURL>ssl3.xxxx.hostingasp.pl</MSDeployServiceURL>
    <DeployIisAppPath>xxxx.hostingasp.pl</DeployIisAppPath>
    <RemoteSitePhysicalPath />
    <SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
    <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
    <EnableMSDeployBackup>True</EnableMSDeployBackup>
    <UserName>user</UserName>
    <Password>password</Password>
  </PropertyGroup>
</Project>

MSDeploy
释放
任何CPU
http://xxx.hostingasp.pl/
假的
03120c29-ae98-4c30-9b8c-7ec70f6642fd
ssl3.xxxx.hostingasp.pl
xxxx.hostingasp.pl
真的
WMSVC
真的
用户
密码
git推送原点cicd\U测试后

我在GitLab作业控制台中遇到此错误

恢复在58.11毫秒内完成 /构建/username/project/Backend/Backend.csproj.
后端-> /构建/username/project/Backend/bin/Release/netcoreapp2.1/Backend.dll 后端-> /构建/username/project/Backend/obj/Release/netcoreapp2.1/PubTmp/Out/ /usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.sdk.Publish/build/netstandard1.0/PublishTargets/Microsoft.NET.sdk.Publish.MSDeploy.targets(171,5): 错误MSB6004:指定的任务可执行文件位置无效 “%ProgramW6432%/IIS/Microsoft Web Deploy V3/msdeploy.exe”无效。 [/builds/username/project/Backend/Backend.csproj]

生成失败

在我看来,
%ProgramW6432%
是一种未设置的变量?但是我在哪里可以改变它呢


值得注意的是,如果我从VS CLI本地运行它,使用与
.gitlab ci.yml
中相同的命令进行部署可以正常工作我在尝试从Mac发布到Azure应用程序服务时遇到了相同的错误

这个问题帮助我解决了这个问题:

可以使用msbuild执行此操作,而不是使用“dotnet publish”命令:


msbuild project-name.csproj-c Release/p:DeployOnBuild=true/p:PublishProfile=PublishProfile.publishxml

您解决了这个问题吗?这个问题解决了吗?