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

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.

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.

Related

Is iOS capable of accessing and manipulating files on a Windows network file share?

I'm planning an app for work and venturing into potential features which I've not used before.
Essentially I need to be able to access files on a network share, read, write and delete files as well as amend the file names. As a pretty closed platform I'm not sure whether iOS is capable of such a thing and if it is, what features should I look for to begin researching?
My Google-Fu hasn't come up with anything thus far so hopefully looking for someone to point me in the right direction.
Thanks.
I know this isn't very secure, but I'd personally create an ASP.NET app on your target Windows Server, or a different Server on the domain. Create web services exposed, and make an iOS app with UIWebView. You can do RPC calls from the web service that do WMI/ADSI/File System manipulation. You can prompt for domain credentials, and do remote calls essentially is the gist.
You could expose the web app so that your app can access it from local network, or URL. If you were to access it from outside I'd suggest using some secure credentials in Windows/IIS.
Some years ago I created a "mobile-friendly" web app that allowed me to manage servers, perform RPC, and do basic Active Directory queries. Also allowed file listing and deletion/moving/copying with some creative scripting. It was essentially a ASP.NET/C# web app that loaded in a iPhone app. UIWebView in iOS was a able to load it, used AJAX and some other client side scripting that looked decent. You'd essentially have to make sure that your web app renders properly in Safari/UIWebView (which is bastardized safari).
Here's a link to a demo of what I created:
https://www.youtube.com/watch?v=czXmubijHwQ&t=12s
I ran it in a browser, but it'd run from my PSP, Android test devices, iPod Touch, Blackberry, etc.

Programmatically Stopping a Windows Service from a Web App

I have a web application running in a GlassFish 3.1 service on Windows 7 and Server 2008. I would like this application to be able to control a number of other services on the same machine. In particular I want it to be able to start and stop Tomcat services.
Essentially the application is acting as a controller for other applications I deploy on the machine so I can set any security necessary on the controlled applications.
I notice that .Net has a ServiceController class so I'm assuming that programmatic control is possible but I would very strongly prefer a pure Java solution if possible.
All the searches I've done turn up a lot of information about running Java as a service and not much on controlling services from Java. Is what I'm trying to do possible? What security hoops will I need to jump through?
You can do Runtime.exec("net stop tomcat6"). Of course tomcat6 can be replaced with any other service name.
Also check out this tutorial
http://www.java-samples.com/showtutorial.php?tutorialid=8

Testing with 3rd party services

I am developing a asp.net mvc site that depends deeply on a 3rd party web service.
I would like to know what is the best approach to develop this site since the web service is not ready yet and I can't wait it to be ready to start developing.
I am using Specflow and selenium to drive my development.
What you forgot to say is if the 3rd party web service is written by you or your collegues, or if it's completely external.
Anyway, it's still possible to work in parallel. What you need to do is to arrange reunions with the people designing the web service, and obtain/negotiate their specifications, and design interfaces for their service. These interfaces should not be subject to enormous changes afterwards, during the service development.
Once you have them, you can do your job in parallel. But if you can't have them, then forget it: You can't work.

Is Silverlight technology is suitable for the described project

I am going to develop one HRMS application which maitains companies account,marketing,hr and network department information it's functional implementation. Does silverlight is preferable to use with this kind of ERP application.
Silverlight would definitely be a possibility but it would require all users to install the Silverlight plugin.
Since you want to target corporate users, I would probably stick to ASP.NET (WebForms or MVC) if you want a web client and WPF if you want a desktop application.
Silverlight would work; however this sounds like an application more suited for WPF.
not really cause silverlight has not good connection to a back end Database like SQL , its a plugin like flash , you have to make a web services as a work arround for the lack of database connection support

Is it possible to host a asp.net mvc website from a winforms application?

I have a winform application that controls some transmitters and sound cards. There is a requirement to be able to provide a web interface for controlling those devices.
Currently I use WCF to communicate from the controllers in my asp.net MVC site to the winform app. That works well, but there is now a desire to move the hardware to another machine when needed and that means that IIS has to be installed and set-up on that machine.
I know it isn't that hard, but I won't be the one actually doing the moving. It will be the users. If I could host the site from the winform app them it would basically be portable besides the hardware drivers need for a usb to serial converter we use.
Can you use a windows service? The whole winforms app as a service doesn't seem right to me. It assumes that the app is always running. I would create a windows service and expose WCF endpoints from that.
You will need to install IIS or Cassini to host the MVC web site. There's no way around that.
Huh, I would go with Greg's answers.
Also, making your app IIS dependant is not that bad. Or Cassini dependant. You don't want to end up writing your own webserver, which could easily happen when you continue to add features to the app.
I don't know about you but it just feels you are taking all the load on yourself, you are going to spend possibly dozens of hours to implement it to spare an hour or two for someone who doesn't want to install real webserver.
if you want to host MVC under winforms then i would look into the upcoming .netcore 3 version which should allow this combination.
though you'll have to wait until 2019 Q1
https://github.com/dotnet/core/blob/master/roadmap.md
otherwise i've mostly hosted simper stuff using nhttp library if i want it in a winform app.
(NHTTP is a library that gives you very simple crude http request functionality so no mvc sadly but it works for simnpler stuff)

Resources