Reputation: 197
I am trying to create a pipeline for .NET core 3.1 web application and keep running into a problem at NuGet Restore step.
Error is :
Version 3.1.100 of the .NET Core SDK requires at least version 16.3.0 of MSBuild. The current available version of MSBuild is 15.9.21.664. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
My VS is updated at the latest version, MSBuild installed in dependencies are at 16.6.0 but it looks like it still targets (finds) only 15.9.21.664 and I have no idea why.
My csproj project has these specifications
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build" Version="16.6.0" />
<PackageReference Include="Microsoft.Build.Framework" Version="16.6.0" />
<PackageReference Include="Microsoft.Build.Runtime" Version="16.6.0" />
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="16.6.0" />
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="16.6.0" />
</ItemGroup>
</Project>
If I understand it correctly, global.json is dropped in core 3+ and is sort of replaced by what is in csproj thus it should have right version 16+?
I am also using the step "Use .NET Core SDK 3.x" before NuGet Restore as somebody pointed out in already discussed thread.
Screenshot of my DevOps Pipeline:
I am trying to get into DevOps and Azure...
Upvotes: 3
Views: 2199
Reputation: 197
As @PEK suggested following fixed my issue: Azure pool was set to and as I changed it to Azure Pipelines and specification to window-2019 it built successfully.
Upvotes: 4