Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global.json causing VisualStudio fail to load the Template projects #817

Closed
lamLeX opened this issue Oct 22, 2020 · 3 comments
Closed

Global.json causing VisualStudio fail to load the Template projects #817

lamLeX opened this issue Oct 22, 2020 · 3 comments
Labels
bug Issues describing a bug or pull requests fixing a bug.

Comments

@lamLeX
Copy link

lamLeX commented Oct 22, 2020

Describe the bug

Currently, the value of global.json sdk is set for the version 3.1.302. On my dev machine, I got the latest sdk 3.1.403 . This causes VS to fail to load the projects because the sdk 3.1.302 does not exist on my machine.

To Reproduce

Uninstall old sdk and keep the newer sdk.

Suggested Fix

I'm not quite sure the intention of global.js in the template. Perhaps, your machine has the preview sdk installed and you want to tie the project to the released version.

Since SDK 3.0, they add the support for roll-forward https://docs.microsoft.com/en-us/dotnet/core/tools/global-json?tabs=netcore3x#rollforward

May I suggest to add the "rollForward": "latestMajor" and "allowPrerelease": false to help in case that the dev machine doesn't have the specific version defined?

Project template

All

Environment

Which version of Visual Studio and the dotnet SDK were you using?
VS Version 16.7.6
dotnet sdk 3.1.403

@lamLeX lamLeX added the bug Issues describing a bug or pull requests fixing a bug. label Oct 22, 2020
@RehanSaeed
Copy link
Member

Yes, I've been meaning to do this for more than a year. However, there is a bug that stops us from doing this dotnet/install-scripts#7. It stops the dotnet-install.ps1 and dotnet-install.sh scripts which install the .NET SDK from working. We use these scripts in the AppVeyor CI script and I believe it's also used by the setup-dotnet GitHub Action task and Azure DevOps tasks under the covers.

Luckily a fix was merged four days ago. I've raised a test PR in one of my other repos to see if it now works:

RehanSaeed/Schema.NET#218

@RehanSaeed
Copy link
Member

In the linked thread, they say that the update to dotnet-install.ps1 and dotnet-install.sh will be pushed out in the next few days. Will fix after that. Also can confirm that this only affects AppVeyor.

@RehanSaeed
Copy link
Member

Fixed in #865.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues describing a bug or pull requests fixing a bug.
Projects
None yet
Development

No branches or pull requests

2 participants