Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,555,440
Community Members
 
Community Events
184
Community Groups

Why is Bamboo dotnet publish running older 2.1 version of .NET Core SDK?

Edited

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? 

1 answer

0 votes
Jimmy Seddon
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Dec 06, 2019

Hi @Zoe Hart,

As a first effort, I'd recommend taking a look to see what is being pointed to in the system path.  Also, what type of task are you using to execute this?  A script task?  If you are using a command task you might need to add a new system capability for the .NET Core 2.2 SDK you installed.

I hope that helps!

-Jimmy

By "system path", do you mean the PATH environment variable on the server? 

I am executing the build with a Script task, not a Command task. The dotnet publish command is the entirety of the script.

And, for whatever it's worth, it was working before we rebuilt the server. So I think it is something missing or mis-configured in the server build. 

I was able to navigate to the solution direction and successfully run the dotnet publish command manually, so the command and the server seem OK. 

The PATH environment variable just includes "C:\Program Files\dotnet\", which is where the dotnet.exe executable is located. So there is no version-specific location anywhere in the PATH environment variable. The selection of the version must happen within dotnet.exe and it is supposed to choose the latest installed version (2.2 in my case). And when I run it at the command line, it does choose 2.2. But when I run it in Bamboo, it does not. 

I just realized that I misread the log file and thus misreported this problem. The error is occurring during a NuGet Restore command task, not the dotnet publish Script task. I've edited the original post to reflect this more accurate information. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events