{"id":2228,"date":"2022-02-15T13:20:44","date_gmt":"2022-02-15T21:20:44","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=2228"},"modified":"2022-02-15T13:20:44","modified_gmt":"2022-02-15T21:20:44","slug":"introducing-compatible-frameworks-on-nuget-org","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/introducing-compatible-frameworks-on-nuget-org\/","title":{"rendered":"Introducing Compatible Packages on NuGet.org"},"content":{"rendered":"<p>As part of our ongoing commitment to <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/state-of-the-nuget-ecosystem\/\">improve the NuGet ecosystem<\/a>, today we are excited to introduce a couple new features on NuGet.org to help you determine if a package is compatible with the target frameworks you know and love. This is how it looks:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_15-03-01-1.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_15-03-01-1-547x350.png\" alt=\"Image 2022 02 15 15 03 01\" width=\"547\" height=\"350\" class=\"aligncenter size-medium wp-image-2275\" \/><\/a><\/p>\n<p>You will now have a new <strong>&#8220;Frameworks&#8221;<\/strong> tab on any package details page.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_13-54-18-1.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_13-54-18-1-560x52.png\" alt=\"Image 2022 02 15 13 54 18\" width=\"560\" height=\"52\" class=\"aligncenter size-medium wp-image-2270\" \/><\/a><\/p>\n<p>This will give you a table of all provided assets based on the .NET product and version. In addition to compatible target framework assets, we also compute target frameworks that will be compatible given the current assets provided.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_15-07-32-1.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_15-07-32-1-399x350.png\" alt=\"Image 2022 02 15 15 07 32\" width=\"399\" height=\"350\" class=\"aligncenter size-medium wp-image-2279\" \/><\/a><\/p>\n<p>In addition, you&#8217;ll now see <strong>target framework badges<\/strong> at the top of the package details page to understand at a glance what products and minimum version of .NET the package provides assets for.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_15-08-39-1.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_15-08-39-1.png\" alt=\"Image 2022 02 15 15 08 39\" width=\"462\" height=\"41\" class=\"aligncenter size-full wp-image-2281\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_15-08-39-1.png 462w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/02\/2022-02-15_15-08-39-1-300x27.png 300w\" sizes=\"(max-width: 462px) 100vw, 462px\" \/><\/a><\/p>\n<h2>What&#8217;s the Difference?<\/h2>\n<p>For newer members of the .NET family, there&#8217;s quite a bit of confusion about .NET Framework, .NET Core, .NET Standard, and .NET. How do they differ from one another and what should you look out for when choosing a NuGet package that meets your project&#8217;s needs?<\/p>\n<p>As .NET 6 unified the platform for browser, cloud, desktop, IoT, and mobile apps, the NuGet package ecosystem is still diverse in supported target frameworks from each generation of .NET&#8217;s development. If you aren&#8217;t familiar with each major .NET release, here&#8217;s a table for your reference:<\/p>\n<table>\n<thead>\n<tr>\n<th>\n      <\/th>\n<th>\n        OS\n      <\/th>\n<th>\n        Open Source\n      <\/th>\n<th>\n        Purpose\n      <\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>\n        .NET Framework\n      <\/td>\n<td>\n        Windows\n      <\/td>\n<td>\n        No\n      <\/td>\n<td>\n        Used for building Windows desktop applications and ASP.NET Web apps running on IIS.\n      <\/td>\n<\/tr>\n<tr>\n<td>\n        .NET Core\n      <\/td>\n<td>\n        Windows, Linux, macOS\n      <\/td>\n<td>\n        Yes\n      <\/td>\n<td>\n        Used for building cross-platform console apps and ASP.NET Core Web apps and cloud services.\n      <\/td>\n<\/tr>\n<tr>\n<td>\n        Xamarin\n      <\/td>\n<td>\n        iOS, Android, macOS\n      <\/td>\n<td>\n        Yes\n      <\/td>\n<td>\n        Used for building mobile applications for iOS and Android, as well as desktop apps for macOS.\n      <\/td>\n<\/tr>\n<tr>\n<td>\n        .NET Standard\n      <\/td>\n<td>\n        N\/A\n      <\/td>\n<td>\n        Yes\n      <\/td>\n<td>\n        Used for building libraries that can be referenced from all .NET implementations, such as .NET Framework, .NET Core and Xamarin.\n      <\/td>\n<\/tr>\n<tr>\n<td>\n        .NET\n      <\/td>\n<td>\n        Windows, Linux, macOS, iOS, Android\n      <\/td>\n<td>\n        Yes\n      <\/td>\n<td>\n        Used for building cross-platform console apps, ASP.NET Core Web apps, cloud services, mobile applications, and more.\n      <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>NuGet and Target Frameworks<\/h2>\n<p>When you target a .NET framework in your app or library, you are specifying the set of .NET APIs that you&#8217;d like to make available to them. You do this through what is known as a target framework. Each target framework has it&#8217;s own unique moniker known as a target framework moniker(TFM), giving them an easy to remember short-form name.<\/p>\n<p>These TFMs tell NuGet what assets to select from the package to then be used within your project. If multiple sets of assets are available in a package under different frameworks, NuGet must choose between these frameworks with an order of precedence.<\/p>\n<p>For example, the preference of targeting .NET 6.0 \/ <code>net6.0<\/code> would be:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/01\/2022-01-14_10-53-11-1.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2022\/01\/2022-01-14_10-53-11-1-739x700.png\" alt=\"Image 2022 01 14 10 53 11\" width=\"640\" height=\"606\" class=\"aligncenter size-large wp-image-2234\" \/><\/a><\/p>\n<p>What this means is that if NuGet is unable to find assets with the respective short folder name that matches the TFM, it will continue down the order of precedence until there is a match.<\/p>\n<h2>Closing<\/h2>\n<p>We hope that this feature will help improve your productivity of discovering and consuming NuGet packages and would like to thank everyone who helped us deliver this feature from an <a href=\"https:\/\/github.com\/NuGet\/NuGetGallery\/issues\/4843\" rel=\"noopener\" target=\"_blank\">original concept on GitHub over 4 years ago<\/a> to today.<\/p>\n<p>This is just the beginning of our journey to improve NuGet and make your package compatibility experiences better than ever with the tools you know and love. Stay tuned for more exciting developments from our team to you in the near future. Till then.<\/p>\n<h2>Feedback<\/h2>\n<p>Since compatibility is a complicated area and we&#8217;re still learning, we need your feedback more than ever to ensure these features can meet your expectations. The best way to give us that feedback is a comment on this post and filing an issue on GitHub.<\/p>\n<p>Your feedback is important to us. If there are any problems with this feature, check our <a href=\"https:\/\/github.com\/NuGet\/NuGetGallery\/issues\">GitHub Issues<\/a>. For new issues within this experience, please <a href=\"https:\/\/github.com\/NuGet\/NuGetGallery\/issues\/new\/choose\">report a GitHub Issue<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As part of our ongoing commitment to improve the NuGet ecosystem, today we are excited to introduce a couple new features on NuGet.org to help you determine if a package is compatible with the target frameworks you know and love. This is how it looks: You will now have a new &#8220;Frameworks&#8221; tab on any [&hellip;]<\/p>\n","protected":false},"author":551,"featured_media":2275,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7933,7874,7931],"tags":[7965,7966,7967,7968],"class_list":["post-2228","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-feature-announcement","category-nuget","category-nuget-org","tag-package-compatibility","tag-target-framework","tag-target-framework-moniker","tag-tfm"],"acf":[],"blog_post_summary":"<p>As part of our ongoing commitment to improve the NuGet ecosystem, today we are excited to introduce a couple new features on NuGet.org to help you determine if a package is compatible with the target frameworks you know and love. This is how it looks: You will now have a new &#8220;Frameworks&#8221; tab on any [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/2228","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\/551"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=2228"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/2228\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/2275"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=2228"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=2228"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=2228"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}