mod_aspdotnet module for Apache

Description:Provides an interface for ASP.NET content between Apache HTTP Server 2.0 and Microsoft's ASP.NET host.
Module Identifier:aspdotnet_module
Source File:mod_aspdotnet.cpp
Compatibility:Compatible only with httpd 2.0.44 and later.


The AspNet and AspNetMount directives and handler provided by mod_aspdotnet are used to configure content to be served of the ASP.NET engine.

The current version is compatible with the .NET Framework versions 1.x (1.0, 1.1, etc). The current version is not compatible with .NET Framework version 2.0 although this may be addressed in the future.

Only modern Windows NT-based operating systems (2000, XP, 2003, etc) are supported. Older versions such as Windows 98 and ME are not, Windows NT 6 requires Service Pack 6, and the module authors will not invest time or effort on these older versions. Do not contact the project regarding support of older operating systems.



See also


Several global configurations must be given to enable the Apache HTTP Server to correctly serve ASP.NET application content.


LoadModule aspdotnet_module modules/

AddHandler asax ascx ashx asmx aspx axd config cs csproj \
                   licx rem resources resx soap vb vbproj vsdisco webinfo

AliasMatch "^/(?i)aspnet_client/system_web/(\d+)_(\d+)_(\d+)_(\d+)/(.*)" \

<Directory "C:/Windows/Microsoft.NET/Framework/v*/ASP.NETClientFiles">
    Options FollowSymlinks
    Order allow,deny
    Allow from all

This will direct all requests for ASP.NET-releated files to the mod_aspdotnet handler, and serve Microsoft's ASP.NET client files and support scripts as expected by ASP.NET applications.

Provide individual AspNet and AspNetMount directives for each application (containing a unique web.config file at it's application root.)


AspNetMount /app-uri "C:/path/to/app"
Alias /app-uri "C:/path/to/app"
<Directory "C:/path/to/app">
    Options FollowSymlinks Indexes
    AspNet files
    Order allow,deny
    Allow from all
    DirectoryIndex default.htm default.aspx

AspNet Directive

Description:Enables mod_aspdotnet to process ASP.NET content
Syntax:AspNet [[Files] [Directories] [Virtual] [Errors]] | [All] | [None]
Default:AspNet None
Context:server config, virtual host, directory, .htaccess
Compatibility:Build 2004 and later

The AspNet directive determines what content may be served by the ASP.NET host. This directive does -not- actually expose the content or mount the URI to physical files, you must use the Alias and AspNetMount directives to expose the content to the remote user.

The AspNet files directive is the equivilant for ASP.NET files to the behavior of Options ExecCGI for CGI content. In the original version of mod_aspdotnet, in fact, Options ExecCGI was used to determine if ASP.NET content would be invoked through mod_aspdotnet. In version 2.0.2 and later, this is no longer true, and your configuration files must be updated from Options ExecCGI to AspNet files.

The None option disables all ASP.NET processing, while the individual options below enable ASP.NET processing for specific request types:

All options below. This is generally not a recommended setting.
Files that exist in the filesystem, which are directed to the handler.
Directories that exist in the filesystem, which are directed to the handler. This can be used to invoke an HttpHandler to produce custom directory listings.
Requests that map to neither a file nor directory in the filesystem, which are directed to the handler. This is used to invoke any HttpHandler which accesses non-file based resources, such as ASP.NET remoting requests.
Error result pages generated by ASP.NET. This option bypasses the normal Apache ErrorDocument error content. This is required to return the full debugging results from the ASP.NET environment in development environments. Caution is urged before using this option in production environments, where path-revealing flaws should be avoided.

Normally, if multiple AspNet directives could apply to a directory, then the most specific one is used and others are ignored; the AspNet directives are never merged. See how sections are merged for a better understanding of which Files, Directory, or Location section will take precedence.

AspNetMount Directive

Description:Mounts a URI to a physical ASP.NET directory
Syntax:AspNetMount URL-path directory-path
Context:server config

The AspNetMount directive determines which physical directory is mounted by the ASP.NET host. This directive does -not- actually expose the content, you must use the Alias directive to expose the content to the remote user.

AspNetVersion Directive

Description:Force a specific .NET Framework version to be loaded
Syntax:AspNetVersion versionstring
Context:server config
Compatibility:Build 2004 and later

The AspNetVersion directive will override the default (most current) .NET Framework environment, and elect a different installed version of the .NET Framework. The chosen version must be installed on the machine.

If this directive is not present, the most current .NET Framework version is used. This directive should be specified only once, only the last occurance in the httpd.conf file is used to elect the .NET Framework version.

See the c:\Windows\Microsoft.NET\Framework\ directory for all installed versions and their version tags (the actual directory names).


# Load mod_aspdotnet using the 1.0 release version of the .NET Framework AspNetVersion v1.0.3705


# Load mod_aspdotnet using the 1.1 release version of the .NET Framework AspNetVersion v1.1.4322