title: How do I get AssemblyVersion stamped as FileVersion on the binary
body: <p>I am using the Roslyn feature of <a href="https://github.com/dotnet/roslyn/blob/916b15dbf6b7ef1b33391d5252a4905aacb6f488/src/Compilers/Core/Portable/VersionHelper.cs#L176" rel="noreferrer">generating version number from current date/time</a>.</p>
  
  <p>I can see the auto generated date/time based version number gets stamped correctly as AssemblyVersion, and I can read it at runtime using API. </p>
  
  <p>Question: How do I get the same auto generated date time based version number stamped as <a href="https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.fileversioninfo.fileversion?view=netframework-4.8" rel="noreferrer">file version</a>, such that i can right click on the assembly in windows explorer and see the "File Version" under Details tab</p>
  
  <p>I see when i explicitly tag the version number (say 1.2.3.4) it works fine, but not with the auto generated one</p>
  
  <p>I am not using AssemblyInfo.cs and would like attributes set in .csproj</p>
  
  <p><a href="https://i.stack.imgur.com/dLHaI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/dLHaI.png" alt="enter image description here"></a></p>
  
  <p>I am using dotnet cli to build using below csproj for example:</p>
  
  <pre><code>&lt;Project Sdk="Microsoft.NET.Sdk.WindowsDesktop"&gt;
    &lt;PropertyGroup&gt;
      &lt;OutputType&gt;WinExe&lt;/OutputType&gt;
      &lt;TargetFramework&gt;netcoreapp3.1&lt;/TargetFramework&gt;
      &lt;UseWindowsForms&gt;true&lt;/UseWindowsForms&gt;
      &lt;AssemblyVersion&gt;1.0.*&lt;/AssemblyVersion&gt;
      &lt;FileVersion&gt;1.0.*&lt;/FileVersion&gt;
      &lt;Deterministic&gt;false&lt;/Deterministic&gt;
      &lt;PackageId&gt;Demo&lt;/PackageId&gt;
      &lt;Company&gt;My Company&lt;/Company&gt;
      &lt;Copyright&gt;Copyright © Xyzzy 2020&lt;/Copyright&gt;
      &lt;Description&gt;Description&lt;/Description&gt;
      &lt;GeneratePackageOnBuild&gt;true&lt;/GeneratePackageOnBuild&gt;
      &lt;GenerateAssemblyInfo&gt;true&lt;/GenerateAssemblyInfo&gt;
      &lt;GenerateAssemblyFileVersionAttribute&gt;true&lt;/GenerateAssemblyFileVersionAttribute&gt;
      &lt;GenerateAssemblyTitleAttribute&gt;true&lt;/GenerateAssemblyTitleAttribute&gt;
      &lt;GenerateAssemblyConfigurationAttribute&gt;true&lt;/GenerateAssemblyConfigurationAttribute&gt;
      &lt;GenerateAssemblyCompanyAttribute&gt;true&lt;/GenerateAssemblyCompanyAttribute&gt;
      &lt;GenerateAssemblyProductAttribute&gt;true&lt;/GenerateAssemblyProductAttribute&gt;
      &lt;GenerateAssemblyCopyrightAttribute&gt;true&lt;/GenerateAssemblyCopyrightAttribute&gt;
      &lt;GenerateAssemblyVersionAttribute&gt;true&lt;/GenerateAssemblyVersionAttribute&gt;
      &lt;GenerateAssemblyInformationalVersionAttribute&gt;true&lt;/GenerateAssemblyInformationalVersionAttribute&gt;
    &lt;/PropertyGroup&gt;
  &lt;/Project&gt;
  </code></pre>