[Mono-list] mono + WMI

Perminov A.A. all at rubl.tomsk.ru
Wed Jun 6 01:30:54 EDT 2007

Hello everyone.
Using mono 1.2.4 A simple example of using 

using System;
using System.Management;
namespace wmi_sample
	class MainClass
		public static void Main(string[] args)
			Console.WriteLine("Hello World!");
			string asd = "\\\\\\root\\cimv2";
			ConnectionOptions co = new ConnectionOptions();
			co.Username = "user";
			co.Password = "passwor";

Error :

Unhandled Exception: System.NotImplementedException: The requested
feature is not implemented.
 at System.Management.ConnectionOptions.set_Username(System.Stringvalue)
in /tmp/scratch/BUILD/mono-1.2.4/mcs/class/System.Management/System.Management/ConnectionOptions.cs:129 
  at hz.MainClass.Main (System.String[] args) [0x00021]
in /home/admin/Documents/Work/C#/hz/hz/Main.cs:17 

If you run the program in windows that : 

Unhandled Exception: System.Security.SecurityException: That
assemblydoes not allow partially trusted callers.
asm, PermissionSet granted, PermissionSet refused, RuntimeMethodHandle
rmh, SecurityAction action, Object demand, IPermission permThatFailed)
   at hz.MainClass.Main(String[] args)
The action that failed was:
The assembly or AppDomain that failed was:
hz, Version=1.0.2713.22060, Culture=neutral,
The Zone of the assembly that failed was:
The Url of the assembly that failed was:

More information about the Mono-list mailing list