Support for the Upcoming .NET SDK 6.0

Microsoft recently published the first preview for the upcoming .NET SDK 6. Rider does not yet provide official support for the newest SDK. Before we run the full QA cycle to identify all the situations where Rider behaves incorrectly, we’re going to wait for more stable bits of the SDK (right now .NET 6 itself has many issues to fix). We will get Rider fully tested on .NET SDK 6 closer to the .NET SDK 6 release.


If you’ve noticed any other problems which you think might be related to the installed .NET SDK 6.0-preview, please keep in mind that it might be a current limitation of .NET SDK or simply a bug in the preview. If you still think it is a Rider issue, please file a new issue on YouTrack and explicitly mention that the preview SDK is installed.

8 comments
Comment actions Permalink

Hello Alexander

I had .NET SDK 6.0-preview installed on my PC for one day to try something out with Visual Studio Preview Edition. Having quickly decided I was not interested after all, I uninstalled it.  As you can see, it is gone:

But when I open an existing .NET 5.0 solution in Rider 2021.1.1, I get this event log message:

.NET SDK 6.0.100 is not fully supported in Rider
Some IDE features may not work

Below the message is a link for Manage SDK. I clicked that, and a 'Manage .NET / .NET Core SDK for Solution' dialog box is shown:

I changed the SDK version to 5.0, like this, and clicked OK:

I then closed Rider and restarted it.  The event log message was displayed again. And when I clicked Manage SDK again, the version had reverted to 6.0.

I can see that, as a result of changing the SDK version in the dialog box a file global.json has been added to my solution folder with the following contents:

{
"sdk": {
"version": "5.0",
"rollForward": "latestMajor",
"allowPrerelease": false
}
}

However, storing this information failed to stop the event log message from being shown again when I reopened Rider.  That's one problem.

The other related problem is that Rider warns me about .NET SDK 6.0 even though I uninstalled it.  Evidently, even though the SDK has been uninstalled, it has left some trace that Rider is picking up.

Fortunately, no harm has been done to my solution.  Its projects all still know they are .NET 5.0, and a clean build of the solution worked fine and all the unit tests still pass.

I know I can tell Rider not to show me that event log message again.  For now, I shall not do so, pending your comments.

Cheers,

Simon

 

0
Comment actions Permalink

Hello Simon! 

Thanks for contacting us. 

Could you please run the dotnet --version command in CMD? What version will it show? 

Thanks! 

0
Comment actions Permalink

Hello Alexander,

The dotnet --version command gave this error message:

Found .NET SDK, but did not find dotnet.dll at [C:\Program Files\dotnet\sdk\6.0.100-preview.3.21202.5\dotnet.dll]

I searched for "Found .NET SDK, but did not find dotnet.dll at" and found a fix at https://github.com/dotnet/sdk/issues/6180. As you may know, it's a known problem where uninstalling an SDK can sometimes leave a folder "C:\Program Files\dotnet\sdk\[VERSION]".  In my case there was a folder 'C:\Program Files\dotnet\sdk\6.0.100-preview.3.21202.5' containing only one file, EnableWorkloadResolver.sentinel. 

Following the advice in the thread, I deleted the folder.  The dotnet --version command now shows "5.0.201", as expected.

To test Rider, I also deleted global.json from the solution folder.  The problem is fixed.  Rider no longer shows the event log message. Evidently that leftover sdk version folder (or perhaps the one file within it) was the trace of the uninstalled SDK that Rider had previously been picking up.

Thanks for your help!

Simon

Edited by Simon O'Rorke
1
Comment actions Permalink

Hello Simon! 

Thanks a lot for sharing the investigation result with us! That's great to hear you found out the root of the problem and fix that. 

Thanks! 

0
Comment actions Permalink

Hello Alexander

If I run dotnet --version in solution root with the global.json file written by rider ( with "version": "5.0" in it ) then the result is 6.0.100-preview.5.21302.13.

If I change it to "version": "5.0.301" then the result is 5.0.301 but Rider still displays the warning about unsupported SDK version and the dialog still shows version 6.0

1
Comment actions Permalink

HI, Jan

Maybe you can check the Settings -> Build, Execution, Deployment -> Toolset and Buid to see what is your .Net Core Cli execution path and MSBuild version Setting. It can be set to .net core 6 for some reason. 

1
Comment actions Permalink

What worked for me was changing the Roll-forward policy to "major". 
And selecting version 5, of course.

Edited by Aneudy Motacatalino
0
Comment actions Permalink

This is work for me


1. I uninstalled visual studio 2022

2. Removed folder  C:\Program Files\dotnet\sdk\6.0.100-preview

Edited by Wangruifei
0

Please sign in to leave a comment.

Have more questions?

Submit a request