views:

39

answers:

2

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.

A: 

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.

unforgiven3
This should be a simple app and I figured it would be a good project for a 1st silverlight app.
Brad8118
Right, but it's just not possible with Silverlight.
unforgiven3
A: 

The only way to achieve this, if you absolutely need silverlight is to:

Create a WCF Service that must be installed on the machine you wish to start/stop services on. Then through silverlight call the WCF service and ask it to start/stop services.

Neil