Skip to content

Conversation

@rkeithhill
Copy link
Collaborator

@rkeithhill rkeithhill commented Oct 14, 2017

Fix #5015

This sets the version of the dotnet SDK that should be used to compile the project. I happen to have newer version of the SDK (2.0.2) on my machine and without this file, the build attempts to use the newer version of the SDK which doesn't work.

BTW if you have 2.0.2 installed, without this file when you run Start-PSBuild you get this warning and the build stops - even if you have 2.0.0 installed:

5> Start-PSBuild
WARNING: The currently installed .NET Command Line Tools is not the required version.

Installed version: 2.0.2
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

global.json Outdated
"sdk": {
"version": "2.0.0"
}
} No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a newline at the end of the file.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. BTW the original file was simply the output of running:

dotnet new global.json --sdk-version 2.0.0

@iSazonov
Copy link
Collaborator

@daxian-dbw Could you please review this bit change? It looks very good.

@rkeithhill
Copy link
Collaborator Author

Any update on this? I'm constantly having to create this file on every new branch I create. Otherwise, I can't build. Plus this allows the PowerShell team to specify which version of the SDK is requires. This will reduce contributor issues when their build fails with the message above. And when the team is ready to move to a later version of the SKD like 2.0.2, the global.json can be updated to reflect that change.

@daxian-dbw
Copy link
Member

@rkeithhill Thanks for this PR! Sorry that we had it slipped off our radar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants