开发者

Silverlight 3 and System.ServiceProcess - Doesn't allow the reference to be added

开发者 https://www.devze.com 2022-12-23 18:13 出处:网络
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.

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 ap开发者_JAVA百科p. 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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消