I’m trying to write a program that can stop and start services using SilverLight 3 and VS2010.
I can’t add the reference to the System.ServiceProcess dll.
C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.ServiceProcess.dll
1st why? – It it just a security precaution?
2- Is there a work around? Does SilverLight have a different library that I can use to start and stop services.
Also note that this is a desktop application and not a web app. It will be sitting on my desktop to toggle services on and off.
Yes, it’s a security precaution. Can you imagine the havoc Silverlight apps could cause on a system if they could start/stop services at will?
No, there is no work around, and for that I rest easier at night.
Have you considered writing a full-trust XBAP instead? I don’t know if that would work for your situation, but I’d imagine a full-trust XBAP would be able to start/stop services. Or even a standard WPF desktop app? Why use Silverlight for this?
Edit: I’m really not sure if a full-trust XBAP would be able to do that, it’s just something worth investigating, I think.