views:

153

answers:

1

I'd like to set the ClickOnce publish revision to the Subversion revision of the code's repository — e.g. 3.1.9.2453 for version 3.1.9, based on SVN r2453.

Now, for the assembly version, I know I can use TortoiseSVN's SubWCRev.exe to generate AssemblyInfo classes that contain the build revision. However, it's not quite as simple with ClickOnce — for whatever reason, it stores its metadata (including the current revision) in the project file itself.

Perhaps, though, there is way to have it store the data in a different file (which I could then safely generate from a template using SubWCRev.exe), or to modify the project file without overwriting VS's changes, and without making it think it has to reload the project?

+2  A: 

The way that I've done this in the past is to create a build file (either using MSBuild or NAnt) to automate my builds, used svn info --xml . to pick up the revision number and then stored it in a build variable as part of the 'init' task for a build. In the case of your project file, I copy the project file (foo) to (foo.template), edit it and replace the hardcoded revision number with @REVISION@ and then use whatever copy-and-filter mechanism is supported by the automation tool whenever I build.

Craig Trader