We know that .NET 5.0 makes it possible to develop WPF and Windows Forms applications. However, at the time of writing, Visual Studio templates haven’t been updated to new target framework: desktop applications are still created using .NET Core 3.1. So, for example, the project file for a WPF application is the following:
However, we can easily update it to use .NET 5.0. We just need to change Sdk attribute (line 1) and the TargetFramework tag (line 5):
In particular, we don’t have anymore an Sdk that relates to desktop applications. Instead, we have a target framework moniker (TFM) that is OS-specific, net5.0-windows. This is because the standard net5.0 moniker only includes technologies that work cross-platform. Specifying an OS-specific TFM makes APIs that are specific to an operating system available to ours applications (in our case, desktop applications on Windows). Of course, OS-specific TFMs also inherit every API available…
View original post 211 more words
Leave a Reply