Click here to Skip to main content
15,867,990 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
For versioning an executable, we have added a PowerShell script that updates the AssemblyInfo.cs file with the required version. We generate a version based on the changeset number. The format looks below :

[assembly: AssemblyVersion("3.0.8745.0")]
[assembly: AssemblyFileVersion("3.0.8745.0")]


This versioning happens before compilation.

We have below MSBUILD arguments :

/t:$(Target);Publish /p:SignManifests=true /p:BootstrapperEnabled=false /p:IsWebBootstrapper=true /p:UpdateEnabled=true /p:Prefer32bit=false /p:InstallURL="http://localhost/" /p:PublishDir="$(build.artifactstagingdirectory)\$(ClientArtifact)\Publish\\" /p:OutputPath="$(build.artifactstagingdirectory)\$(ClientArtifact)\Output" /p:ProductName=$(AppName) /p:ApplicationVersion="3.0.0.$(Build.SourceVersion)" /p:CreateWebPageOnPublish=false /v:minimal


but after compilation version is applied to exe in
PublishDir
but not the exe in
OutputPath


Any Idea why is it happening and how to resolve this.

What I have tried:

I couldn't figure it out the issue, I planned to use AssemblyInfoTask but the version we generate is from a PowerShell script function.
Posted
Comments
[no name] 4-Jun-22 9:58am    
The "versioning happens AFTER compilation" ... What does that mean? AssemblyInfo.cs is a "source" file. How do you expect it to take effect? (without compiling / building)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900