title: How does the NuGet pack command generate the package version?
body: <p>NuGet version: 4.5.1.4879</p>
  <p>When using &quot;project-driven&quot; NuGet package building (i.e., passing the .csproj file to the <code>nuget pack</code> command), I thought I understood how NuGet will determine the version to use in the generated package. Specifically, that it will use <code>AssemblyInformationalVersion</code> if it exists in the AssemblyInfo, or <code>AssemblyVersion</code> if <code>AssemblyInformationalVersion</code> is not present.</p>
  <p>That seems to work as expected in some of my assemblies (I have a simple 1:1 relationship between assemblies and packages - 1 assembly produces 1 package of the same name), but not in others.</p>
  <p>In a problematic assembly, the AssemblyInfo includes this:</p>
  <pre><code>[assembly: AssemblyVersion(&quot;2.0.0.0&quot;)]
  [assembly: AssemblyFileVersion(&quot;2.0.0.0&quot;)]
  [assembly: AssemblyInformationalVersion(&quot;2.0.0&quot;)]
  </code></pre>
  <p>In the .csproj file I also have this, among other stuff (note the <code>&lt;Version&gt;</code> tag):</p>
  <pre><code>  &lt;PropertyGroup&gt;
      &lt;Configuration Condition=&quot; '$(Configuration)' == '' &quot;&gt;Debug&lt;/Configuration&gt;
      &lt;Platform Condition=&quot; '$(Platform)' == '' &quot;&gt;AnyCPU&lt;/Platform&gt;
      &lt;ProjectGuid&gt;{E233E8E2-EB9E-461F-80C2-63F9AFCC425D}&lt;/ProjectGuid&gt;
      &lt;OutputType&gt;Library&lt;/OutputType&gt;
      &lt;AppDesignerFolder&gt;Properties&lt;/AppDesignerFolder&gt;
      &lt;RootNamespace&gt;XYZ.Core.Messaging&lt;/RootNamespace&gt;
      &lt;AssemblyName&gt;XYZ.Core.Messaging&lt;/AssemblyName&gt;
      &lt;TargetFrameworkVersion&gt;v4.6.1&lt;/TargetFrameworkVersion&gt;
      &lt;FileAlignment&gt;512&lt;/FileAlignment&gt;
  
      &lt;Version&gt;2.0.0&lt;/Version&gt;
  
      &lt;NuGetPackageImportStamp&gt;
      &lt;/NuGetPackageImportStamp&gt;
      &lt;TargetFrameworkProfile /&gt;
    &lt;/PropertyGroup&gt;
  </code></pre>
  <p>BTW, I have no .nuspec file.</p>
  <p>Despite those settings, when I try to build the package, using this command:</p>
  <pre><code>nuget pack XYZ.Core.Messaging.csproj  -OutputDirectory &quot;c:\build\nuget-local&quot; -Suffix &quot;local&quot;
  </code></pre>
  <p>It builds the package as <code>XYZ.Core.Messaging.1.0.0-local.nupkg</code>.</p>
  <p>For some other packages I build with a similar command (just a different .csproj file), with the same AssemblyInfo contents, those build the package with version 2.0.0 correctly.</p>
  <p>So where could NuGet be getting the 1.0.0 version from?</p>