Aaron Franke Aaron Franke - 1 year ago 84
Linux Question

MonoDevelop reports my platform incorrectly on Linux

I'm using Xubuntu 16.04 LTS with MonoDevelop 5.9.6. I have created a console application and this is the only code:

public static void Main (string[] args)
Console.WriteLine (new PlatformID());

However, in the console, this is the output:


Why is it detecting my platform incorrectly? I'm clearly not using Windows.

Answer Source

PlatformID is an enumeration from System, not a class you can instance so I'm not sure how your code even complies.

If you want OS Version and/or Platform, here is how you can obtain it:

Code Snippet:

var os = Environment.OSVersion;
var pid = os.Platform;


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download