Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add global.json to pick correct SDK version#5118

Merged
daxian-dbw merged 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
rkeithhill:rkeithhill/add-global-jsonrkeithhill/PowerShell:rkeithhill/add-global-jsonCopy head branch name to clipboard
Oct 23, 2017
Merged

Add global.json to pick correct SDK version#5118
daxian-dbw merged 2 commits into
PowerShell:masterPowerShell/PowerShell:masterfrom
rkeithhill:rkeithhill/add-global-jsonrkeithhill/PowerShell:rkeithhill/add-global-jsonCopy head branch name to clipboard

Conversation

@rkeithhill

@rkeithhill rkeithhill commented Oct 14, 2017

Copy link
Copy Markdown
Collaborator

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

Comment thread global.json Outdated
"sdk": {
"version": "2.0.0"
}
} No newline at end of file

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Collaborator

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

@rkeithhill

Copy link
Copy Markdown
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
Copy Markdown
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

Morty Proxy This is a proxified and sanitized view of the page, visit original site.