Skip to content

Need global.json to set the desired SDK version #5015

@rkeithhill

Description

@rkeithhill

I have .NET Core 2.0.2-vspre-006949 installed as well as 2.0.0. When I try to build with Start-PSBuild, I get this error:

WARNING: The currently installed .NET Command Line Tools is not the required version.

Installed version: 2.0.2-vspre-006949
Required version: 2.0.0

Fix steps:

1. Remove the installed version from:
    - on windows '$env:LOCALAPPDATA\Microsoft\dotnet'
    - on macOS and linux '$env:HOME/.dotnet'
2. Run Start-PSBootstrap or Install-Dotnet
3. Start-PSBuild -Clean

FWIW I had just recently run Start-PSBootstrap and restarted the console. And when I got the above error I was running Start-PSBuild -Clean.

But in this case, the issue is easily fixed by putting a global.json file in the root of the repo with these contents:

{
  "sdk": {
    "version": "2.0.0"
  }
}

Environment data

I'm building on Windows PowerShell 5.1 on Windows 10 CU.

> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      5.1.15063.608
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.15063.608
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions