Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hosting Silverlight without IIS

Is there a way to embed a web server, or other means, in a .NET application so that the GUI could be presented as a Silverlight application? Currently we have an application that is client/server. We are using sockets to communicate and passing messages back and forth. One thought was to rework this as a Silverlight solution. The user would simply point their browser at the server on a specific port and be connected.

I could use IIS to serve up the Silverlight (XAML) but was hoping there was another way to do this via embedding a web server or something.


EDIT - Further explaination:

We decided to construct the new version of the application in WPF but are new to Silverlight & WPF. Traditionally, we would have constructed this type of app using a Windows Service on the server and a Windows Forms app on the client and each would communicate through sockets. By "this type of application" I mean a Windows service that processes "stuff" and a client app that allows you to configure the serivce and to view its current status etc. I thought that instead of building the socket layer and having to parse messages, as they go back and forth between the client and server, we might be able to build a Silverlight app and have the user simply connect to the server via their browser. This would mean that I didn't have to install a client app (other then Silverlight) and would remove the communications layer. The crinckle is that I'd like to remove the dependency on the server having IIS and any configuration we might need to do to IIS.

Maybe I'm looking at this all wrong...could be my 'newness' to WPF/Silverlight/XAML


like image 857
Douglas Anderson Avatar asked Sep 22 '09 16:09

Douglas Anderson


2 Answers

Silverlight is just a standard HTML <object> so it can be delivered by anything that will serve HTML. However, it seems like a strange architecture for a client/server solution. For what you're describing, I'd look at either:

  • Silverlight out-of-browser application
  • WPF application delivered via ClickOnce
  • Silverlight application that is loaded from a website but communicates with your existing backend using Silverlight's socket support

Can you explain why you're looking at building a custom server instead of one of the above approaches?

like image 155
Jon Galloway Avatar answered Oct 11 '22 01:10

Jon Galloway


.NET does provide the plumbing needed to implement a HTTP server without extreme difficulty.

Here is one such code project example.

like image 38
AnthonyWJones Avatar answered Oct 11 '22 01:10

AnthonyWJones