Team Build & ClickOnce

Hi,

We are using the "SolutionToPublish" tag to build & create our ClickOnce application via Team Build.

It works fine but I've got a question:

The application publish version is not incremented via the Team Build process. How can this be done so that it is incremented on each Team Build?

Thanks,

Paril

[361 byte] By [ParilVadher] at [2007-12-22]
# 1

You will need to explicitly increment the version information using the property ApplicationRevision to get publish version updated. You can write a simple task to do this and add it to <BeforeCompile> target so that it is picked for publishing.

An example:

<Target Name="BeforeCompile">
<MyUpdatePublishVersion MyUpdateInformation="FooBar" />
<Output TaskParameter="Value" PropertyName="ApplicationRevision" />
</Target>

Thanks.

NagarajuPallaMSFT at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 2

Nagaraju,

I tried the approach you described. I created a custom task that updates the ApplicationRevision property. When I use the Message task to log the changed property I see that it actually changed. However, the publish version stays the same: 1.0.0.0. I checked the project file (*.vbproj) and noticed that there is no ApplicationRevision property defined and the ApplicationVersion property has the value "1.0.0.%2a". Any idea what is going on?

I used the following target node:

<Target Name="BeforeCompile">

<Message Text="Pre: Application Version: $(ApplicationRevision)"/>

<MSBuildCustomTasks.IncreasePublishVersion>

<Output TaskParameter="CurrentVersion" PropertyName="ApplicationRevision" />

</MSBuildCustomTasks.IncreasePublishVersion>

<Message Text="Post: Application Revision: $(ApplicationRevision)"/>

</Target>

Thanks,

Erick

IdahoErick at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 3
I tried the custom task fix and I'm getting no new results on the output. I verified that $(ApplicationRevision) is incrementing each time by outputting a message but it appears that the property is not being used during publishing.

Unless I set the value of Application Revision it always shows up as blank in the BeforeCompile target. Is there some other time (other than BeforeCompile) that I should be running this task or is there a different property that could affect the output publish version?

JohnBowen at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 4
I tried this and was frustrated for a long time with it not working. I finally figured out a key detail not mentioned with this: The custom task needs to be called in the application project file not in the Team Build file.

After moving the target with the custom task from TFSBuild.proj into the App.proj file it started working as stated right away.

JohnBowen at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...
# 5

Can you post the code to your custom task? How do you keep track of and increment?

I've never written a custom task, but this would be incredibly useful. Please post code!

DanaHanna at 2007-8-30 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - General...

Visual Studio Team System

Site Classified