[Mono-devel-list] Determine the name and/or kind of CLI runtimeenvironment

Jonathan Gilbert 2a5gjx302 at sneakemail.com
Wed Jun 1 11:58:47 EDT 2005


At 05:44 PM 01/06/2005 +0200, Kornél wrote:
>> From: Jonathan Gilbert
>> Mono would automatically reuse itself when using Process.Start to invoke
>> other .NET binaries. I seriously can't think of many cases where you'd
>> want
>> to force the use of a *different* runtime. =/
>
>I just want to execute the same mono binary to get the version of the
>runtime in use because Mono has no built in functionality to retrieve the
>version number of the runtime.
>
>I want to execute "mono --version" regardless of the operating system to
>obtain the version number. For more details pleas look at the code at the
>end of my message you have answered.
>
>So the question is how can I ensure to use the same mono binary as executing
>the managed code when I execute "mono --version" (from managed code running
>on Mono using Process.Start())?

My misunderstanding :-) I saw the words "same mono binary" and was reminded
immediately of that bug report.

I wonder if there is a hash table somewhere where the mono runtime version
could be injected without causing any API disturbance... I noticed
"AppDomain.Current.GetData(...)" calls in another recent post, I wonder if
that might be an appropriate place to add a runtime-specific value...
Something like:

string version_string =
AppDomain.Current.GetData("__MONO_RUNTIME_VERSION").ToString();

I could probably hack up a patch to do something like this. Can anyone
think of any strong reason to not do this?

Jonathan Gilbert




More information about the Mono-devel-list mailing list