Can't seem to build v4.20 on Azure Pipelines

1 year ago
Hey everyone,

I'm having trouble getting a (brand new) instance of v4.20 to run on my Azure Build pipeline. I'm seeing an error when each plugin project is built when ClearPluginAssemblies is run. Strangely, this is only happening when I try to build against Microsoft Azure's build agents (Hosted VS2017). When I build the solution in my local environment it succeeds every time. Here's a sample of the logs when I try to build using an Azure agent:


C:\hostedtoolcache\windows\dncs\2.2.301\x64\sdk\2.2.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(153,5): warning NETSDK1071: A PackageReference to 'Microsoft.AspNetCore.App' specified a Version of `2.2.5`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs [d:\a\3280\s\Libraries\Nop.Core\Nop.Core.csproj]
  Nop.Core -> d:\a\3280\s\Libraries\Nop.Core\bin\debug\netcoreapp2.2\Nop.Core.dll
  Nop.Data -> d:\a\3280\s\Libraries\Nop.Data\bin\debug\netcoreapp2.2\Nop.Data.dll
  Nop.Services -> d:\a\3280\s\Libraries\Nop.Services\bin\debug\netcoreapp2.2\Nop.Services.dll
  Nop.Web.Framework -> d:\a\3280\s\Presentation\Nop.Web.Framework\bin\debug\netcoreapp2.2\Nop.Web.Framework.dll
  Nop.Plugin.DiscountRules.CustomerRoles -> d:\a\3280\s\Presentation\Nop.Web\Plugins\DiscountRules.CustomerRoles\Nop.Plugin.DiscountRules.CustomerRoles.dll
  No executable found matching command "dotnet-d:\a\3280\s\Build\ClearPluginAssemblies.dll"
d:\a\3280\s\Build\ClearPluginAssemblies.proj(21,5): error MSB3073: The command "dotnet "d:\a\3280\s\Build\ClearPluginAssemblies.dll" "OutputPath=d:\a\3280\s\Build\..\Presentation\Nop.Web\bin\debug\netcoreapp2.2\|PluginPath=d:\a\3280\s\Plugins\Nop.Plugin.DiscountRules.CustomerRoles\..\..\Presentation\Nop.Web\Plugins\DiscountRules.CustomerRoles\|SaveLocalesFolders="" exited with code 1.

Build FAILED.

C:\hostedtoolcache\windows\dncs\2.2.301\x64\sdk\2.2.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.targets(153,5): warning NETSDK1071: A PackageReference to 'Microsoft.AspNetCore.App' specified a Version of `2.2.5`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs [d:\a\3280\s\Libraries\Nop.Core\Nop.Core.csproj]
d:\a\3280\s\Build\ClearPluginAssemblies.proj(21,5): error MSB3073: The command "dotnet "d:\a\3280\s\Build\ClearPluginAssemblies.dll" "OutputPath=d:\a\3280\s\Build\..\Presentation\Nop.Web\bin\debug\netcoreapp2.2\|PluginPath=d:\a\3280\s\Plugins\Nop.Plugin.DiscountRules.CustomerRoles\..\..\Presentation\Nop.Web\Plugins\DiscountRules.CustomerRoles\|SaveLocalesFolders="" exited with code 1.
    1 Warning(s)
    1 Error(s)

Thanks in advance for your help!
1 year ago
Anyone?
1 year ago
Hey everyone, I figured out what the issue was. Just in case anyone has the same problem, here's what I found.

When nopCommerce v4.2 is shipped, the ClearPluginAssemblies solution is included as already built and packaged into ClearPluginAssemblies.dll. However, when I checked in the source code into our version control (TFVC in my case), DLL files are excluded by default. Once I manually checked in this DLL file, the solution built with no problem.
1 year ago
Thanks for sharing. :)
10 months ago
Did you solve the problem? If yes, can you share the complete YAML file?

Thanks a lot.
10 months ago
@havana7 The YAML file for my Azure Pipelines Build? Sure, but I don't know if it will be helpful to you. In my build pipeline I'm building a docker image from my nopCommerce 4.2 solution and storing in AWS ECR. Let me know if posting this would be helpful.

If you want to know how to do a normal build (not for Docker), use the Azure Pipelines template for ASP.NET Core. Use the .NET Core action in the Visual Assistant to create build, test, and publish actions. Then create a Release Pipeline to push that compiled solution to a web environment. Hope this helps!