Base solution for your next web application
Open Closed

Azure Pipeline error after updating to latest version #10925


User avatar
0
ryan.mennell created
  • What is your product version? aspnetzero v11 jQuery
  • What is your product type (Angular or MVC)? MVC
  • What is product framework type (.net framework or .net core)? .net core
  • What is ABP Framework version? ABP framework v7.0.1

We've had a azure pipeline that has been working and after upgrading to the latest version of ABP, it is currently failing on the publish command. dotnet restore and build work fine as they did previously. It is hosted on image: ubuntu-20.04

Error if I specifically target the project in the build task:

MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1
/opt/hostedtoolcache/dotnet/dotnet publish /home/vsts/work/1/s/src/MBT.Web.Mvc/MBT.Web.Mvc.csproj --configuration Release --output /home/vsts/work/1/a/MBT.Web.Mvc
Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored /home/vsts/work/1/s/src/MBT.GraphQL/MBT.GraphQL.csproj (in 3.36 sec).
  Restored /home/vsts/work/1/s/src/MBT.Web.Core/MBT.Web.Core.csproj (in 3.4 sec).
  Restored /home/vsts/work/1/s/src/MBT.EntityFrameworkCore/MBT.EntityFrameworkCore.csproj (in 575 ms).
  Restored /home/vsts/work/1/s/src/MBT.Core/MBT.Core.csproj (in 490 ms).
  Restored /home/vsts/work/1/s/src/MBT.Core.Shared/MBT.Core.Shared.csproj (in 188 ms).
  Restored /home/vsts/work/1/s/src/MBT.Application/MBT.Application.csproj (in 596 ms).
  Restored /home/vsts/work/1/s/src/MBT.Application.Shared/MBT.Application.Shared.csproj (in 130 ms).
/home/vsts/work/1/s/src/MBT.Web.Mvc/MBT.Web.Mvc.csproj : error NU1605: Detected package downgrade: System.Net.NameResolution from 4.3.0 to 4.0.0. Reference the package directly from the project to select a different version. 
/home/vsts/work/1/s/src/MBT.Web.Mvc/MBT.Web.Mvc.csproj : error NU1605:  MBT.Web.Mvc -> MBT.Web.Core -> MBT.Application -> SSH.NET 2016.1.0 -> System.Net.Sockets 4.1.0 -> runtime.unix.System.Net.Sockets 4.3.0 -> System.Net.NameResolution (>= 4.3.0) 
/home/vsts/work/1/s/src/MBT.Web.Mvc/MBT.Web.Mvc.csproj : error NU1605:  MBT.Web.Mvc -> MBT.Web.Core -> MBT.Application -> SSH.NET 2016.1.0 -> System.Net.NameResolution (>= 4.0.0)
  Failed to restore /home/vsts/work/1/s/src/MBT.Web.Mvc/MBT.Web.Mvc.csproj (in 4 sec).
##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1
##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Dotnet command failed with non-zero exit code on the following projects : /home/vsts/work/1/s/**/MBT.Web.Mvc.csproj,/home/vsts/work/1/s/src/MBT.Web.Mvc/MBT.Web.Mvc.csproj
Finishing: Publish

Error if I use previous config:

  MBT.Web.Mvc -> /home/vsts/work/1/a/MBT.Web.Mvc/
##[warning].NET 5 has some compatibility issues with older Nuget versions(<=5.7), so if you are using an older Nuget version(and not dotnet cli) to restore, then the dotnet cli commands (e.g. dotnet build) which rely on such restored packages might fail. To mitigate such error, you can either: (1) - Use dotnet cli to restore, (2) - Use Nuget version 5.8 to restore, (3) - Use global.json using an older sdk version(<=3) to build
Info: Azure Pipelines hosted agents have been updated and now contain .Net 5.x SDK/Runtime along with the older .Net Core version which are currently lts. Unless you have locked down a SDK version for your project(s), 5.x SDK might be picked up which might have breaking behavior as compared to previous versions. You can learn more about the breaking changes here: https://docs.microsoft.com/en-us/dotnet/core/tools/ and https://docs.microsoft.com/en-us/dotnet/core/compatibility/ . To learn about more such changes and troubleshoot, refer here: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/build/dotnet-core-cli?view=azure-devops#troubleshooting
##[error]Dotnet command failed with non-zero exit code on the following projects : /home/vsts/work/1/s/**/MBT.Web.Mvc.csproj
Finishing: Publish

Let me know if you have any questions


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    I think your app is now targeting .NET 6. If so, could you add a Use .NET Core task step and use .NET 6 ?

    It should be something like this;

  • User Avatar
    0
    ryan.mennell created

    Followed the original documentation, and then followed your advice above and still running in to the following error:

    Build, and restore tasks all run fine.

    MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file
    
    
    ##[debug]   /home/vsts/work/1/a/**
    /opt/hostedtoolcache/dotnet/dotnet publish /home/vsts/work/1/s/**/MBT.Web.Mvc.csproj --configuration Release --framework net6.0 --runtime linux-x64 --self-contained --output /home/vsts/work/1/a/**
    Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
    ##[debug]Exit code 1 received from tool '/opt/hostedtoolcache/dotnet/dotnet'
    ##[debug]STDIO streams have closed for tool '/opt/hostedtoolcache/dotnet/dotnet'
    ##[error]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1
    ##[debug]Processed: ##vso[task.issue type=error;]Error: The process '/opt/hostedtoolcache/dotnet/dotnet' failed with exit code 1
    ##[debug]which '/opt/hostedtoolcache/dotnet/dotnet'
    ##[debug]found: '/opt/hostedtoolcache/dotnet/dotnet'
    ##[debug]/opt/hostedtoolcache/dotnet/dotnet arg: publish
    ##[debug]/opt/hostedtoolcache/dotnet/dotnet arg: /home/vsts/work/1/s/src/MBT.Web.Mvc/MBT.Web.Mvc.csproj
    ##[debug]modifyOutputPath=true
    ##[debug]/opt/hostedtoolcache/dotnet/dotnet arg: --configuration Release --framework net6.0 --runtime linux-x64 --self-contained --output /home/vsts/work/1/a/MBT.Web.Mvc
    ##[debug]exec tool: /opt/hostedtoolcache/dotnet/dotnet
    ##[debug]arguments:
    ##[debug]   publish
    ##[debug]   /home/vsts/work/1/s/src/MBT.Web.Mvc/MBT.Web.Mvc.csproj
    ##[debug]   --configuration
    ##[debug]   Release
    ##[debug]   --framework
    ##[debug]   net6.0
    ##[debug]   --runtime
    ##[debug]   linux-x64
    ##[debug]   --self-contained
    ##[debug]   --output
    ##[debug]   /home/vsts/work/1/a/MBT.Web.Mvc
    /opt/hostedtoolcache/dotnet/dotnet publish /home/vsts/work/1/s/src/MBT.Web.Mvc/MBT.Web.Mvc.csproj --configuration Release --framework net6.0 --runtime linux-x64 --self-contained --output /home/vsts/work/1/a/MBT.Web.Mvc
    Microsoft (R) Build Engine version 17.1.0+ae57d105c for .NET
    Copyright (C) Microsoft Corporation. All rights reserved.
    
    

    dotnet --list-sdks returns:

    6.0.200 [/opt/hostedtoolcache/dotnet/sdk]
    
  • User Avatar
    0
    ryan.mennell created

    Any update?

  • User Avatar
    0
    ryan.mennell created

    I got it to work after adjusting the project path, hope it helps someone:

    steps:
    - task: DotNetCoreCLI@2
      displayName: Publish
      inputs:
        command: publish
        publishWebProjects: false
        projects: src/PROJECTNAME.Web.Mvc/PROJECTNAME.Web.Mvc.csproj
        arguments: ' --output $(Build.ArtifactStagingDirectory)'
        zipAfterPublish: True