0
votes

Having an issue setting up an Azure Pipeline with my .Net5 Specflow NUnit project.

enter image description here

Those the list off jobs I currently have set up however as you can see I am getting an error in the build:

##[error]C:\Program Files\dotnet\sdk\5.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): Error NETSDK1005: Assets file 'D:\a\1\s\obj\project.assets.json' doesn't have a target for 'net5.0'. Ensure that restore has run and that you have included 'net5.0' in the TargetFrameworks for your project.

I have checked my project file and the reference to net5.0 is in there.

1

1 Answers

1
votes

It looks like that you didn't install the .NET 5 SDK on the build agents. You can use the .NET core task (https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops) to install it on your agent.

You should also update the NuGet client you are using in your pipeline. 4.4.1 is really old.