Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I assume the original issue is already solved, but since I came across this while trying to solve a similar problem via searches maybe this answer will help someone else. Basically the problem is that even when you unlock the <code>modules</code> section and it is copied to a <code>&lt;location&gt;</code> where overrides are allowed, all of the native modules (at least in IIS 8) have <code>lockItem="true"</code> set on them.</p> <p>If you use appcmd.exe to delete and then recreate the native module entries at the APPROOT <code>lockItem</code> will disappear. The commands to achieve that for the StaticCompressionModule, for example:</p> <pre><code>appcmd set config -section:system.webServer/modules /-[name='StaticCompressionModule'] appcmd set config -section:system.webServer/modules /+[name='StaticCompressionModule'] </code></pre> <p>Note that this works for the native modules because <code>name</code> is the only property they have other than <code>lockItem</code> (no <code>type</code> or <code>preCondition</code>). In my case I wanted to be able to <code>&lt;clear /&gt;</code> all default <code>handlers</code> and <code>modules</code> and specifically add only what I need for my module based application:</p> <pre><code>@echo off setlocal set iis=%SystemRoot%\System32\inetsrv\appcmd.exe set iisx=%iis% /commit:apphost set ws=config -section:system.webServer %iisx% unlock %ws%/handlers %iisx% unlock %ws%/modules for /f "tokens=3 delims== " %%a in ('%iis% list %ws%/modules ^| find /v "type=" ^| find "add"') do %iisx% set %ws%/modules /-[name='%%~a'] &amp;&amp; %iisx% set %ws%/modules /+[name='%%~a'] endlocal </code></pre> <p>The assumption made in the batch file is that all <code>&lt;add&gt;</code> elements under <code>modules</code> have a <code>type</code> and are not locked or do not, are locked and only have a <code>name</code> that is important. In case anyone is trying to do similar to what I am with a web application, I will try to blog about it at <a href="http://christophercrooker.com" rel="nofollow">http://christophercrooker.com</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload