0

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.

vincent
  • 1,370
  • 2
  • 13
  • 29
  • 4
    The "Process part" of System.Diagnostics is not available in Silverlight CLR Framework. Workaround : http://stackoverflow.com/questions/2586128/can-you-start-an-outside-process-with-silverlight – Raphaël Althaus May 10 '12 at 15:04

2 Answers2

1

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

Chris Sinclair
  • 22,858
  • 3
  • 52
  • 93
0

My guess is that your project is set to use a "Client Profile" version of the framework. You can change this by right-clicking your project and selecting properties, then under the Application tab, changing the target framework to something that doesn't use a "Client Profile".

If this isn't the case, then I'm not sure what to suggest and hope that someone more knowledgeable than I responds. :)

CodeHxr
  • 855
  • 8
  • 17