简体   繁体   中英

Can we host a website to IIS programatically?

I am trying to create an windows application which will be able to host a website once the project is located. I understand certain variables need to be supplied to the application. My need is, a user without knowledge of IIS can be able to host a website to his/her local system.

Is it possible?

Yes, sort of, with lots of caveats.

Yes, you can recreate enough to make an application that listens on port 80 & does something. What you want that something to be depends on what your website is. Simple html would be easy enough, anything more you start having to do enough work to make you rethink what you're doing.

OWIN should be able to help you out, as it's designed to separate hosting from the host.

A bigger question is why do you think this would be the best approach for your application? There are better approaches, such as self-hosted REST services with static html that would probably be a better fit. if the website needs to deal with any volume of traffic, then a web server really is the only approach.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM