[Opensim-dev] Assembly version
Tleiades
tleiades at hotmail.com
Sat Oct 6 13:07:14 UTC 2007
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
More information about the Opensim-dev
mailing list