[Mono-winforms-list] What is best to use to identify the mono runtime installation?
Robert Jordan
robertj at gmx.net
Mon May 14 10:30:33 EDT 2007
Maser, Dan wrote:
> In my 'about' dialog on my app I display some useful information for
> diagnostics. Meaning useful when someone reports a problem. Currently
> it display things like the base OS, service packs/patches, and other
> various information that end uses can copy/paste into a bug report.
> I'm wondering what the best information to show about the mono runtime
> is? If someone reports a problem it would be really useful to be able
> to say "that problem is already fixed in a later mono build". On the
> mailing lists and such people often talk about "r77343" which is the svn
> revision. Is that revision compiled into the runtime in some way that
> can be extracted at run time programatically? Is there something
> better? (Other ideas would include perhaps taking the build date of one
> of the core mono dlls or something).
That's the official way.
Note that the string is not parsable. It's only suitable for
About-dialogs or similar purposes (bug reports etc.):
using System;
using System.Reflection;
class T
{
static void Main ()
{
Console.WriteLine (GetDisplayName ());
}
//
// Returns the display name of the current runtime.
//
static string GetDisplayName ()
{
Type t = Type.GetType ("Mono.Runtime");
if (t == null) return "MS.NET";
MethodInfo mi = t.GetMethod ("GetDisplayName",
BindingFlags.Static | BindingFlags.NonPublic);
return (string) mi.Invoke (null, null);
}
}
Robert
More information about the Mono-winforms-list
mailing list