Question

I am interested in making a web front end for my C# Console Application (it is ran on dedicated machines as a service so the user never sees the console) allowing for control of various features. I have very little experience with ASP.net so I need to find out what the best approach would be for this.

Right now I have embedded this nice little web server into it (http://webserver.codeplex.com) but I imagine doing a front-end with ASP.net would give a lot more control over the application. I have had very little luck with Google results as most of the searches pertain to ASP.net or Console Applications, but not using them together. I basically need to not only pull information from my application and display it, but allow user input as well (mostly just text boxes and buttons).

The other problem I ran into was it doesn't seem like any good solutions exist for embedding an ASP.net web server. I found UltiDev Cassini and aspNETServe but neither seems like it can be embedded. Both look like they require additional software to be running, which is difficult since I just want to distribute a .exe file. Is it not possible to completely embed a ASP.net server?

Was it helpful?

Solution

You may want to look at IIS Hosted Web Core (HWC), which allows you to embed the core of IIS inside your application. I believe it can serve up ASPX files. In the spirit of full disclosure, I have not used HWC, so I can't say whether it will do what you want. But I've been interested in it since Azure uses (used?) HWC for it's web roles in earlier versions.

But from I've read, I think it can do what you want. The drawback is that I think it requires you to do some native (C++) programming. Not sure if that helps or not, but I think this is going to be pretty close to what you're looking for.

Here's a blog article describing how to embed HWC in a Console Application.

Hope this helps!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top