10

For a problem that I am facing I need to increase the uploadReadAheadSize from 49K to 10M. I am able to change IIS's setting with

appcmd.exe set config "MyWebServicesSite" -section:serverRuntime /uploadReadAheadSize:10485760 /commit:apphost

which results in the applicationhost.config containing:

<location path="MyWebServicesSite" allowOverride="true">
    <system.webServer>
        <serverRuntime uploadReadAheadSize="10485760" />
    </system.webServer>
</location>

However, I am publishing my app to a remote server on which I dont have direct control on IIS's setting.

How can I put this setting in Web.config?

My attempts:

  1. Adding the following inside <system.webServer>

    <serverRuntime uploadReadAheadSize="10485760" />
    

Results: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

  1. Adding the following under <configuration>:

    <location path="EmsPublisherWebServicesSite" allowOverride="true">
        <system.webServer>
            <serverRuntime uploadReadAheadSize="10485760" />
        </system.webServer>
    </location>
    

    Results: No effect

Any help would be appreciated

UKM
  • 305
  • 1
  • 3
  • 11
  • 1
    Understad more about the problem now. The main problem is the setting being locked. How can it be overridden in Web.config? – UKM Jan 19 '17 at 20:53
  • https://stackoverflow.com/questions/31394838/adding-serverruntime-tag-in-webconfig-cause-500-19-error?rq=1 – Snok May 22 '19 at 11:41

2 Answers2

5

If you do not have direct access, maybe you can request the other Admin to change the entry for you. It would be:

<section name="serverRuntime" overrideModeDefault="Allow" />

This matches with your:

<system.webServer>
<serverRuntime uploadReadAheadSize="10485760" />
...
Spencer Sullivan
  • 527
  • 6
  • 13
2

Run the following command in the command prompt as administrator:

%windir%\system32\inetsrv\appcmd.exe unlock config -section:system.webServer/serverRuntime

See Adding serverRuntime tag in webconfig cause 500.19 error

double-beep
  • 5,031
  • 17
  • 33
  • 41
Snok
  • 36
  • 4