August 25th, 2017

UWP & .NET Standard 2.0: A preview is now available!

Immo Landwerth
Program Manager

Today, we released the first Preview of Visual Studio 2017 version 15.4. This includes an update to the UWP tooling that supports .NET Standard 2.0. In this post, I’ll outline what this means for UWP development with .NET.

Prerequisites

In order to use .NET Standard 2.0 in UWP, you need to target Fall Creators Update (FCU) as the minimum version of your UWP project. That’s because .NET Standard 2.0 contains many APIs that require FCU to make them work in the context of the UWP execution environment, specifically AppContainer.

What’s new with .NET Standard 2.0?

.NET Standard is a specification of APIs that all .NET implementations have to implement. UWP is now adding support for .NET Standard 2.0.

The key advantage of .NET Standard 2.0 is that it makes .NET implementations of .NET Standard much more similar to .NET Framework. With .NET Standard 2.0, about 20,000 more APIs become available compared to .NET Standard 1.6. The vast majority of them are existing .NET Framework APIs, which includes missing reflection APIs, non-generic collections, DataSet, binary serialization, XML Schema, and many more. For a full list, take a look at the diff between .NET Standard 2.0 and .NET Standard 1.6.

This makes it much easier to port existing .NET Framework code to UWP. This includes both, copy & pasting existing code, but also extends to referencing existing .NET Framework binaries, via the compatibility mode. Here is an example of using DataSet inside a UWP application:

For more details, check out my blog post on .NET Standard 2.0.

Summary

Visual Studio 2017 version 15.4 Preview 1 adds support for .NET Standard 2.0 in UWP projects that require Fall Creators Update (FCU). Please give it a spin and tell us what you think!

Author

Immo Landwerth
Program Manager

Immo Landwerth is a program manager on the .NET Framework team at Microsoft. He specializes in API design, the base class libraries (BCL), and .NET Standard. He works on base class libraries which represents the core types of the .NET platform, such as string and int but also includes collections and IO. He's involved with portable class libraries and works on shipping more framework components in an out-of-band fashion via NuGet.

0 comments

Discussion are closed.