Click here to Skip to main content
15,886,919 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I am trying to change the order of modules in the IIS pipeline in the ApplicationHost.config file, so I have created a following file and placed it in the site directory on the server, but unfortunately nothing happened. Here are the contents of my file:
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
	<system.webServer>
		<modules>
			<add name="EnvVarSetModule" lockItem="true" />
			<add name="AspNetCoreModuleV2" lockItem="true" />
			<add name="AspNetCoreModule" lockItem="true" />
			<add name="PipeStat" lockItem="true" />
			<add name="RewriteModule" />
			<add name="ARRHelper" lockItem="true" />
			<add name="DynamicIpRestrictionModule" lockItem="true" />
			<add name="IsapiModule" lockItem="true" />
			<add name="IsapiFilterModule" lockItem="true" />
			<add name="HttpLoggingModule" lockItem="true" />
			<add name="HttpCacheModule" lockItem="true" />
			<add name="DynamicCompressionModule" lockItem="true" />
			<add name="StaticCompressionModule" lockItem="true" />
			<add name="DefaultDocumentModule" lockItem="true" />
			<add name="DirectoryListingModule" lockItem="true" />
			<add name="ProtocolSupportModule" lockItem="true" />
			<add name="HttpRedirectionModule" lockItem="true" />
			<add name="ServerSideIncludeModule" lockItem="true" />
			<add name="StaticFileModule" lockItem="true" />
			<add name="AnonymousAuthenticationModule" lockItem="true" />
			<add name="IpRestrictionModule" lockItem="true" />
			<add name="RequestFilteringModule" lockItem="true" />
			<add name="CustomErrorModule" lockItem="true" />
			<add name="FailedRequestsTracingModule" lockItem="true" />
			<add name="CgiModule" lockItem="true" />
			<add name="FastCgiModule" lockItem="true" />
			<add name="ConfigurationValidationModule" lockItem="true" />
			<add name="OutputCache" type="System.Web.Caching.OutputCacheModule" preCondition="managedHandler" />
			<add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="managedHandler" />
			<add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" preCondition="managedHandler" />
			<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" preCondition="managedHandler" />
			<add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" preCondition="managedHandler" />
			<add name="RoleManager" type="System.Web.Security.RoleManagerModule" preCondition="managedHandler" />
			<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" preCondition="managedHandler" />
			<add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" preCondition="managedHandler" />
			<add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" preCondition="managedHandler" />
			<add name="Profile" type="System.Web.Profile.ProfileModule" preCondition="managedHandler" />
			<add name="UrlMappingsModule" type="System.Web.UrlMappingsModule" preCondition="managedHandler" />
			<add name="ApplicationInitializationModule" lockItem="true" />
			<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="managedHandler,runtimeVersionv4.0" />
			<add name="ScriptModule-4.0" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
			<add name="ServiceModel-4.0" type="System.ServiceModel.Activation.ServiceHttpModule, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
			<add name="iisnode" />
			<add name="ModSecurity IIS (32bits)" preCondition="bitness32" />
			<add name="ModSecurity IIS (64bits)" preCondition="bitness64" />
			<add name="ApplicationRequestRouting" />
			<add name="httpPlatformHandler" />
			<add name="ProcessMonitoringModule" lockItem="true" />
			<add name="ApplicationIdentificationModule" lockItem="true" />
			<add name="WebSocketModule" lockItem="true" />
			<add name="WebSocketMonitoringModule" lockItem="true" />
			<add name="DWASModule" lockItem="true" />
			<add name="AzureSlaModule" lockItem="true" />
		</modules>
	</system.webServer>
</configuration>


What I have tried:

I have tried to install the IISManager extension, placing the file in other directories, but to no success.
Posted

1 solution

So, this file is supposed to exist in %WinDir%\System32\Inetsrv\Config, and not at your site level. You can't put a local version in and have it picked up by IIS; that's not the way it works.
 
Share this answer
 
Comments
Member 14703094 5-Mar-24 7:44am    
The file applicationhost.config indeed does, but it's a read only file, and from the articles I have found on the internet, in order to change it you need to create an applicationhost.xdt file, which will contain the changes you need to want to make to the "original" applicationhost file:
https://www.thebestcsharpprogrammerintheworld.com/2015/01/19/making-changes-to-the-applicationhost-config-on-azure-app-service/

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900