1
votes

I am trying to build CI CD Pipeline For Our project. when my application start Building. we are getting issue.

error

[error]C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5): Error MSB3030: Could not copy the file "D:\a\1\s\src\VTTDemo.Web.Host\wwwroot\dist\101.7d2715da89efeae8b0da.js" because it was not found.

C:\Program Files\dotnet\sdk\2.2.104\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5): error MSB3030: Could not copy the file "D:\a\1\s\src\VTTDemo.Web.Host\wwwroot\dist\101.7d2715da89efeae8b0da.js" because it was not found. [D:\a\1\s\src\VTTDemo.Web.Host\VTTDemo.Web.Host.csproj]

step has follow. 1. Configure Cd From Solution explorer 2. Enter App, Azure Login 3. Select Project and Pipeline 4. Edit Pipeline 5. Save and queue Pipeline

1

1 Answers

0
votes

Issue with solution on GitHub - https://github.com/aspnet/websdk/issues/162

Solution code

Need to add the following code in csproj file:

  <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>