locked
Error Deploying ASP.NET Core Web Application + ReactJS to Azure. RRS feed

  • Question

  • Hi all

    Traying to deploy an ASP.NET Core Web Application  + ReactJS to Azure and the Publish step in my pipeline always ends in error – “Error: The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1”

    My pipeline is composed of:

    • Prepare job
    • Initialize job
    • Checkout
    • Restore
    • npm install (step added by me after some errors)
    • npm audit fix (step added by me after some errors)
    • npm run build (step added by me after some errors)
    • Build
    • Test
    • Publish <- Error!
    • Publish Artifact
    • Post-job: Checkout
    • Finalize Job

    The error I get in the Pusblish step is:

    ===
    Webpack compilation mode: production ===‌

     (…)
          Hash: c2e1b3f9437a24e5157e
          Time: 108142ms
          Built at: 05/09/2019 1:13:13 PM
                   Asset      Size 
    Chunks             Chunk Names

          main-server.js  3.58 MiB      
    0  [emitted]  main-server
          Entrypoint main-server = main-server.js
    C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5):
    error MSB3030: Could not copy the file
    "D:\a\1\s\wwwroot\dist\main-client.js.map" because it was not found.
    [D:\a\1\s\nextvision.csproj]

    C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5):
    error MSB3030: Could not copy the file
    "D:\a\1\s\wwwroot\dist\vendor.css.map" because it was not found.
    [D:\a\1\s\nextvision.csproj]

    C:\Program Files\dotnet\sdk\2.2.105\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(141,5):
    error MSB3030: Could not copy the file
    "D:\a\1\s\wwwroot\dist\vendor.js.map" because it was not found.
    [D:\a\1\s\nextvision.csproj]

    ##[error]Error:
    The process 'C:\Program Files\dotnet\dotnet.exe' failed with exit code 1

    ##[error]Dotnet
    command failed with non-zero exit code on the following projects :
    D:\a\1\s\nextvision.csproj

    ##[section]Finishing:
    Publish


    Using “npm run build:prod” I thought the *.map files were not even necessary, but that is the only error I see on the Publish step.

    Any help would be appreciated.

    Thanks,

    Pedro Cabral



    • Edited by Pcabralc Thursday, May 9, 2019 2:20 PM
    Thursday, May 9, 2019 2:18 PM

All replies

  • Pcabralc,

    I used `dotnet new react` to create a new react project and configured a CI pipeline using Azure DevOps. The agent pool I'm using is Hosted VS2017. I did come across similar errors which prompted me to add npm install and npm custom (run build). I did not not however need to to add npm audit fix. I did have to un-check 'Publish web projects' since I didn't have a web.config or wwwroot folder. Since you do have a wwwroot, did you add any gulp or grunt tasks to copy the output files to wwwroot?

    My dotnet core version 2.2.300-preview-010067 while you're using 2.2.105. There could be an issue in your csproj. It could also be a dependency issue. Since I have barebones react project, share any dependencies you may have. Having setup a simple project, I'm inclined to agree that you don't necessarily the *.map files.

    Feel free to share repo steps, such as how you created the project, any dependencies and/or configurations you added.


    Thanks in advance, Ryan

    Monday, May 13, 2019 9:51 PM