title: Hosting Serving Web Pages on Windows In Process
body: <p>I am currently writing a web based front end for some proprietary server software. The server is based loosely around MEF components written as seaparate assemblies which serve as modules. The web based front end will have its pages served up as a part of one of the modules and it is desirable that it run "in process" so that failure of the module does not jeopardize the entire server. </p>
  
  <p>I am working through the pros and cons of different approaches for architecting the front end. I have the following as options: </p>
  
  <ol>
  <li><p>Serve up HTML pages and process commands from a WCF Restful service. Use a WebServiceHost that starts up when a module is initialized.</p></li>
  <li><p>Use IIS 7.5 Express to set up a web server for a specific directory. </p></li>
  </ol>
  
  <p>I have #1 prototyped but the downside is that I would have to do a lot of infrastructure code for processing URLs, generating templates and so on. Right now I'm serving up the pages as embedded resources. I don't have the ability to leverage things like ASP.NET MVC. </p>
  
  <p>I am curious about #2 because although IIS represents a big dependency, all the goodness of ASP.NET MVC and other Microsoft infrastructure (e.g. Razor) is readily available. </p>
  
  <p>My questions: </p>
  
  <ol>
  <li><p>Are there any drawbacks to running IIS Express in process? </p></li>
  <li><p>What are the pitfalls of my initial approach, running a WCF RESTful web service. </p></li>
  <li><p>Are there any other lightweight webserver containers I can take advantage of that have the flexibility of ASP.NET for template driven pages and database interaction? </p></li>
  <li><p>Any additional insight/experiences if you've tried something similar. </p></li>
  </ol>