Friday, January 28, 2011

Registering the ASP.NET File Mappings: To run asp pages in IIS server

When a page is requested from the browser, that comes to the web server. The pages can be of different format i.e html, jsp, asp etc. The server is not the master of all for serving all types of pages.
At this point, one might be wondering how the web server knows when it needs to get the ASP or ASP.NET engine involved. Essentially, the web server looks at the file extension of the requested page (such as .asp or .aspx) to determine the type of content. The web server compares this extension against a list to determine what program owns this file type. For example, the web server’s list indicates that the .aspx extension is owned by the aspnet_isapi.dll component in the corresponding directory. The aspnet_isapi.dll component is known as an ISAPI extension, because it uses the ISAPI (Internet Server API) model to plug into the web server.

The easiest way to make sure you get the right version of aspnet_regiis is to rely on the Visual Studio Command Prompt. The Visual Studio Command Prompt is really just an ordinary Windows command prompt, but it sets the path variable so that the tools you need are at your fingertips. When you type aspnet_regiis.exe in the Visual Studio Command Prompt (without specifying a path), you’ll automatically run the correct version.
To start the Visual Studio Command Prompt, open the Start menu, choose Programs, and then choose Microsoft Visual Studio 2008 -->Visual Studio Tools -->Visual Studio 2008 Command Prompt.

Then for installing type the following
aspnet_regiis.exe -i


and then press enter.

If IIS is installed before installing Visual Studio, IIS is automatically configured for serving ASP pages by using asp engine. If not, then use the above code for configuring.

No comments: