What does Windows Desktop (5) mean in context of .net 5?

0

Issue

I saw this link for the Registry class, which states it’s for the Windows Desktop 5 "Version" of .net. I searched for what that means, but unfortunately the noise to signal ratio on such a search is large.

So what does Windows Desktop 5 mean? I know what .net is, .net framework, .net core, .net standard, UWP, the various Xamarin "versions"… But not what Windows Desktop is.

It’s even stranger considering that I created a new .net 5 WPF project and typed in Registry, clicked CTRL+. and got the option to add using Microsoft.Win32; without doing anything else. So it seems to be simply part of .net 5 even though changing the "version" to .net 5 tells me that:

The requested page is not available for .NET 5.

Solution

The documentation for .Net Project SDKs states:

The .NET SDK is the base SDK for .NET. The other SDKs reference the
.NET SDK, and projects that are associated with the other SDKs have
all the .NET SDK properties available to them. The Web SDK, for
example, depends on both the .NET SDK and the Razor SDK.

One of the SDKs that it mentions is Microsoft.NET.Sdk.WindowsDesktop which is

The .NET Desktop SDK, which includes Windows Forms (WinForms) and
Windows Presentation Foundation (WPF).

Version 5 of this (for .net 5.0) is the "Windows Desktop 5" that the documentation for the Registry class is talking about.

This is further documented in the MSBuild reference for .NET Desktop SDK projects which is a

reference for the MSBuild properties and items that you use to
configure Windows Forms (WinForms) and Windows Presentation Foundation
(WPF) projects with the .NET Desktop SDK.

Answered By – Matthew Watson

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More