title: NuGet Limit max major version of a package
body: <p>Is it possible to tell NuGet that you want to use the latest version of package <strong>with particular major version</strong> and never above this major version?</p>
  
  <p>For instance, let's take the example with jQuery: we can't use 2.x version if we need support of the old browsers. We're limited to use latest 1.x version.</p>
  
  <p>We know that the currently available (and offered by default in <strong>Manage Nuget Packages</strong> dialog) version of jQuery is 2.1.1. Rather than using this version, we need to use the currently latest major version of the jQuery 1.x branch, currently, 1.11.1.</p>
  
  <p>I know how to initially install the 1.11.1 version. One simple solution is to manually edit the packages.config file to replace the value of the <code>version</code> attribute with <code>1.11.1</code>:
  </p>
  
  <pre><code>&lt;packages&gt;
    &lt;package id="jQuery" version="1.11.1" targetFramework="net451" /&gt;
  &lt;/packages&gt;
  </code></pre>
  
  <p>and build the project.</p>
  
  <p>What I don't know is how to tell NuGet to keep track of releasing new versions of the 1.x branch to offer me updating to them the same way as it would do this when a new 2.x version is released:</p>
  
  <p><img src="https://i.stack.imgur.com/8gnQy.png" alt="How NuGet Add-In notifies of a new version of a package"></p>
  
  <p>By default, NuGet will always try to update to the latest 2.x version, not the latest 1.x.</p>
  
  <p><strong>In the other words, when using packages with old major versions, you need to manually check for releases and make NuGet installing them every time.</strong></p>
  
  <p>I've tried to use an asterisk in the package <code>version</code> attribute:
  </p>
  
  <pre><code>&lt;packages&gt;
    &lt;package id="Package1" version="1.*" targetFramework="net40" /&gt;
  &lt;/packages&gt;
  </code></pre>
  
  <p>But NuGet throws an exception:</p>
  
  <pre><code>NuGet Package restore failed for project Project1: System.IO.InvalidDataException: Unable to parse version value '1.*' from 'packages.config'.
     at NuGet.PackageReferenceFile.&lt;GetPackageReferences&gt;d__0.MoveNext()
     at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
     at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
     at NuGet.VsEvents.PackageRestorer.RestorePackages(String packageReferenceFileFullPath, IFileSystem fileSystem)
     at NuGet.VsEvents.PackageRestorer.PackageRestore(ProjectPackageReferenceFile projectPackageReferenceFile).
  </code></pre>
  
  <p>So, how do you achieve the above goal?</p>