.NET Tips and Tricks

Blog archive

The New Cross-Platform Standard: Version 2.0

Microsoft has always had a plan to support cross-platform development using the .NET Framework. For the longest time, the plan was for you to create a Portable Class Library (PCL) -- any API you used from a PCL was supposed to work on any .NET supported platform.

If you did create a PCL project, you were given a list of platforms and asked to check off which ones you wanted to run on. After checking off your choices, what you could access in your library was the intersection of the .NET Framework APIs supported on each of those platforms. Fundamentally, that meant the more platforms you checked off, the less of the .NET Framework you got to use (in fact, some combinations would take out whole versions of Visual Studio).

The process wasn't dynamic, however. In reality, what you were picking was one of a set of predefined profiles that combined various .NET Framework APIs.

Microsoft has a new approach: Standard Class Library projects. A Standard Class Library consists of those APIs that "are intended to be available on all .NET implementations." The news here is that there is only one Standard and it supports all the .NET platforms -- no more profiles agglomerated into an arbitrary set of interfaces.

The catch here is that the Standard may not include something you want ... at least, not yet. With PCLs there was always the possibility that, if you dropped one of the platforms you wanted to support, you might pick up the API you wanted. That's not an option with the Standard, which is monolithic. In some ways it's like setting the version of the .NET Framework you want to support in your project's properties: The lower the version you pick, the less functionality you have.

Obviously, then, what matters in the .NET Standard is comprehensiveness. There have been several iterations of the .NET Standard specification, each of which includes more .NET Framework APIs. The latest version (as of June, 2018) is .NET Standard 2.0 and (like version 1.3 before it) it's a real watershed in terms of adding common functionality -- more than 5,000 APIs. With version 2.0 there's a very high likelihood that what you want to use is in the Standard.

You can check out the whole list here. The page also includes links to a list of namespaces and APIs added in any version of the .NET Standard. It's telling that the API list for version 2.0 is too big to display in anything but its raw format.

Posted by Peter Vogel on 06/26/2018


comments powered by Disqus

Featured

  • IDE Irony: Coding Errors Cause 'Critical' Vulnerability in Visual Studio

    In a larger-than-normal Patch Tuesday, Microsoft warned of a "critical" vulnerability in Visual Studio that should be fixed immediately if automatic patching isn't enabled, ironically caused by coding errors.

  • Building Blazor Applications

    A trio of Blazor experts will conduct a full-day workshop for devs to learn everything about the tech a a March developer conference in Las Vegas keynoted by Microsoft execs and featuring many Microsoft devs.

  • Gradient Boosting Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the gradient boosting regression technique, where the goal is to predict a single numeric value. Compared to existing library implementations of gradient boosting regression, a from-scratch implementation allows much easier customization and integration with other .NET systems.

  • Microsoft Execs to Tackle AI and Cloud in Dev Conference Keynotes

    AI unsurprisingly is all over keynotes that Microsoft execs will helm to kick off the Visual Studio Live! developer conference in Las Vegas, March 10-14, which the company described as "a must-attend event."

  • Copilot Agentic AI Dev Environment Opens Up to All

    Microsoft removed waitlist restrictions for some of its most advanced GenAI tech, Copilot Workspace, recently made available as a technical preview.

Subscribe on YouTube