I have a .net core 2.2 web app that has been building successfully in Bamboo for several months. Recently someone built a new Bamboo server (we're on premise, not in cloud) and my build began failing.
My original post stated that the failing script was running dotnet publish, but I realize now that I misread the log file. The error is occurring in the previous script task, which is running
nuget restore
The first line in the log file (after it dumps out all of the bamboo environment variables) is
MSBuild auto-detection: using msbuild version '15.9.21.664' from 'C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin'.
That is followed by four instances of the following error - probably one for each project in the solution:
C:\Program Files\dotnet\sdk\2.1.509\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.TargetFrameworkInference.targets(137,5): error NETSDK1045: The current .NET SDK does not support targeting .NET Core 2.2. Either target .NET Core 2.1 or lower, or use a version of the .NET SDK that supports .NET Core 2.2. [E:\bamboo-home\xml-data\build-dir\RWDMIC-OAZD-JOB1\My.Service\MyProject.Service.csproj]
Does knowing that it is a nuget restore error and not a dotnet publish error generate any new hypotheses?
I found that .net core 2.2 had not been installed on the new server, so I installed it. But the error persists and the error continues to reference .net core 2.1.
What would determine the .net core version within a nuget restore operation?