Changing from windows-latest to ubuntu-latest causes nuget package compatibility issues

Viewed 153

My team recently moved away from using service fabric and instead are using linux docker containers.

All runs fine locally, but when I went to create my pr in VSTS I got an error saying Your docker server host is configured for 'windows', however the docker-compose project targets 'linux'

Ok, so I thought the fix for this might be updating my azure-pipeline.yml file so that vmImage gets switched from

vmImage: 'windows-latest'

to

vmImage: 'ubuntu-latest'

First, I'm unsure if this is the proper approach. If it is, the problem I'm having once I save and create a new PR for this update is all of my nuget packages are coming back saying they aren't compatible with .net 5.0.

1 Answers

This issue probably was caused by an old version of Nuget being used in the ubuntu-latest agent.

You can try using nuget 5.x version in the agent by adding the NuGet Tool Installer task in your pipeline. See below:

- task: NuGetToolInstaller@1
  inputs:
    versionSpec: 5.x

Check out this similar thread for more information.

Related