Pregunta

Okay, I'm a very green developer (co-op student) so I'll try my best to make sense. Currently I have a web application (call it "Updater") that is an aspx and runs through IIS. My boss has asked my to look into creating a program (exe or command line) that can run the app through created encapsulated web server that can act like IIS. This is so that I can run the exe during an installer procedure on a client's machine so that the updater can configure the client's program.

So Far I've looked into sources upon sources on how to create a self hosted web server to handle a web app and I've managed to do the following:

-Create a command line server hosted at a given port #######. -Use a StreamReader to read an html file -Use HttpResponseMessage to set the Content to this html page.

Obviously this is very rudimentary, but I couldn't understand how to switch the app over to the server I created rather than the IIS.

Any help ont he matter would be appreciated, like I said I'm still quite new.

¿Fue útil?

Solución

You can use OWIN to self host from within a console application.

Look for 'Self-Host OWIN in a Console Application' in the following link:

http://www.asp.net/aspnet/overview/owin-and-katana/getting-started-with-owin-and-katana

Otros consejos

You need to start you self host server with the address your app is trying to contact. If your IIS is running with the default settings it should be http://localhost:80. Before you start the self host server you need to shut down your IIS website that is running on port 80. Two applications can not listen on the same port at the same time.

What you ask is a redistributable web server for ASP.NET. So, you might find interesting the UltiDev Web Server, formerly known as Cassini web server.

From their website:

UltiDev Web Server Pro (UWS) is an advanced, redistributable web server for Windows that can be use as a regular web server to host web sites and ASP.NET applications, or packaged with your ASP.NET web application and installed on your customers' systems along with your web app or site.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top