aws-toolkit-azure-devops
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
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
- Create a project targeting .NET core 3.1 referencing packages from custom feeds
- Create a pipeline with following tasks:
- nuget restore from custom feed
- LambdaNETCoreDeploy, Create deployment package only
- Run the Pipeline
- 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
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
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.