Sorry for the simple question, but this has been killing me and I can’t seem to find the answer. I’m writing a Silverlight 5.0 application in C# with VS2010. .NET 4.5.40805 SP1Rel. In the directives of the codebehind, I’ve added “using System.Diagnostics;” so I can use “Process()”. While intellisense will complete “System.Diagnostics” for me, I can’t seem to use the Process class located therein. If I try to “Add reference” via the solution explorer, System.Diagnostics is not there.
Am I using the wrong directive? (http://msdn.microsoft.com/en-us/library/system.diagnostics.process.aspx as well as the object explorer suggests I’m not) Is there somethings I’m missing for effectively adding these references? Please help me with this recurring problem. Thank you.
AFAIK, Silverlight doesn’t have access to System.Diagnostics.Process because of its Core CLR and security considerations. The MSDN page you linked to doesn’t have a “Microsoft Silverlight” framework version to look up which is a good marker for this. Any classes that do exist in Silverlight will have a “Silverlight” version of the MSDN page (don’t look at the “.NET Framework 4” versions).
For example, the .NET Framework 4 version of the System.Diagnostics namespace shows a slew of entries: http://msdn.microsoft.com/en-us/library/system.diagnostics.aspx
However, the same page for Silverlight only shows a few: http://msdn.microsoft.com/en-us/library/system.diagnostics%28VS.95%29.aspx