2

I am writing an application where I have to use Process.Start api using System.Diagnostics namespace. I am using moonlight libraries with mono-2.10. But I am getting this error

"The type or namespace name `Process' could not be found. Are you missing a using directive or an assembly reference?"

I want to know is the System.Diagnostics namespace missing from the mscorlib.dll assembly in moonlight build??

gideon
  • 19,329
  • 11
  • 72
  • 113
brunoos
  • 81
  • 1
  • 2
  • 6
  • 1
    but before that, are you sure your not missing a `using System.Diagnostics` ? – gideon Mar 06 '12 at 04:29
  • Why not dissasembly the mscorlib and check for that namespace and classes present or not if thats not too much work. – Zenwalker Mar 06 '12 at 04:31
  • I've disassembled mscorlib.dll and whole System.Diagnostics namespace is missing. Does that means I've compiled it wrongly? – brunoos Mar 06 '12 at 04:35
  • Its available in the System.dll in Mono, there is a bug mentioned but that should have been fixed last year: http://mono.1490590.n4.nabble.com/System-Diagnostic-Process-and-event-handlers-td3246096.html. Can you show us the 5 lines of code and a screenshot of your references – Jeremy Thompson Mar 06 '12 at 05:53

2 Answers2

5

System.Diagnostics.Process is not available in the Silverlight APIs. Therefore it is also not available in the Moonlight APIs. If you want to use Process, you will need to use the full .NET framework BCL.

jpobst
  • 9,982
  • 1
  • 29
  • 33
  • Where can i get list of all the Silverlight APIs which are not available – brunoos Mar 06 '12 at 09:17
  • I doubt there is one. Your best bet is probably the MSDN Silverlight API reference: http://msdn.microsoft.com/en-us/library/cc838194%28v=vs.95%29.aspx – jpobst Mar 06 '12 at 09:28
1

Even though mscorlib is missing System.Diagnostics (which by itself is suspicious), the System.Diagnostics.Process class lives in System.dll (not mscorlib.dll).

M.Babcock
  • 18,753
  • 6
  • 54
  • 84