Deploy ClickOnce with MSBuild & # 8594; How to transfer the current build number for an application version or auto-increment

We have an Outlook add-in that uses ClickOnce deployment.

As soon as the developer checks the assembly, the computer queues for the assembly, and the application is published to a folder on the shared drive.

The problem is that the assembly does not change the publication version to the current version of the assembly, and therefore it is published in the folder of the previous version, which leads to damage to the installer, which says that the version cannot be installed.

I read this article . And I installed [assembly: AssemblyVersion ("1.0. *")]. Still nothing.

I figured out a way around this problem by expanding <ApplicationVersion></ApplicationVersion>* .csproj in the file. But I want it to be automated.

Another workaround was to execute msbuild.exe:

/target:publish   /property:PublishDir="\\sharedDir\\" /property:GenerateManifests=true
/property:ApplicationVersion=1.0.0.123

And yet it is not automated. I really would like to transfer the current assembly number either to the msbuild.exe file, or on each assembly to replace the value in <ApplicationVersion></ApplicationVersion>with the actual assembly number. Or is there another way?

+5
source share
2 answers

I faced the same problem as mine. I was able to solve using the code from your question as a base. Here are the steps you need to solve with TFS.

"" . MSBuildArguments . , :

// Note: You can use /p for /property and /t for /target

"/t:Publish /p:PublishDir=<PublishDirectory> /p:ApplicationVersion="
    + Date.Today.ToString("yyyy") + "."
    + Date.Today.ToString("MMdd") + "."
    + Date.Now.Hour.ToString() + "."
    + Date.Now.Minute.ToString()

, . , .

, :

<ApplicationName>_2013_0315_09_55

, , , , , , ClickOnce TFS.

+5

Hudson MSBuild, . . , assemlyinfo.cs , .

( , ), TFS - , enviornment, , , TFS 2010.

, :

, Mage, ClickOnce . Mage Exec MSBuild.

0

All Articles