title: Set Assembly version of net core app using Azure DevOps with a DockerFile
body: <p>I am using a DockerFile created by visual studio to create my image. I want to build with Azure DevOps and set my assemblies version inside the image the version I have in the Pipeline. I feel that I have to change this line but I dont known how.</p>
  <pre><code>    RUN dotnet build &quot;ImportBatch.Api.csproj&quot; -c Release -o /app/build
  </code></pre>
  <p>My DockerFile</p>
  <pre><code>#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
  
  FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base
  WORKDIR /app
  EXPOSE 80
  EXPOSE 443
  
  FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
  WORKDIR /src
  COPY [&quot;ImportBatch.Api/ImportBatch.Api.csproj&quot;, &quot;ImportBatch.Api/&quot;]
  COPY [&quot;ImportBach.Dto/ImportBatch.Dto.csproj&quot;, &quot;ImportBach.Dto/&quot;]
  COPY [&quot;Common/Common.csproj&quot;, &quot;Common/&quot;]
  COPY [&quot;Common.Dto/Common.Dto.csproj&quot;, &quot;Common.Dto/&quot;]
  COPY [&quot;Common.Azure.Storage/Common.Azure.Storage.csproj&quot;, &quot;Common.Azure.Storage/&quot;]
  RUN dotnet restore &quot;ImportBatch.Api/ImportBatch.Api.csproj&quot;
  COPY . .
  WORKDIR &quot;/src/ImportBatch.Api&quot;
  RUN dotnet build &quot;ImportBatch.Api.csproj&quot; -c Release -o /app/build
  
  FROM build AS publish
  RUN dotnet publish &quot;ImportBatch.Api.csproj&quot; -c Release -o /app/publish
  
  FROM base AS final
  WORKDIR /app
  COPY --from=publish /app/publish .
  ENTRYPOINT [&quot;dotnet&quot;, &quot;Cardinal.Software.ImportBatch.Api.dll&quot;]
  </code></pre>