Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News .NET Standard 2.0: Setting Expectations Straight

.NET Standard 2.0: Setting Expectations Straight


Following last .NET Connect 2016, a few Microsoft MVPs have published their views on what .NET Standard is and where it is headed.

When introducing .NET Standard 2.0 two months ago, Microsoft described it as an effort to provide a solid foundation for the three main .NET platforms actually existing – .NET Framework, .NET Core, and Xamarin – and for any fork that might be created in the future to address a new device category, such as the Raspberry Pi, or IoT.

The main problem the existence of three forks poses to developers lies with the difficulty to know exactly what is available on each concrete platform, which may vary significantly. This leads to widespread usage of conditional compilation, writes .NET developer GaProgMan. Additionally, he adds, Portable Class Libraries (PCLs) are not that portable anymore, since developers cannot easily guarantee the availability of their required APIs on the target platforms. The answer to this, according to Microsoft, is .NET Standard replacing PCLs as a foundation for writing multi-platform .NET libraries.

In this context, though, Microsoft MVP Rick Strahl points out that .NET Standard should be understood as a specification describing “what a specific implementation like .NET Core, Mono, Xamarin or .NET 4.6 has to implement - at minimum - in terms of API surface”. In other words, .NET Standard is not an implementation, but it is implemented by .NET concrete platforms. For example, .NET Core, he writes, implement the current .NET Standard version, 1.6, while he expects that .NET Core 1.2 will match very closely .NET Standard 2.0, which will be a strict superset of .NET Standard 1.6.

To help explain what .NET Standard 2.0 is, Strahl compares it to the core .NET Base Class Library (BCL) in its aim to provide core operating system, runtime and language services. Those include the basic type system, runtime loading and querying operations, network and file I/O, and some additional APIs like System.Data. Accordingly, application frameworks such as ASP.NET, WinForms, WPF, etc., are not part of .NET Standard but are built on top of it.

From the implementation point of view, .NET Standard takes a slightly different approach than classic .NET. Indeed, each platform-specific implementation of .NET Standard also provides a .NET Standard DLL that acts as a type forwarder. Applications only reference the type provider DLL, which in turn forwards the reference to the appropriate assembly providing the implementation. This is similar, in terms of user experience to .NET assemblies, but quite different for implementers, since they can provide separate independent packages instead of a single monolith, as is the case with .NET runtime packages.

.NET Standard 2.0 will more than double the .NET Standard 1.6 API surface, and it is expected to be available at the end of Q1 2017, with a preview release possibly available earlier.

Rate this Article