{"id":24036,"date":"2019-08-07T11:01:39","date_gmt":"2019-08-07T18:01:39","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=24036"},"modified":"2019-08-07T13:29:39","modified_gmt":"2019-08-07T20:29:39","slug":"update-on-net-standard-adoption","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/update-on-net-standard-adoption\/","title":{"rendered":"Update on .NET Standard adoption"},"content":{"rendered":"<p>It&#8217;s about two years ago that <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-standard-2-0\/\">I announced .NET Standard 2.0<\/a>. Since then we&#8217;ve been working hard to increase the set of .NET Standard-based libraries for .NET. This includes many of the BCL components, such as the <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-the-windows-compatibility-pack-for-net-core\/\">Windows Compatibility Pack<\/a>, but also other popular libraries, such as the JSON.NET, the Azure SDK, or the AWS SDK. In this blog post, I&#8217;ll share some thoughts and numbers about the .NET ecosystem and .NET Standard.<\/p>\n<h2 id=\"adoption-by-the-numbers\">Adoption by the numbers<\/h2>\n<p>In order to track adoption, we&#8217;re looking at <a href=\"https:\/\/nuget.org\">nuget.org<\/a>. On a regular interval, we check whether new package versions add support for .NET Standard. Once a package ID does, we stopped looking at future versions. This allows us to track when a package first adopted .NET Standard.<\/p>\n<p>For the purposes of measuring adoption in the ecosystem, we&#8217;ve excluded all packages that represent the .NET platform (e.g. <code>System.*<\/code>) or were built by Microsoft, e.g. <code>Microsoft.Azure.*<\/code>. Of course, we track that too, but as part of pushing first parties to adopt .NET Standard.<\/p>\n<p>This is what the adoption looks like:<\/p>\n<ul>\n<li>On <a href=\"https:\/\/nuget.org\">nuget.org<\/a>:\n<ul>\n<li><strong>47% of the top one thousand packages<\/strong> support .NET Standard<\/li>\n<li><strong>30% of all packages<\/strong> support .NET Standard (about 48k out of 160k packages)<\/li>\n<\/ul>\n<\/li>\n<li>Generously adding trendlines, we could expect ~100% by around 2022\n<ul>\n<li>Trendlines border on using a magic 8 ball, so take these figures with a big jar of salt.<\/li>\n<li>We&#8217;ll likely never get to a 100% but it seems to suggest that we can expect maximum reach within the next two to three years, which seems realistic and is in line with our expectations.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-24039\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-top1k.png\" alt=\"\" width=\"500\" height=\"281\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-top1k.png 2000w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-top1k-300x169.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-top1k-768x432.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-top1k-1024x576.png 1024w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-24038\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-all.png\" alt=\"\" width=\"500\" height=\"281\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-all.png 2000w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-all-300x169.png 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-all-768x432.png 768w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/08\/chart-all-1024x576.png 1024w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/p>\n<h2 id=\"what-should-i-do\">What should I do?<\/h2>\n<p>With few exceptions, all libraries should be targeting .NET Standard. Exceptions include UI-only libraries (e.g. a WinForms control) or libraries that are just as building blocks inside of a single application.<\/p>\n<p>In order to decide the version number, you can use the <a href=\"https:\/\/dotnet.microsoft.com\/platform\/dotnet-standard#versions\">interactive version picker<\/a>. But when in doubt, just start with .NET Standard 2.0. Even when .NET Standard 2.1 will be released later this year, most libraries should still be on .NET Standard 2.0. That&#8217;s because most libraries won&#8217;t need the API additions and <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-standard-2-1\/\">.NET Framework will never be updated to support .NET Standard 2.1 or higher<\/a>.<\/p>\n<p>This recommendation is also reflected in the <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/guidance-for-library-authors\/\">.NET library guidance<\/a> we published earlier (taken from the <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/standard\/library-guidance\/cross-platform-targeting\">cross-platform targeting<\/a> section):<\/p>\n<blockquote><p><strong>\u2714\ufe0f DO<\/strong> start with including a <code>netstandard2.0<\/code> target.<\/p>\n<p>Most general-purpose libraries should not need APIs outside of .NET Standard 2.0. .NET Standard 2.0 is supported by all modern platforms and is the recommended way to support multiple platforms with one target.<\/p><\/blockquote>\n<p>There are some reasons why you may want to update to .NET Standard 2.1. The primary reasons would be:<\/p>\n<ul>\n<li>Wide support for <code>Span&lt;T&gt;<\/code>\n<ul>\n<li>We&#8217;ve added various new methods across the BCL to support span-based APIs for writing allocation free code<\/li>\n<\/ul>\n<\/li>\n<li>New language features\n<ul>\n<li><code>IAsyncEnumerable&lt;T&gt;<\/code><\/li>\n<li><code>Index<\/code> and <code>Range<\/code> expressions<\/li>\n<li><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/default-implementations-in-interfaces\/\">default interface methods<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2 id=\"summary\">Summary<\/h2>\n<p>.NET Standard adoption is already quite high, but it&#8217;s still growing. Please continue to update the packages you haven&#8217;t updated yet. And when creating new packages, continue to start with .NET Standard 2.0, even after .NET Standard 2.1 has shipped.<\/p>\n<p>Happy coding!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s about two years ago that I announced .NET Standard 2.0. Since then we&#8217;ve been working hard to increase the set of .NET Standard-based libraries for .NET. This includes many of the BCL components, such as the Windows Compatibility Pack, but also other popular libraries, such as the JSON.NET, the Azure SDK, or the AWS [&hellip;]<\/p>\n","protected":false},"author":335,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[4,9,11,43,104,107],"class_list":["post-24036","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","tag-net","tag-net-core","tag-net-framework","tag-bcl","tag-nuget","tag-open-source"],"acf":[],"blog_post_summary":"<p>It&#8217;s about two years ago that I announced .NET Standard 2.0. Since then we&#8217;ve been working hard to increase the set of .NET Standard-based libraries for .NET. This includes many of the BCL components, such as the Windows Compatibility Pack, but also other popular libraries, such as the JSON.NET, the Azure SDK, or the AWS [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/24036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/335"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=24036"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/24036\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=24036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=24036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=24036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}