aws-toolkit-azure-devops icon indicating copy to clipboard operation
aws-toolkit-azure-devops copied to clipboard

LambdaNETCoreDeploy task attempts to build for .NET core 1.0.0 instead of 3.1 when using custom feeds

Open domenicgilardoni opened this issue 5 years ago • 2 comments

Describe the bug

When building a deployment package for a .NET core 3.1 project with the LambdaNETCoreDeploy task after restoring packages from custom feeds, the task fails because it attempts to build for .NET core 1.0 which is no longer available

To reproduce

  1. Create a project targeting .NET core 3.1 referencing packages from custom feeds
  2. Create a pipeline with following tasks:
    • nuget restore from custom feed
    • LambdaNETCoreDeploy, Create deployment package only
  3. Run the Pipeline
  4. The pipeline fails with The framework 'Microsoft.NETCore.App', version '1.0.0' was not found.

Expected behavior

The pipeline succeeds and builds a deployment package targeting netcoreapp3.1 as specified in the .csproj

Your Environment

  • On-prem or cloud based?: cloud
  • AWS Toolkit for Azure DevOps version: 1.7.0

Additional context

Packaging the project manually with dotnet lambda package works as expected VM image for the pipeline: ubuntu-latest

domenicgilardoni avatar Jun 04 '20 14:06 domenicgilardoni

This issue is related to #350 in that if you omit the dotnet restore and/or don't reference packages in custom feeds, that issue occurs and the workaround described there works

domenicgilardoni avatar Jun 05 '20 07:06 domenicgilardoni

Do you happen to have in your csproj file and old reference to Amazon.Lambda.Tools using the DotNetCliToolReference element? I wondering if you do and when you do a restore it is triggering bringing that into play instead of the global tool which is used today.

normj avatar Jun 23 '20 23:06 normj