Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / HTML

IIS Express (8.0) x Handler Mappings!

5.00/5 (2 votes)
30 Jan 2014CPOL 17.5K  
How to configure IIS Express applicationhost.config for handler mappings

Introduction

After installing the Visual Studio 2013 version, I had trouble with my web application. This application needs IIS configuration to mapping extensions for my "raills" view files. So, I expend some time to discovery that file: "applicationhost.config" (on path 'C:\Users\...\Documents\IISExpress\config') is the main responsible by web applications.

Using the Code

Pay attention to the two sections should therefore be modified as code below:

XML
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <system.applicationHost>
     
      <sites>

          <!--
                Here configure your site to correct applicationPool, 
                in this case i need the ClassicAppPool with Framework CLR 2.0.  
-->

          <site name="MySite.Web" id="2">
            <application path="/" applicationPool="Clr2ClassicAppPool">
              <virtualDirectory path="/" physicalPath="C:\VS2013\application\web\MySite" />
            </application>
            <bindings>
              <binding protocol="http" bindingInformation="*:2000:localhost" />
            </bindings>
          </site>
          
      </sites>

  </system.applicationHost>
  
  <location path="" overrideMode="Allow">
        <system.webServer>
  
          <!--
                Here add the handlers mapping to both versions... 
          -->
            <handlers accessPolicy="Read, Script">
                <add name="MySite_x86" 
                path="*.gl" verb="GET,HEAD,POST,
                DEBUG" modules="IsapiModule" 
                scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" 
                preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
                <add name="MySite_x64" path="*.gl" 
                verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" 
                scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" 
                preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
            </handlers>
          
        </system.webServer>
    
    </location>
  
</configuration> 

That's all.

Points of Interest

IIS Express is much better than the built-in web server in Visual Studio 2010, but we have to make these changes for full functionality.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)