Reputation: 190659
I need to use .NET or MONO for C#/F# programming. How do I know my C#/F# code is running on what platform?
Upvotes: 2
Views: 434
Reputation: 284786
You shouldn't have to do this. However, if it's really necessary you can check for the type Mono.Runtime. From the Mono FAQ:
Type t = Type.GetType ("Mono.Runtime");
if (t != null)
Console.WriteLine ("You are running with the Mono VM");
else
Console.WriteLine ("You are running something else");
Upvotes: 6