[Mono-list] Mono or .NET?

Stifu stifu at free.fr
Tue Jun 15 14:35:27 EDT 2010


Thanks for the info.


Robert Jordan wrote:
> 
> On 15.06.2010 16:08, Stifu wrote:
>>
>> Hello,
>>
>> Something like this:
>>
>> ///<summary>
>> /// Checks whether the framework used is Mono.
>> ///</summary>
>> ///<returns>True (using Mono) or false (not using Mono).</returns>
>> public static bool IsMono()
>> {
>> 	return Type.GetType("System.MonoType", false) != null;
> 
> Type.GetType("Mono.Runtime") is a little bit safer because it's
> the documented way to detect Mono.
> 
> Robert
> 
> 
>> }
>>
>>
>> SuperCiccio wrote:
>>>
>>> How can I determine whether I am running in Mono or .NET (if I detect
>>> that
>>> I am in Windows through Environment.OSVersion)? I need to do different
>>> things in code, rather then compile different versions.
>>>
>>
> 
> 
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
> 
> 

-- 
View this message in context: http://mono.1490590.n4.nabble.com/Mono-or-NET-tp2255842p2256356.html
Sent from the Mono - General mailing list archive at Nabble.com.


More information about the Mono-list mailing list