0

I am beginner to A and just starting to work in it

What task I must add in project ASP.NET CORE to Azure DevOps Pipelines to pass the build number from the azure devops pipeline to the project code Client.Shell.csproj:

<MinimumRequiredVersion> 4.60.0825.700 </MinimumRequiredVersion>
<ApplicationRevision> 716 </ApplicationRevision>
<ApplicationVersion> 4.60.0825.% 2a </ApplicationVersion>

https://i.stack.imgur.com/BXyHm.png

2 Answers2

0

You can do something like this, Replace "1.2.3" with your build parameter.

dotnet publish ./MyProject.csproj /p:Version="1.2.3" /p:InformationalVersion="1.2.3-qa"

Look at this https://github.com/dotnet/docs/issues/7568

RubbleFord
  • 7,456
  • 9
  • 50
  • 80
0

When a pipeline runs, it usually performs get sources action first. So you just need to map the correct project path, then the pipeline will get entire project to the Agent's working folder.

To update the version in .csproj file, and to pass the build number from the azure devops pipeline, you can check Assembly Info extension, and use the variable $(Build.BuildNumber) in the version field.

This extension can update project AssemblyInfo files and .Net Core / .Net Standard project files .csproj. For detailed instructions on how to configure the extension please see the following link:

https://github.com/BMuuN/vsts-assemblyinfo-task/wiki/Versioning

If you want to update the file in repo, you still need to run git push command to push the changes to the repo.

Cece Dong - MSFT
  • 29,631
  • 1
  • 24
  • 39