-
Notifications
You must be signed in to change notification settings - Fork 896
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
Can't load projects in solution #1781
Comments
I think the reason was that I installed the 64-bit versions of the SDK, but VS was looking for the 32-bit versions. After installing the 32-bit versions the projects load even with the global.json file. It seems that the |
What version of VS 2019 are you running? Assuming you're running the latest version, then the problem is that the global.json file needs to be updated. Version 16.5.x requires a 200 series SDK, but the global.json is still pointing at a 100 series SDK. I had already fixed this in a PR that's being worked on and not yet ready to merge, but I'll look into getting the change into master as well. |
Yes, I'm running the latest version (Visual Studio 2019, Version 16.5.4). |
The other question is - is it really necessary to have a |
It's a trade-off either way. Without it, you can run into problems where a new SDK release breaks things without being able to control when that happens. The fact that different Visual Studio versions keep requiring specific SDKs does often seem to make the benefit of it more questionable though. When we switched to Azure DevOps, part of the tooling around that @AArnott contributed also brought in the global.json stuff. I'd have to look through that to see what impact there would be in removing it. |
Righto. In fact the last update 3.1.200 actually broke one of my repos. Fortunately I had a global.json file so that it kept working until I tried updating the global.json file, so I knew exactly what to blame when things broke.
Ya, this doesn't sound right. It's not true, frankly. I use all sorts of SDK versions with VS and VS is fine with it. And the fact that installing the 32-bit version of the SDK making it work would also seem to defeat the theory that VS needed a later version. |
It's definitely true, otherwise they wouldn't release multiple versions of the SDK pointing out which version of the SDK you need to match the version of Visual Studio you're using. See https://dotnet.microsoft.com/download/dotnet-core/3.1 for many examples of this. |
I don't think this is actually fixed. I don't have any 32-bit SDKs installed on my machine either and it works in VS 16.7. @ermshiperete can you open a new command prompt and type |
@bording How do you reconcile that with the fact that VS can load projects from all my repos that use a wide variety of SDKs? |
If you look at the 2.1 download page, it says "Visual Studio 2019 (v16.2 or later)" for the SDK 2.1.805 SDK. I take that to mean that it would work with any newer versions, but the 2.1.610 SDK wouldn't. Are you saying you have projects that are actively locked to the 2.1.610, for example, that load properly in newer VS 2019 versions? If so, that would indeed surprise me based on previous discussions I've had and seen elsewhere on GitHub. |
I've never met a VS version that couldn't load all prior SDK versions. Just to make the point, I took a clone of https://github.com/aarnott/library.template, changed global.json from 3.1.201 to 2.1.513, and removed the netcoreapp3.1 target from the test app (since .NET SDK 2.1 can't target .NET Runtime 3.1). I then ran So anyone who can't open a project with an older SDK due to an SDK error message is (in my experience) simply missing that particular SDK installation in every case. |
Interesting. That's definitely not what I would have expected based on everything I've read. I was under the impression that both VS and the SDK had minimum versions it would work with. Thanks for the new information! Seems like something that should be clarified somewhere. Being able to point to a document that says that VS can work with all older SDKs would be nice. |
Maybe file a bug on the dotnet/sdk github repo asking them to be more clear on their get.dot.net web site? |
That's the current list of sdks (with which things work). See above for the list of sdks when it didn't work (after running
|
I don't have
Where is running It seems that the |
You rebooted, @ermshiperete? But you only have 2.1.301 installed in the machine location (in your issue description), and this repo required 3.1.100 (until @bording's PR which bumped it to 3.1.201). So it's no wonder VS couldn't load your projects. You must either use
Install-DotNetSdk.ps1 did set the DOTNET_ROOT env var, at least if you installed in a lesser location than
init.ps1 just runs |
Reproduction steps
I followed the instructions in
CONTRIBUTING.md
and installed the required .NET Core SDK and runtimes by runningtools\Install-DotNetSdk.ps1
(I tried both with and without-InstallLocality Machine
).CONTRIBUTING.md
mentions to usebuildandtest.cmd
to build and run the tests. I can't find that file anywhere.Trying to open
LibGit2Sharp.sln
in Visual Studio 2019 (or Jetbrains Rider) fails to load the projects with:Deleting
global.json
allowed me to load the projects.Version of LibGit2Sharp (release number or SHA1)
master branch: 4de700f
Operating system(s) tested; .NET runtime tested
Windows 10
Output of
dotnet --info
:The text was updated successfully, but these errors were encountered: