I noted a couple of issues and workarounds, which I'd like to share to community and nopCommerce team.
My pipeline YAML is:
# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/dotnet-core
trigger:
- master
pool:
vmImage: 'ubuntu-latest'
variables:
buildConfiguration: 'Release'
steps:
- task: NuGetCommand@2
inputs:
command: 'restore'
restoreSolution: '**/*.sln'
feedsToUse: 'select'
vstsFeed: '51754111-95b4-4136-bd32-52f73b12788e'
- script: dotnet build --configuration $(buildConfiguration)
displayName: 'dotnet build $(buildConfiguration)'
- task: DotNetCoreCLI@2
displayName: "Publish"
inputs:
command: 'publish'
publishWebProjects: true
arguments: '-r linux-x64 --configuration $(BuildConfiguration) --output $(Build.ArtifactStagingDirectory)'
zipAfterPublish: true
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
1) Azure DevOps build Task fails on Nop.Plugin.Tax.Avalara plugin
The build agent behind the scenes is a Linux VM. Not sure it this makes a difference. The source code compiles fine on my local windows box.
Build FAILED.
Controllers/TaxTransactionLogController.cs(6,37): error CS0234: The type or namespace name 'Log' does not exist in the namespace 'Nop.Plugin.Tax.Avalara.Models' (are you missing an assembly reference?) [/home/vsts/work/1/s/Plugins/Nop.Plugin.Tax.Avalara/Nop.Plugin.Tax.Avalara.csproj]
Models/Configuration/ConfigurationModel.cs(4,37): error CS0234: The type or namespace name 'Log' does not exist in the namespace 'Nop.Plugin.Tax.Avalara.Models' (are you missing an assembly reference?) [/home/vsts/work/1/s/Plugins/Nop.Plugin.Tax.Avalara/Nop.Plugin.Tax.Avalara.csproj]
Models/Configuration/ConfigurationModel.cs(63,16): error CS0246: The type or namespace name 'TaxTransactionLogSearchModel' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/Plugins/Nop.Plugin.Tax.Avalara/Nop.Plugin.Tax.Avalara.csproj]
Controllers/TaxTransactionLogController.cs(53,46): error CS0246: The type or namespace name 'TaxTransactionLogSearchModel' could not be found (are you missing a using directive or an assembly reference?) [/home/vsts/work/1/s/Plugins/Nop.Plugin.Tax.Avalara/Nop.Plugin.Tax.Avalara.csproj]
0 Warning(s)
4 Error(s)
Time Elapsed 00:01:38.08
##[error]Bash exited with code '1'.
Finishing: dotnet build Release
Workaround: REMOVE Avalara plugin from solution, and rebuild.
2) Azure DevOps PUBLISH Task fails with 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
full error:
2020-05-20T15:59:18.8557611Z ##[section]Starting: Publish
2020-05-20T15:59:18.8571440Z ==============================================================================
2020-05-20T15:59:18.8571757Z Task : .NET Core
2020-05-20T15:59:18.8572086Z Description : Build, test, package, or publish a dotnet application, or run a custom dotnet command
2020-05-20T15:59:18.8572413Z Version : 2.169.1
2020-05-20T15:59:18.8572753Z Author : Microsoft Corporation
2020-05-20T15:59:18.8573078Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/build/dotnet-core-cli
2020-05-20T15:59:18.8573576Z ==============================================================================
2020-05-20T15:59:21.4234620Z [command]/usr/bin/dotnet publish /home/vsts/work/1/s/Presentation/Nop.Web/Nop.Web.csproj -r linux-x64 --configuration Release --output /home/vsts/work/1/a/Nop.Web
2020-05-20T15:59:21.5132079Z Microsoft (R) Build Engine version 16.5.0+d4cbfca49 for .NET Core
2020-05-20T15:59:21.5132818Z Copyright (C) Microsoft Corporation. All rights reserved.
2020-05-20T15:59:21.5133340Z
2020-05-20T15:59:27.2562525Z Restore completed in 2.38 sec for /home/vsts/work/1/s/Libraries/Nop.Services/Nop.Services.csproj.
2020-05-20T15:59:27.2563858Z Restore completed in 2.38 sec for /home/vsts/work/1/s/Presentation/Nop.Web.Framework/Nop.Web.Framework.csproj.
2020-05-20T15:59:27.7178404Z /home/vsts/work/1/s/Libraries/Nop.Data/Nop.Data.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/Presentation/Nop.Web/Nop.Web.csproj]
2020-05-20T15:59:27.7185033Z /home/vsts/work/1/s/Libraries/Nop.Data/Nop.Data.csproj : error NU1605: Nop.Data -> MySql.Data 8.0.20 -> 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/Presentation/Nop.Web/Nop.Web.csproj]
2020-05-20T15:59:27.7188792Z /home/vsts/work/1/s/Libraries/Nop.Data/Nop.Data.csproj : error NU1605: Nop.Data -> MySql.Data 8.0.20 -> SSH.NET 2016.1.0 -> System.Net.NameResolution (>= 4.0.0) [/home/vsts/work/1/s/Presentation/Nop.Web/Nop.Web.csproj]
2020-05-20T15:59:27.7699775Z Restore failed in 486.77 ms for /home/vsts/work/1/s/Libraries/Nop.Data/Nop.Data.csproj.
2020-05-20T15:59:28.2342983Z Restore completed in 362.09 ms for /home/vsts/work/1/s/Libraries/Nop.Core/Nop.Core.csproj.
2020-05-20T15:59:30.4544524Z Restore completed in 3.17 sec for /home/vsts/work/1/s/Presentation/Nop.Web/Nop.Web.csproj.
2020-05-20T15:59:30.5086088Z ##[error]Error: The process '/usr/bin/dotnet' failed with exit code 1
2020-05-20T15:59:30.5101205Z ##[warning]Info: Azure Pipelines hosted agents have been updated to contain .Net Core 3.x (3.0 and 3.1) SDK/Runtime along with 2.1. Unless you have locked down a SDK version for your project(s), 3.x SDK might be picked up which might have breaking behavior as compared to previous versions.
Some commonly encountered changes are:
If you're using `Publish` command with -o or --Output argument, you will see that the output folder is now being created at root directory rather than Project File's directory. 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
2020-05-20T15:59:30.5104706Z ##[error]Dotnet command failed with non-zero exit code on the following projects : /home/vsts/work/1/s/Presentation/Nop.Web/Nop.Web.csproj
2020-05-20T15:59:30.5132518Z ##[section]Finishing: Publish
WORKAROUND: In Nop.Data project, Update System.Net.Sockets and System.Net.NameResolution to 4.3.0 and rebuild
With these two workarounds, I now have a working end-to-end pipelines for Build, and Release to my deployment group of Linux web servers.
Jon