Developing Desktop applications with .NET 5.0

Around and About .NET World

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

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Blog at WordPress.com.

Up ↑

%d bloggers like this: