title: How to embed an asp.net site in a windows service (or vice versa)
body: <p>I'm building a windows service but I would like to get some web pages to control some settings, get diagnostics, etc...</p>
  
  <p>How would you go about combining an asp.net web site AND a windows service together ?
  I know that WCF can be self hosted into an arbitrary process but can I do the same with asp.net ?</p>
  
  <p>Another option would be to have my service logic in the asp.net web site application_start method to spawn long running threads. But then, I don't get window service built in feature such as auto start on boot up. Another issue might be that IIS might decide to recycle the process. Moreover, my service needs to open a raw tcp socket to accept connections. Can I do that in IIS ?</p>
  
  <p>Thanks</p>