[Opensim-dev] Assembly version
Sean Dague
sean at dague.net
Sat Oct 6 13:24:44 UTC 2007
On Sat, Oct 06, 2007 at 03:07:14PM +0200, Tleiades wrote:
> Hi
>
> I have noticed that quite a few of the dynamically loaded assemblies have a
> version property, and that the version string is hard-coded, making the
> maintenance of this version information manual, and error prone.
>
> Why don't we use the AssemblyVersion property in the assemblyinfo.cs file?
> and then have subversion maintain and update the information, either on
> check in or out.
>
> The following is a piece of code, which can extract the version information
> using reflection.
>
> public string getVersion()
> {
> System.Reflection.Module module = this.GetType().Module;
> string dllName = module.Assembly.ManifestModule.Name;
> Version dllVersion = module.Assembly.GetName().Version;
>
> return string.Format("{0}.{1}.{2}.{3}", dllVersion.Major, dllVersion.Minor,
> dllVersion.Build, dllVersion.Revision);
> }
>
> /tleiades
+1 on this idea.
-Sean
--
__________________________________________________________________
Sean Dague Mid-Hudson Valley
sean at dague dot net Linux Users Group
http://dague.net http://mhvlug.org
There is no silver bullet. Plus, werewolves make better neighbors
than zombies, and they tend to keep the vampire population down.
__________________________________________________________________
More information about the Opensim-dev
mailing list