Discussion:
Use Git to manage .NET assembly version
Ido Ran
2010-08-19 08:10:44 UTC
Permalink
Hi,
I'm using git to manage my .NET solution which contain 4 C# projects.
.NET assemblies have version of schema major.minor.build.revision.
I manage the major and minor manually.

I would like to hook git into my help by increasing the build number
of each project that is part of this commit.

I think I can use git hooks (pre-commit) to run an MSBuild task that
will change the version of the assembly or any other command line to
change the version of the assembly.

I would like to know if anyone does something like this?

Thank you,
Ido
--
You received this message because you are subscribed to the Google Groups "Git for human beings" group.
To post to this group, send email to git-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to git-users+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
P Rouleau
2010-09-01 02:58:22 UTC
Permalink
At my place, we use an AssemblyInfo-Custom.template which contains the
common attributs, like the company' name and copyrights. That file is
keep in a template/ directory and it is shared with all the projects
of a solution. The standard AssemblyInfo.cs is cleaned to only
contains the attributs specific to the project, like its name. The
file also contains the version's attributs, but they have MACRO
instead of version X.Y.Z.W.

The macros are replaced with the help of an script called from the pre-
build event. The script copies the template from the template/
directory to the properties's project directory and replace the macros
with a version generated with the help of "git describe". You can
search for GIT-VERSION-GEN for an example how to use "git describe" to
have a version string. The generated AssemblyInfo-Custom.cs is not
commited.
Post by Ido Ran
Hi,
I'm using git to manage my .NET solution which contain 4 C# projects.
.NET assemblies have version of schema major.minor.build.revision.
I manage the major and minor manually.
I would like to hook git into my help by increasing the build number
of each project that is part of this commit.
I think I can use git hooks (pre-commit) to run an MSBuild task that
will change the version of the assembly or any other command line to
change the version of the assembly.
I would like to know if anyone does something like this?
Thank you,
Ido
--
You received this message because you are subscribed to the Google Groups "Git for human beings" group.
To post to this group, send email to git-users-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
To unsubscribe from this group, send email to git-users+***@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/git-users?hl=en.
Loading...