Find which target framework application is building on?

491 Views Asked by At

I have old .NET Core project. Under application properties the project's Target framework is .NET Core 2.0 enter image description here

But on the build server We don't have 2.0 SDK installed. Instead we have other SDK versions, like 2.1, 2.2 etc

enter image description here

The application is building and working fine. Build server is using dotnet publish -c Release command to build the application. But how do I know which version is being used to build the application. Is it using the latest version of 2.*, which in this case 2.2.402?

1

There are 1 best solutions below

0
Ruikai Feng On

I think you could check this document

As mentioned in the document:

The process for selecting an SDK version is:

dotnet searches for a global.json file iteratively reverse-navigating the path upward from the current working directory.

dotnet uses the SDK specified in the first global.json found.

dotnet uses the latest installed SDK if no global.json is found.