【问题标题】:dotnet publish in Execute Shell failsExecute Shell 中的 dotnet publish 失败
【发布时间】:2022-12-03 07:50:30
【问题描述】:

我正在尝试执行 dotnet publish 命令以从托管在 docker 中的 Jenkins 部署 Web 应用程序(图片:jenkins/jenkins:lts)。我给出的命令如下所示:

dotnet publish DevOpsSE/Assignments/3/DemoProject/DemoProject/DemoProject.csproj /p:PublishProfile="atudevopsselab3 - Web Deploy" /p:Configuration=Release

但我收到错误:

/usr/share/dotnet/sdk/7.0.100/Sdks/Microsoft.NET.Sdk.Publish/targets/PublishTargets/Microsoft.NET.Sdk.Publish.MSDeploy.targets(171,5): error MSB6004: The specified task executable location "IIS/Microsoft Web Deploy V3/msdeploy.exe" is invalid. [/var/jenkins_home/workspace/Build DemoProject/DevOpsSE/Assignments/3/DemoProject/DemoProject/DemoProject.csproj]

我的发布配置文件:

<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121. 
-->
<Project>
  <PropertyGroup>
    <WebPublishMethod>MSDeploy</WebPublishMethod>
    <PublishProvider>AzureWebSite</PublishProvider>
    <LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
    <LastUsedPlatform>Any CPU</LastUsedPlatform>
    <SiteUrlToLaunchAfterPublish>https://atudevopselab31.azurewebsites.net</SiteUrlToLaunchAfterPublish>
    <LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
    <ExcludeApp_Data>false</ExcludeApp_Data>
    <ProjectGuid>7f51460b-b916-4d7f-8a35-2b9dba663b81</ProjectGuid>
    <MSDeployServiceURL>atudevopselab31.scm.azurewebsites.net:443</MSDeployServiceURL>
    <DeployIisAppPath>atudevopselab31</DeployIisAppPath>
    <RemoteSitePhysicalPath />
    <SkipExtraFilesOnServer>true</SkipExtraFilesOnServer>
    <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
    <EnableMSDeployBackup>true</EnableMSDeployBackup>
    <EnableMsDeployAppOffline>true</EnableMsDeployAppOffline>
    <UserName>$atudevopselab31</UserName>
    <_SavePWD>true</_SavePWD>
    <_DestinationType>AzureWebSite</_DestinationType>
  </PropertyGroup>
</Project>

构建进展顺利;不是 dotnet 发布命令

【问题讨论】:

    标签: .net jenkins azure-web-app-service


    【解决方案1】:

    Jenkins 映像上似乎未安装 msdeploy.exe 工具。您可以尝试安装 msdeploy.exe 工具,或者您可以使用 dotnet publish --no-build 命令来跳过构建过程,只发布应用程序。

    【讨论】:

      猜你喜欢
      • 2019-03-10
      • 1970-01-01
      • 1970-01-01
      • 2015-09-12
      • 2018-02-27
      • 2018-10-13
      • 2014-05-13
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多