title: Azure Devops yaml dotnet core build /p:Version=1.2.3 always defaults to the version in csproj
body: <p>I'm trying to build a dotnet core application via Azure DevOps. I want my assemblies to be versioned with the build number.</p>
  
  <p>In .csproj file:</p>
  
  <pre><code>&lt;PropertyGroup&gt;
    &lt;TargetFramework&gt;netcoreapp2.2&lt;/TargetFramework&gt;
    &lt;AspNetCoreHostingModel&gt;InProcess&lt;/AspNetCoreHostingModel&gt;
    &lt;Version&gt;0.0.1&lt;/Version&gt;
  &lt;/PropertyGroup&gt;
  </code></pre>
  
  <p>The yaml build pipeline contains:</p>
  
  <pre><code>trigger:
    branches:
     include:
       - master
  
  pool:
    name: 'Hosted Windows 2019 with VS2019'
    #vmImage: 'ubuntu-latest'
  
  variables:
    buildConfiguration: 'Release'
    Version.Revision: $[counter(format('{0:yyyyMMdd}', pipeline.startTime), 0)]
    VersionMajor: 0
    VersionMinor: 1
  
  
  name: '$(VersionMajor).$(VersionMinor).$(Date:yy)$(DayOfYear).$(Version.Revision)'
  
  steps:
  - task: DotNetCoreInstaller@0
    inputs:
      version: '2.2.300'
  
  - script: dotnet build --configuration Release /p:Version=$(Build.BuildNumber)
    displayName: 'dotnet build $(buildConfiguration) $(Build.BuildNumber)'
  </code></pre>
  
  <p>In the Azure Devops build log the command seems to pick up the correct version:</p>
  
  <pre><code>dotnet build --configuration Release /p:Version=0.1.19185.10
  </code></pre>
  
  <p>But when I download the artifacts and verify the dlls they still contain version number 0.0.1</p>
  
  <p>Executing this command locally does add the version number in the dll. So, why is the version not added via Azure DevOps?</p>