Can't load projects in solution
See original GitHub issueReproduction steps
I followed the instructions in CONTRIBUTING.md
and installed the required .NET Core SDK and runtimes by running tools\Install-DotNetSdk.ps1
(I tried both with and without -InstallLocality Machine
).
CONTRIBUTING.md
mentions to use buildandtest.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:
15-04-2020 14:18:36 Critical Some of the projects might not be read correctly. You may disable solution loading from disk or do that for certain projects.|
Project 'LibGit2Sharp' load failed:
[MSB4236] The SDK 'Microsoft.NET.Sdk' specified could not be found. D:\Develop\libgit2sharp\LibGit2Sharp\LibGit2Sharp.csproj at (0:0)Project 'LibGit2Sharp.Tests' load failed:
[MSB4236] The SDK 'Microsoft.NET.Sdk' specified could not be found. D:\Develop\libgit2sharp\LibGit2Sharp.Tests\LibGit2Sharp.Tests.csproj at (0:0)Project 'NativeLibraryLoadTestApp.x86' load failed:
[MSB4236] The SDK 'Microsoft.NET.Sdk' specified could not be found. D:\Develop\libgit2sharp\NativeLibraryLoadTestApp\x86\NativeLibraryLoadTestApp.x86.csproj at (0:0)Project 'NativeLibraryLoadTestApp.x64' load failed:
[MSB4236] The SDK 'Microsoft.NET.Sdk' specified could not be found. D:\Develop\libgit2sharp\NativeLibraryLoadTestApp\x64\NativeLibraryLoadTestApp.x64.csproj at (0:0)
Deleting global.json
allowed me to load the projects.
Version of LibGit2Sharp (release number or SHA1)
master branch: 4de700fedf87a5c9de10b921a636cc2f21d8964d
Operating system(s) tested; .NET runtime tested
Windows 10
Output of dotnet --info
:
A compatible installed .NET Core SDK for global.json version [3.1.100] from [d:\Develop\libgit2sharp\global.json] was not found
Install the [3.1.100] .NET Core SDK or update [d:\Develop\libgit2sharp\global.json] with an installed .NET Core SDK:
2.1.301 [C:\Program Files (x86)\dotnet\sdk]
Host (useful for support):
Version: 3.1.3
Commit: 4a9f85e9f8
.NET Core SDKs installed:
2.1.301 [C:\Program Files (x86)\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.3 [C:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.1 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.3 [C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files (x86)\dotnet\shared\Microsoft.WindowsDesktop.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (11 by maintainers)
Top Results From Across the Web
Visual Studio not showing all Projects in solution
Close the VStudio entire project, go to the main project folder and click on the . · go to solution explorer see which...
Read more >Visual Studio 2022 Community Project not load solution
Please first try to reboot your machine and directly start VS and open your project, to avoid the impact from other extensions/applications.
Read more >Cannot load projects - Developer Community
This solution contains 9 netstandard class libs, 5 netcore test projects, 1 aspnetcore and 1 console netcore app. All these projects cannot be...
Read more >One or More Projects in the solution were not loaded correctly
If you want to fix this types of error then must to update your tools, I face this problem when I was not...
Read more >VS : How to solve error - The project file could not be ...
The problem lies with the nonexistent path of one or more projects that are stored in the solution file. You can solve this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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. Had you opened VS immediately from the command prompt you used to install the .NET SDK with our script, it would have worked perfectly.
You must either use
-InstallLocality Machine
or launch VS from the same command prompt you ran our init script from. And no reboot is necessary.Install-DotNetSdk.ps1 did set the DOTNET_ROOT env var, at least if you installed in a lesser location than
Machine
. But that env var only is set in the powershell.exe process that ran the script.init.ps1 just runs
Install-DotNetSdk.ps1
and then restores packages. So for your purposes, the two are equivalent.