Support for the Upcoming .NET SDK 6.0

The latest Rider 2021.3 EAP builds support .NET 6 SDK. Please download them from https://www.jetbrains.com/rider/nextversion/

49 out of 68 found this helpful
29 comments

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

 

1

Hello Simon! 

Thanks for contacting us. 

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

Thanks! 

0

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

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

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

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

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

Edited by Aneudy Motacatalino
0

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

Microsoft has released the .NET 6 already, it's not preview, it's LTS.

https://devblogs.microsoft.com/dotnet/announcing-net-6/

Is there any guidelines on how to use it with Rider until it's fully supported? Or any estimation on when we may be able to safely upgrade if we develop with Rider? Thanks

19

We are also interested in .NET 6. Any ETA for official support?

 

21

Also would like to know what is the estimation on when Rider will support it. It's annoying having to use VS :)

18

What is the ETA on this, please? .NET 6 is already in production. Our team opted to go for Rider over Visual Studio, and paying licenses for both IDEs is not an option. I'd hate others to use this as an argument to go back to Visual Studio.

5

Rider 2021.3 EAP already works well with NET6.
Regarding the release dates - https://twitter.com/maartenballiauw/status/1458447535350165511

0

This may or may not have an impact on Rider if it uses the command line to interact with dotnet.

One system wide issue I had on windows 10 pro was when trying to build a dotnet app from the command line. Build was unrecognized and dotnet --info reported nothing under the sdk section, despite having installed vs2022 (after uninstalling vs2019). Resolving this was simple once the cause was discovered, in the env path  C:\program files\dotnet  must come before C:\program files (x86)\dotnet. 

0

Great news! Thanks for the update!

One question about EAP (never used it before). If I don't do a Silent uninstall, will I lose all my settings? Or do they get migrated to EAP before they are deleted from the old version directory?

Edited by Eu11111
0

After installing VS22 and .NET 6, I can not create a new MVC project with .NET 5 and Framework is grayed out,

Also in Toolset I don't see any MSBuild targeting to .NET 5.



Edited by V.Cheshmy
1

Please report this issue with Help - Report a Bug, agree to attach logs.

0

Will we eventually get hotreload during debug in Linux?

I am very much enjoying the hotreload feature, it makes dev so much quicker when working with ui elements.

0

se5a, having the Hot Reload (aka "Edit and Continue") during debugging only on Windows is a limitation of the .NET runtime. We can hardly do anything here.

0

Alexander Kurakin: Regarding your yesterday's post: "The latest Rider 2021.3 EAP builds support .NET 6 SDK." 

I have just installed 2021.3 EAP on a MacBook 2019 (Intel). Still missing .NET6 when creating a console application.

Did I get something wrong? Do I have to install .net 6 additionally?

0

@Slog, Please try to change MSBuild in the Rider settings.

0

Slog, yes you do need to install.Net 6 additionally.  Although you have a version of Rider that supports .Net 6, it doesn’t automatically install.Net for you and won’t allow you to select .Net 6 if it is not there.  That caught me out at first!

1

Simon O'Rorke thx for your reply.

I had the same insight yesterday. And it worked fine.

0

In 2022.1.2 creating a new Umbraco solution (with Umbraco Templates V10.0.1 installed via terminal), the New Solution dialogue only shows SDK 5.  Yet the machine has:-
dotnet --version 6.0.302
And
dotnet --list-sdks
5.0.408 [/usr/share/dotnet/sdk]
6.0.302 [/usr/share/dotnet/sdk]

Why doesn't SDK 6.0 show in the dropdown?

Thanks.

0

Hi Craig,

Can you please share a screenshot of the Create new solution window with the expanded Framework dropdown to see the options? Also, let's check if Rider detects .NET 6 on `File | Settings | Build, Execution, Deployment | Toolset and Build` -> MSBuild version (share a screenshot of this field in an expanded state).

I could not reproduce what you described and it looks like this on my side even if I do not have .NET 6 installed: 

And this matches to what I see in template code: https://github.com/umbraco/Umbraco-CMS/blob/3e008454295a9fbf2b0a4bb5a86234590dd4ef25/templates/UmbracoProject/.template.config/template.json#L43

If you uninstall and install again Umbraco templates, does it fix the issue?

dotnet new -u Umbraco.Templates
dotnet new -i Umbraco.Templates
0

Hi Sofia,

My New Project dialogue is just like yours and my MSBuild version dropdown has only one entry which is auto-detected and is (17.0) - /usr/share/dotnet/sdk/6.0.302/MSBuild.dll.  Your github link appears to be for V10.0.0-rc1 and not V10.0.1.  As you suggested I removed and reinstalled the templates just in case that was an issue.  What I found was that the "SDK" dropdown only has "5.0" and "Unknown" available. It doesn't show "6.0" even though it is installed as you can see from the MSBuild dropdown. If I select "SDK: Unknown" and "Framework: net6.0" then Umbraco V10.0.1 is correctly installed. If I select "SDK: 5.0" and "Framework: net6.0" then Umbraco 9.5.4 is installed. What has caused the confusion is the "SDK" not having a "6.0" for selection when we know that the SDK MUST be greater than 6.0.301 to install V10.0.1.

I can get on and work now but it would be nice to see 6.0 in the SDK dropdown.

Thanks.

0

Hi Craig,

Now I see, I did not get it right because payed attention mostly on Framework field. The thing is that Rider did not manage to understand for wich SDK this project template was installed (It only found it for SDK 5). You can find Umbraco template on your machine and check that it is installed for .NET SDK 5 and kinda globally (probably - for the latest available SDK). And the second case is not handled well and this is why we see Unknown. I've raised an issue to fix it: https://youtrack.jetbrains.com/issue/RIDER-80135/Unknown-value-in-SDK-field-in-the-New-Project-window.

Thank you for pointing us to this issue.

1

There is option in unit testing to set the target platform (x86 or x64) but not the OS. .NET 6 introduced --os arg to "dotnet test". See https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-test

Rider test runner has to offer option to set the OS or runtime identifier (either will do). Without setting OS, cryptic errors around PlatformNotSupportedException are throw.

From command line this works:

dotnet test --os linux

This doesn't work, and gives exact same error as Rider unit test runner:

dotnet test

0

Please sign in to leave a comment.

Have more questions?

Submit a request