News

Microsoft's Adam Tuliper on the .NET Standard and Porting Your .NET Code

Microsoft Principal Software Engineer Adam Tuliper explains the .NET Standard, a formal specification of .NET APIs that are intended to be available on all .NET implementations in order to establish greater uniformity in the .NET ecosystem.

Creating .NET code that runs across the various .NET platforms is challenging on many levels, complicated by the need to accommodate many different runtimes and versions. For example, how do developers move code between Unity, Xamarin, .NET Core, .NET Framework, UWP or other .NET platforms? To answer those questions and more, Adam Tuliper, a principal software engineer at Microsoft, will present a session at the upcoming Visual Studio Live! Boston conference titled "Getting to the Core of the .NET Standard." Here, he offers more information on how .NET Standard makes targeting multiple platforms much easier than ever before.

Why was the .NET Standard created?
Creating portable code was difficult at times. With profile-based Portable Class Libraries (PCLs), you had to know the platforms ahead of time. The .NET Standard makes it easier for developers to create reusable code.

What is important for developers to understand about how the .NET standard is built and how it is versioned?
In order to understand how the .NET standard works, it is important to know how it is versioned. For example, the .NET Standard, for all intents, tries to be completely forward-compatible to ensure old code continues to work. It is also important to understand what new APIs are supported. We have several ways of looking this up, through the API Browser but also directly in the .NET Standard definition.

"Microsoft goes through great lengths to ensure the APIs supported are worthwhile. Creating an API is easy. Creating an API that is relevant years from now takes a lot more thought."

Adam Tuliper, Principal Software Engineer, Microsoft

Microsoft goes through great lengths to ensure the APIs supported are worthwhile. Creating an API is easy. Creating an API that is relevant years from now takes a lot more thought.

What are the top 3 benefits that developers can expect to get out of transitioning to using the .NET Standard?
The top three benefits are:

  1. Blissful ignorance of the future platforms your code may run on -- you don't necessarily need to care now.
  2. Immediate code sharing across your .NET platforms (.NET Framework, .NET Core projects, Unity, UWP, Xamarin and more!)
  3. Simplified development experience in creating a class library compared to profile-based PCLs. Simply create a project and target a .NET Standard version; there's no need worry about choosing platforms or installing targets.

What are the most important steps that developers need to take to make their code portable under the .NET Standard?
The process is pretty easy. If it's new code, simply developing with a .NET Standard Library project type will keep you within constraints. If you are unfamiliar with what APIs are supported, they can be viewed in the .NET Standard specification. For existing code, you can run the API Portability Analyzer.

What's another interesting feature about the .NET Standard?
The type forwarding that happens behind the scenes is a fascinating process. It enables, for example, a DataSet to exist in difference assemblies (like System.Data in .NET Framework and System.Data.Common in .NET Core) and be able to resolve to the correct location at run time.

What else should developers know about this topic?
The .NET Standard is a fairly simple concept, don't overcomplicate it. It's essentially a contract that the compiler enforces for a set of APIs to deem your library a .NET Standard library. There's a bit more to the process, but in a nutshell that's the idea.

About the Author

Becky Nagel serves as vice president of AI for 1105 Media specializing in developing media, events and training for companies around AI and generative AI technology. She also regularly writes and reports on AI news, and is the founding editor of PureAI.com. She's the author of "ChatGPT Prompt 101 Guide for Business Users" and other popular AI resources with a real-world business perspective. She regularly speaks, writes and develops content around AI, generative AI and other business tech. She has a background in Web technology and B2B enterprise technology journalism.

comments powered by Disqus

Featured

  • GitHub Previews Agentic AI in VS Code Copilot

    GitHub announced a raft of improvements to its Copilot AI in the Visual Studio Code editor, including a new "agent mode" in preview that lets developers use the AI technology to write code faster and more accurately.

  • Copilot Engineering in the Cloud with Azure and GitHub

    Who better to lead a full-day deep dive into this tech than two experts from GitHub, which introduced the original "AI pair programmer" and spawned the ubiquitous Copilot moniker?

  • Uno Platform Wants Microsoft to Improve .NET WebAssembly in Two Ways

    Uno Platform, a third-party dev tooling specialist that caters to .NET developers, published a report on the state of WebAssembly, addressing some shortcomings in the .NET implementation it would like to see Microsoft address.

  • Random Neighborhoods Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the random neighborhoods regression technique, where the goal is to predict a single numeric value. Compared to other ML regression techniques, advantages are that it can handle both large and small datasets, and the results are highly interpretable.

  • As Some Orgs Restrict DeepSeek AI Usage, Microsoft Offers Models and Dev Guidance

    While some organizations are restricting employee usage of the new open source DeepSeek AI from a Chinese company due to data collection concerns, Microsoft has taken a different approach.

Subscribe on YouTube

Upcoming Training Events