One of the more esoteric features of ASP.NET is its ability to run outside of IIS. Specifically, it supports a hosting framework (within the System.Web.Hosting namespace) that enables you to run it on top of other web servers, within command line exes, etc. The below sample demonstrates a simple way to process ASP.NET requests within a command line exe (MyHost.exe). When run, MyHost.exe spins of ASP.NET (threadpool and all) and interprets each parameter to the executable as a URL request to a local file. It then outputs the content back to the console window. To try this out, perform the following steps:
1) Copy The MyHost.cs and Test.aspx files to a local directory
2) Compile MyHost.exe by typing “csc MyHost.cs /r:System.Web.dll” within a command prompt in the directory
3) Type “MyHost.exe Test.aspx”