John Conde
John Conde

Reputation: 219804

Unable to load solution in JetBrains Rider

I am attempting to load a solution offered by Pluralsight which contains a project called "GradeBook" using JetBrains' Rider IDE. After cloning the repository from Git and loading the solution, I get an error:

"Project 'GradeBook' load failed: The SDK 'Microsoft.NET.Sdk' specified could not be found. C:\Path\To\RiderProjects\CSharp-GradeBookApplication\GradeBook\GradeBook.csproj at (0:0)"

I checked my local repository and all of the files are present and correct.

The project specifies a target framework version of 2.0.

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <StartupObject />
  </PropertyGroup>

  <ItemGroup>
    <None Remove="*.gdbk" />
  </ItemGroup>

  <ItemGroup>
    <PackageReference Include="Newtonsoft.Json" Version="10.0.3" />
  </ItemGroup>

</Project>

I believe my environment supports it as I see it in my list of installed runtimes (Microsoft.NETCore.App 2.0.9). When I run dotnet --info from the command line, I get the following results:

.NET Core SDKs installed:
2.1.202 [C:\Program Files\dotnet\sdk]
2.2.105 [C:\Program Files\dotnet\sdk]
3.0.100-preview3-010431 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0-preview3-19153-02 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.0.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0-preview3-27503-5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.0.0-preview3-27504-2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

I verified Rider is configured to point to the correct path of dotnet.exe:

C:\Program Files\dotnet\dotnet.exe

I have also tried changing the TargetFramework to 2.2 and 3.0 in an effort to bypass this issue.

Being new to C# and .NET, I am sure there are things I have not thought of to troubleshoot this issue. For starters, I do not see a version 2.0 listed under the SDKs, but after installing every .NET SDK I could find, including ones that specifically said they were v2.0, I am out of ideas and need assistance overcoming this issue.

I do know that it is uncommon to use an IDE other than Visual Studio for C# and .NET development, but I see no reason for this simple project to fail to load.

Upvotes: 12

Views: 24292

Answers (3)

scil
scil

Reputation: 307

I removed dir .idea, failed

I re-install rider, failed.

I remove the rider config dir, successed.

before this, I exported the setting to setting.zip, then remove the config dir, then import the setting.zip.

Upvotes: 0

jspinella
jspinella

Reputation: 2423

If you are on macOS Ventura (beta?), there seems to be a bug related to file permissions. In Rider, the (.NET 6) solution would not load and Rider was stuck on "Connecting to ReSharper Host".

The solution for me was to chmod -R 777 ~/. I'm sure 777 is more permissive than it needs to be, and it doesn't need to be done on ~/, you probably just need to do it on the directory of the solution you are opening with Rider.

I realize this is a slightly different issue than the question, but this is where I ended up when trying to fix my issue, so others will end up here too.

Upvotes: 2

John Conde
John Conde

Reputation: 219804

The issue boiled down to the MSBuild version I was using. After following the instructions in "Using Rider under Windows without Visual Studio: prerequisites" I had a custom build specified: C:\SDK\MSBuild\15.0\Bin\MSBuild.exe.

enter image description here

I then switched to the autodetected version: C:\ProgramFiles\dotnet\sdk\2.2.105\MSBuild.dll

enter image description here

The project has now loaded successfully.

Upvotes: 22

Related Questions