[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: C# AssemblyInfo integration

From: Martin Rabl <martin.rabl_at_rablnet.de>
Date: Thu, 27 Aug 2009 09:44:27 +0200

Hi,

I did it with a "make" script (cmd-Batchfile), which patched the
source and after it compiled the complete project - pretty ugly, but
it runs quite good, and makes a new Revision every time I recompile.

Please do not forget, when you have a setup project in your Visual
Studio solution, too, you also have to patch that project.

You will find an ugly little example on
http://www.rablnet.de/patch_revision_example.cmd.txt
(Ok, XP-Batchfile-Style ;-) )

Greetings,
    Martin

P.S.: Maybe it runs with MonoDevelop to, I remember MonoDevelop uses
the same Projectfilestyle like Visual Studio, isn't it?

Yves Goergen schrieb:
> I would like to use the SVN revision of a source code as the 4th part of
> the version number in the AssemblyInfo.cs file in a C# .NET project.
> Unfortunately the keyword substitution that SVN provides cannot easily be
> used for that task. All I need is the plain number with no junk around it.
> And if I create a build task that alters the file before a build, it will
> be marked as changed and wants to be commited after each build.
>
> My idea is another one: Add transparent integration of that feature into
> the SVN system and control it through an SVN file property. It could work
> like this: Set the property like "csharp-assembly-revision" to the
> AssemblyInfo.cs file and at each update, the client gets a new version of
> that file with the revision number updated in a line like this:
>
> [assembly: AssemblyVersion("1.2.3.4")]
>
> is altered to:
>
> [assembly: AssemblyVersion("1.2.3.678")]
>
> with 678 being the SVN revision that the file was checked out from.
>
> There should be no need for any keywords whatsoever. The revision number
> should be replaced directly in this line. Also the file should be fetched
> from the client (and possibly merged if any other assembly attribute was
> changed locally) and not be marked as changed by this. So the file should
> always contain the current revision number but never be included in a
> commit only because of this change.
>
> Now my question is: How can this be done? Is it a good idea at all? At
> least it would be an easy one. Set the keyword and you're done - no more
> hacks and loads of build tasks that need to be configured for each project
> anew. Can SVN be customised or extended at some point to add this feature
> or would that need to go into the server core? Does it need any special
> client support? I'm using AnkhSVN at the moment.
>
> ------------------------------------------------------
> http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2387789
>
> To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].

-- 
Viele Grüße,
   Martin Rabl
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2387805
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-08-27 09:45:42 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.