[Mono-bugs] [Bug 24488] Changed - System.Environment class not fully implemented

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
10 May 2002 08:00:43 -0000


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by vic-bugzilla-ximian@carotena.net.

http://bugzilla.ximian.com/show_bug.cgi?id=24488

--- shadow/24488	Fri May 10 03:48:53 2002
+++ shadow/24488.tmp.2231	Fri May 10 04:00:43 2002
@@ -2,13 +2,13 @@
 Product: Mono/Class Libraries
 Version: unspecified
 OS: All
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Minor
 Component: CORLIB
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: vic-bugzilla-ximian@carotena.net               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -44,6 +44,43 @@
 
 
 How often does this happen? 
 
 
 Additional Information:
+
+------- Additional Comments From vic-bugzilla-ximian@carotena.net  2002-05-10 04:00 -------
+Sorry, I hit submit by accident :(
+As I was saying:
+
+ switch(System.Environment.OSVersion) {
+    case System.PlatformID.Unix:
+       // read /proc/uptime, for example
+       break;
+    case System.PlatformID.Win32NT:
+       //Access a performance counter for up time
+       break;
+    default:
+       throw new NotSupportedException("Not implemented in this 
+system");
+       break;
+   }
+
+Actual Results:
+
+a NullReferenceException is throwed
+
+Expected Results:
+
+To get a valid value from the System.PlatformID Enumeration
+
+How often does this happen? 
+
+Always. The null value is hardoded in 
+mcs/class/corlib/System/Environment.cs
+
+Additional Information:
+
+I'd correct it myself, but I am just learning how to use PInvoke or 
+the internal calls, and how to determine which code should I run 
+depending on the platform (funny, you need to know which platform 
+you're running on to be able to know wich platform you're running on)