We are using the Azure DevOps to host and build our code. We are starting to build new services on .Net Core and since 2.2 is out, decided to go that route. But after installing .Net Core SDK 2.2.101 on the build agent (on premises), creating a vanilla asp.net core empty project (New Project -> pushed to git, absolutely no changes), it looks like it wants to compile it against the 2.1, even though the TargetFramework is netcoreapp2.2.
For building we are using the Visual Studio Build task. Using dotnet build is not an option as we'll need multiple targets for some of the common components we are sharing between .net framework and .net core projects we have.
2018-12-19T15:41:51.1962553Z ##[error]C:\Users\VssAdministrator\.nuget\packages\microsoft.aspnetcore.app\2.1.0\build\netcoreapp2.1\Microsoft.AspNetCore.App.targets(14,5): Error : This version of Microsoft.AspNetCore.App is only compatible with the netcoreapp2.1 target framework. Please target netcoreapp2.1 or choose a version of Microsoft.AspNetCore.App compatible with netcoreapp2.2.
The .net core installed on the agent (output from dotnet --list-sdks):
Same behavior can be observed on the Hosted VS2017 agent, but you need to install the .Net Core SDK 2.2.101 first using the .NET Core SDK Installer task.
Setting the version for Microsoft.AspNetCore.App explicitly in the csproj file resolves the exception, but does not solve the problem, as stranger errors pop up down the line.
Could not reproduce the problem on a developer machine. Might be related to the version of the Visual Studio installed.
The text was updated successfully, but these errors were encountered:
It seems that something in your Azure DevOps setting (or in the platform itself) decided to use wrong MS.AspNetCore.App package. If it compiles locally, I would dig into the differences of used SDKs and other tools. Contacting Azure DevOps support may be one of the ways to narrow it down.
This may be also helpful: https://www.hanselman.com/blog/AzureDevOpsContinuousBuildDeployTestWithASPNETCore22PreviewInOneHour.aspx
If you find evidence this is a problem in .NET Core itself (SDK or runtime), please let us know and we can reopen.
Closing as this is likely problem in Azure DevOps.
UPDATE: for the benefit of anyone having the same issues
found the problem, it was due to the NuGet restore task using the 4.3 version (because I cloned the build definition from another project, doh..). Updated to latest and it worked OK.
We are using the Azure DevOps to host and build our code. We are starting to build new services on .Net Core and since 2.2 is out, decided to go that route. But after installing .Net Core SDK 2.2.101 on the build agent (on premises), creating a vanilla asp.net core empty project (New Project -> pushed to git, absolutely no changes), it looks like it wants to compile it against the 2.1, even though the TargetFramework is netcoreapp2.2.
For building we are using the Visual Studio Build task. Using dotnet build is not an option as we'll need multiple targets for some of the common components we are sharing between .net framework and .net core projects we have.
2018-12-19T15:41:51.1962553Z ##[error]C:\Users\VssAdministrator\.nuget\packages\microsoft.aspnetcore.app\2.1.0\build\netcoreapp2.1\Microsoft.AspNetCore.App.targets(14,5): Error : This version of Microsoft.AspNetCore.App is only compatible with the netcoreapp2.1 target framework. Please target netcoreapp2.1 or choose a version of Microsoft.AspNetCore.App compatible with netcoreapp2.2.
The .net core installed on the agent (output from dotnet --list-sdks):
Same behavior can be observed on the Hosted VS2017 agent, but you need to install the .Net Core SDK 2.2.101 first using the .NET Core SDK Installer task.
Setting the version for Microsoft.AspNetCore.App explicitly in the csproj file resolves the exception, but does not solve the problem, as stranger errors pop up down the line.
Could not reproduce the problem on a developer machine. Might be related to the version of the Visual Studio installed.
The text was updated successfully, but these errors were encountered: