title: Programmatically starting an HTTP server in C#?
body: <p>I'm a C#, ASP.NET newbie.</p>
  
  <p>Let's say I have an existing C# project (from a "Console Application" template; I work with Visual Studio). I want to be able to start a simple HTTP server and serve .aspx pages (or ordinary text even, in which case I'm also looking for a nice templating library ^^), but <strong>only if</strong> a certain command is given to the program via the command-line interface. (So, the server is not up by default.)</p>
  
  <p>How could I best accomplish this?</p>
  
  <p>Thank you very much for any help!</p>
  
  <p><strong>Edit:</strong> To clarify, I'd like all of this functionality to be embedded in a single non-webapp non-website project. That is, the project is made up of three parts: the command-line interface, the optionally-run web interface (the HTTP server), and the <em>core</em> that waits for and reacts to requests by either of those two interfaces. This is the current state of the existing project, sans the web-interface.</p>