I want to determine the revision (how to call properly it in Git?) from which current Mono runtime was built and installed.
$ dmcs --version
Mono C# compiler version 2.9.0.0
but it's definitely insufficient.
XSP/ASP.NET error page gives more information:
Version information: Mono Runtime Version: 2.8.1 (master/cdf1247 Sat Sep 4 01:22:04 MSD 2010); ASP.NET Version: 4.0.30319.1
but it seems to be a dirty hack to me.
How to do it properly?
mono -V
will output the version string, including source code revision.
If you're looking for the mono runtime version; there is an internal Mono.Runtime class in mscorlib, it has a static method GetDisplayName which should return a string with current runtime version. This method is private but still can be accessed via reflection. I wrote a small script to test this, check if would work for you:
Type type = Type.GetType("Mono.Runtime");
if (type != null)
{
MethodInfo dispalayName = type.GetMethod("GetDisplayName", BindingFlags.NonPublic | BindingFlags.Static);
if (dispalayName != null)
Console.WriteLine(dispalayName.Invoke(null, null));
}
on my system this returns:
2.6.7 (Debian 2.6.7-3ubuntu1~dhx1)
hope this helps, regards