【问题标题】:CI CD pipeline Azure DevopsCI CD 管道 Azure Devops
【发布时间】:2019-03-22 06:16:14
【问题描述】:

我正在尝试为我们的项目构建 CI CD 管道。 当我的应用程序开始构建时。 我们遇到了问题。

[错误]C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5):错误 MSB3030:无法复制文件 "D:\a\1\s\src\VTTDemo.Web.Host\wwwroot\dist\101.7d2715da89efeae8b0da.js" 因为找不到。

C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5):错误 MSB3030:无法复制文件“D :\a\1\s\src\VTTDemo.Web.Host\wwwroot\dist\101.7d2715da89efeae8b0da.js" 因为找不到。 [D:\a\1\s\src\VTTDemo.Web.Host\VTTDemo.Web.Host.csproj]

步骤已跟随。 1. 从解决方案资源管理器配置 Cd 2.进入App,Azure登录 3.选择项目和管道 4.编辑管道 5. 保存并排队Pipeline

【问题讨论】:

    标签: azure-devops continuous-integration asp.net-core-2.0 asp.net-core-webapi azure-pipelines


    【解决方案1】:

    GitHub 上的解决方案问题 - https://github.com/aspnet/websdk/issues/162

    解决方案代码

    需要在csproj文件中添加如下代码:

      <ItemGroup>
        <Compile Remove="node_modules\**\*;Client\**\*" />
        <Content Remove="wwwroot\dist\**\*" />
      </ItemGroup>
    
      <Target Name="RunWebpack" BeforeTargets="BeforePublish">
        <Exec Command="npm run clean:dist" />
        <Exec Command="npm run build:prod" />
        <ItemGroup>
          <DistFiles Include="wwwroot\dist\**\*" />
          <Content Include="@(DistFiles)" CopytoPublishDirectory="Always" />
          <ContentWithTargetPath Include="@(DistFiles)" TargetPath="%(Identity)" CopyToPublishDirectory="Always" />
        </ItemGroup>
      </Target>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-20
      • 2020-10-13
      • 2020-04-07
      • 2022-07-04
      • 2020-09-01
      • 2021-09-14
      • 1970-01-01
      • 2021-02-02
      相关资源
      最近更新 更多