DEV Community

Discussion on: Develop Azure Functions using .NET Core 3.1

Collapse
 
jeffhollan profile image
Jeff Hollan

Your app is set to target 2.1 so your build agent will need a 2.x version. Reads that build agent only has 3.x. Other option is change app target is csproj to netcoreapp3.0

Collapse
 
patricknolan profile image
Patrick

Hi Jeff thanks heaps for your response it hugely appreciated!

My .csproj file currently contains the following. Would you then expect the Azure build pipeline to target 3.0 and not 2.1?


netcoreapp3.0
v3-preview

Thread Thread
 
jeffhollan profile image
Jeff Hollan

Hmm if that’s what your csproj says maybe the problem is the other way around. Can you confirm the devops agent has and is using dotnet 3? I don’t know where the 2.1 would come from if it’s not in your csproj file

Thread Thread
 
patricknolan profile image
Patrick • Edited

I'm executing a "use .NET Core" step beforehand which is set to version 3.0.x. I noticed John D'Alessandro also posted here with the same issue :(

I also tried setting the Agent Specification to windows-2019 value as suggested here stackoverflow.com/questions/565741...

Thread Thread
 
jeffhollan profile image
Jeff Hollan

Ok let me see if I can repro

Thread Thread
 
jeffhollan profile image
Jeff Hollan

Was able to repro. Found a bug. Tracked here: github.com/Azure/azure-functions-v...

workaround is to make sure 2.x is on the build box as well. I changed my deploy script to this and it worked in the interim.

- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '2.1.x'
- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: '3.0.x'