HttpListener ASPX Host Application Sample

This sample demonstrates how to use the features of the HttpListener class (introduced in the .NET Framework version 2.0) to create an HTTP server that routes calls to a hosted ASP.NET application.

The application demonstrates the following tasks:

  • Enabling Secure Sockets Layer (SSL).

  • Reading client certificates on a secure connection.

  • Using authentication.

To build the sample using the Command Prompt

  1. Open the Command Prompt window and navigate to the CS subdirectory under the AspxHost directory. For information about required settings and the SDK Command Prompt, see How to: Set Sample Settings.

  2. Type msbuild AspxHostCS.sln at the command line and press Enter.

To build the sample using Visual Studio

  1. Open Windows Explorer and navigate to the language-specific subdirectory under the AspxHost directory.

  2. Double-click the icon for AspcHost<lang>.sln to open the file in Visual Studio, where <lang> could be either CS or VB.

  3. In the Build menu, select Build Solution.

The application is built in the default \Bin or \Bin\Debug directory.

To run the sample

  1. Open the Command Prompt window and navigate to the directory that contains the new executable file.

  2. Type AspxHostCS at the command line and press Enter.

See Also

Reference

System.Web.Hosting

HttpListener