.Net Standard 2.1 roadmap: The new features you can expect

Thousands of APIs will be added, including the Span type to represent memory

.Net Standard 2.1 roadmap: The new features you can expect
Getty Images

.Net Standard 2.1, the next version of a set of standard APIs for all .Net implementations, will add about 3,000 APIs. The .Net Standard specification has been an attempt to prevent fragmentation of .Net and to provide for code-sharing. 

While the definition of Version 2.1 remains a work in progress, Microsoft revealed that many of the planned APIs are new while others were existing ones were added to help further converge .Net implementations.

Highlighting .Net Standard Version 2.1 is the addition of Span<T>, which is considered critical to most performance improvements in .Net Core 2.1. Span<T> provides an array-like type to represent managed and unmanaged memory in a uniform way. Also, it supports slicing without copying and enables more efficient management of buffers.

Other capabilities in .Net Standard 2.1 include:

  • SIMD (single instruction, multiple data), which has been supported in .Net Core and .Net Framework. It has been used to speed operations in the BCL (base class library), such as string comparisons. There have been requests to expose these APIs in .Net Standard, because the functionality requires runtime support and cannot be meaningfully provided as a NuGet package.
  • Foundational-APIs that work with spans.
  • DbProviderFactory, which lets libraries and applications use a specific ADO.Net provider without knowing its specific types at compile time, by selecting among DbProviderFactory instances based on a name that can be read from configuration settings, for example.
  • Reflection emit, a dynamic feature in the .Net ecosystem intended to boost productivity. It is included along with lightweight code generation. Attempts had been made to include it as a NuGet package but this core technology could not be modeled via a package.

.Net Core 3.0 and upcoming versions of Mono, Xamarin, and Unity will be updated to .Net Standard 2.1. Microsoft said many API additions in .Net Standard 2.1 need runtime changes to be meaningful, so .Net Framework 4.8 will stay on .Net Standard 2.0. Also, library authors who need to .Net Framework customers are advised to stay with .Net Standard 2.0, because the API additions are largely for advanced scenarios. But library authors can take advantage of APIs by using multitargeting to compile for both .Net Standard Version 2.0 and .Net Standard Version2.1.

Copyright © 2018 IDG Communications, Inc.