<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Loïc Sharma</title>
    <description>The latest articles on DEV Community by Loïc Sharma (@loicsharma).</description>
    <link>https://dev.to/loicsharma</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F221376%2F2cb99655-59c9-4f13-8cff-d5ebb33f0489.jpeg</url>
      <title>DEV Community: Loïc Sharma</title>
      <link>https://dev.to/loicsharma</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/loicsharma"/>
    <language>en</language>
    <item>
      <title>How NuGet Works</title>
      <dc:creator>Loïc Sharma</dc:creator>
      <pubDate>Sun, 07 Jun 2020 19:51:11 +0000</pubDate>
      <link>https://dev.to/loicsharma/the-nuget-protocol-4m8h</link>
      <guid>https://dev.to/loicsharma/the-nuget-protocol-4m8h</guid>
      <description>&lt;p&gt;Ever wondered how package managers work?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/nuget/what-is-nuget" rel="noopener noreferrer"&gt;NuGet&lt;/a&gt; is the package manager for the .NET ecosystem that has served billions of downloads worldwide. Let's take a look under the hood and see what happens when you install a package on Visual Studio.&lt;/p&gt;

&lt;h1&gt;
  
  
  Table of contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Package Source&lt;/li&gt;
&lt;li&gt;Discover packages&lt;/li&gt;
&lt;li&gt;Inspect package details&lt;/li&gt;
&lt;li&gt;Install packages&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Package Source
&lt;/h1&gt;

&lt;p&gt;If you open Visual Studio's options, you'll see the following under the &lt;code&gt;Package Sources&lt;/code&gt; section:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx21zcf6gv2a7040sclid.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fx21zcf6gv2a7040sclid.png" alt="Visual Studio package sources"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visual Studio uses this package source to discover and download packages. The default source is &lt;a href="https://www.nuget.org/" rel="noopener noreferrer"&gt;nuget.org&lt;/a&gt;, which has the following package source URL: &lt;a href="https://api.nuget.org/v3/index.json" rel="noopener noreferrer"&gt;&lt;code&gt;https://api.nuget.org/v3/index.json&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you open that URL in your browser, you'll see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3.0.0"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"resources"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"@id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://azuresearch-usnc.nuget.org/query"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"@type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"SearchQueryService"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"comment"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Query endpoint of NuGet Search service (primary)"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is the &lt;a href="https://docs.microsoft.com/en-us/nuget/api/service-index" rel="noopener noreferrer"&gt;service index&lt;/a&gt;, which lists all the resources that the server supports. Each resource has the following properties:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;@type&lt;/code&gt; - Used to identify the resource&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;@id&lt;/code&gt; - The resource's URL&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, the &lt;a href="https://docs.microsoft.com/en-us/nuget/api/search-query-service-resource" rel="noopener noreferrer"&gt;search resource&lt;/a&gt; used to discover packages has the type &lt;code&gt;SearchQueryService&lt;/code&gt; and can be found at the URL &lt;code&gt;https://azuresearch-usnc.nuget.org/query&lt;/code&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠ Don't hard-code &lt;code&gt;azuresearch-usnc.nuget.org&lt;/code&gt; in your app! NuGet servers can move their resources at any time - you should always discover resource URLs using the &lt;a href="https://docs.microsoft.com/en-us/nuget/api/service-index" rel="noopener noreferrer"&gt;service index&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;
  
  
  Discover packages
&lt;/h1&gt;

&lt;p&gt;You can use Visual Studio's Package Manager UI to find packages:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftjzd2coo7n64t9pynfin.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Ftjzd2coo7n64t9pynfin.gif" alt="Visual Studio's package manager search"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is powered by the source's &lt;a href="https://docs.microsoft.com/en-us/nuget/api/search-query-service-resource" rel="noopener noreferrer"&gt;search resource&lt;/a&gt;. If you search for &lt;code&gt;json&lt;/code&gt;, this will trigger the following request: &lt;a&gt;&lt;code&gt;https://azuresearch-usnc.nuget.org/query?includePrerelease=true&amp;amp;semVerLevel=2.0.0&amp;amp;q=json&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you open that URL in your browser, you'll see:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"totalHits"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;3818&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"data"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Newtonsoft.Json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"12.0.3"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Json.NET is a popular high-performance JSON"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"totalDownloads"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;506643420&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This is the metadata for the latest version of each package relevant to &lt;code&gt;json&lt;/code&gt;.&lt;/p&gt;
&lt;h1&gt;
  
  
  Inspect package details
&lt;/h1&gt;

&lt;p&gt;Now that you've discovered some packages, you can select one to view more details:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7l1vhute1qdkccrua19e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7l1vhute1qdkccrua19e.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is powered by the &lt;a href="https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource" rel="noopener noreferrer"&gt;package metadata resource&lt;/a&gt;. For example, you can find the package metadata for the package &lt;code&gt;Newtonsoft.Json&lt;/code&gt; at this URL: &lt;a href="https://api.nuget.org/v3/registration5-gz-semver2/newtonsoft.json/index.json" rel="noopener noreferrer"&gt;&lt;code&gt;https://api.nuget.org/v3/registration5-gz-semver2/newtonsoft.json/index.json&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you open that URL in your browser, you'll see:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"items"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"catalogEntry"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"id"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Newtonsoft.Json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"version"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"3.5.8"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"description"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"Json.NET is a popular high-performance JSON framework for .NET"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"packageContent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.nuget.org/v3-flatcontainer/newtonsoft.json/3.5.8/newtonsoft.json.3.5.8.nupkg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="nl"&gt;"packageContent"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"https://api.nuget.org/v3-flatcontainer/newtonsoft.json/3.5.8/newtonsoft.json.3.5.8.nupkg"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;},&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This resource contains the metadata for &lt;em&gt;all&lt;/em&gt; versions of &lt;code&gt;Newtonsoft.Json&lt;/code&gt;.&lt;/p&gt;
&lt;h1&gt;
  
  
  Install packages
&lt;/h1&gt;

&lt;p&gt;If you press the &lt;code&gt;Install&lt;/code&gt; button for the package &lt;code&gt;Microsoft.Extension.Logging&lt;/code&gt;, this will kick off the following chain reaction:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Download the package&lt;/li&gt;
&lt;li&gt;Inspect the package's dependencies&lt;/li&gt;
&lt;li&gt;For each dependency, find the best version of that dependency to install and repeat steps 1-3&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;All of this is powered by the &lt;a href="https://docs.microsoft.com/en-us/nuget/api/package-base-address-resource" rel="noopener noreferrer"&gt;package content resource&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Download the package
&lt;/h3&gt;

&lt;p&gt;NuGet will download the package using this URL: &lt;a href="http://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging/3.1.4/microsoft.extensions.logging.3.1.4.nupkg" rel="noopener noreferrer"&gt;&lt;code&gt;http://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging/3.1.4/microsoft.extensions.logging.3.1.4.nupkg&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  For each dependency, find the best version to install
&lt;/h3&gt;

&lt;p&gt;A package can depend on other packages, and these dependencies can themselves have their own dependencies. As a result, NuGet needs to build a graph of all the dependencies using its &lt;a href="https://docs.microsoft.com/en-us/nuget/concepts/dependency-resolution" rel="noopener noreferrer"&gt;dependency resolution algorithm&lt;/a&gt;. To do this, NuGet needs to know the list of versions for each dependency.&lt;/p&gt;

&lt;p&gt;For example, the package &lt;a href="https://www.nuget.org/packages/Microsoft.Extensions.Logging" rel="noopener noreferrer"&gt;&lt;code&gt;Microsoft.Extensions.Logging&lt;/code&gt;&lt;/a&gt; depends on &lt;a href="https://www.nuget.org/packages/Microsoft.Extensions.Logging.Abstractions/" rel="noopener noreferrer"&gt;&lt;code&gt;Microsoft.Extensions.Logging.Abstractions&lt;/code&gt;&lt;/a&gt;, so NuGet will lookup versions here: &lt;a href="https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging.abstractions/index.json" rel="noopener noreferrer"&gt;&lt;code&gt;https://api.nuget.org/v3-flatcontainer/microsoft.extensions.logging.abstractions/index.json&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;If you open that in your browser, you'll see:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"versions"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0-rc1-final"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"1.0.0-rc2-final"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="err"&gt;...&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="s2"&gt;"3.1.4"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;These are all the versions of the &lt;code&gt;Microsoft.Extensions.Logging.Abstractions&lt;/code&gt; package. NuGet will choose one of these to install.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠ The NuGet client could use the &lt;a href="https://docs.microsoft.com/en-us/nuget/api/registration-base-url-resource" rel="noopener noreferrer"&gt;package metadata resource&lt;/a&gt; from the previous section to find packages' versions. However, performance is critical here! This endpoint returns just the right information to install the right package.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;Congratulations, you've learned how the NuGet protocol works! If you want even more information, I recommend the following resources:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://docs.microsoft.com/en-us/nuget/api/overview" rel="noopener noreferrer"&gt;NuGet's protocol documentation&lt;/a&gt; - This is the definitive guide on the NuGet API&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.microsoft.com/en-us/nuget/reference/nuget-client-sdk" rel="noopener noreferrer"&gt;NuGet's client SDK&lt;/a&gt; - Use this to write an app that interacts with NuGet servers&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you want to run your own NuGet server, check out my side project on GitHub! 😇&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/loic-sharma" rel="noopener noreferrer"&gt;
        loic-sharma
      &lt;/a&gt; / &lt;a href="https://github.com/loic-sharma/BaGet" rel="noopener noreferrer"&gt;
        BaGet
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A lightweight NuGet and symbol server
    &lt;/h3&gt;
  &lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;In future posts, I'll deep dive into nuget.org's implementation of the NuGet protocol, so stay tuned! Feel free to comment if you have any feedback or questions!&lt;/p&gt;

</description>
      <category>dotnet</category>
      <category>nuget</category>
    </item>
  </channel>
</rss>
