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:
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".
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
web. config file is an XML-based configuration file used in ASP. NET-based applications to manage various settings that are concerned with the configuration of our website. In this way, we can separate our application logic from configuration logic.
For ASP.Net applications, this file is called web. config and is located in the bin folder of the application root. An ASP.Net application can contain more than one web. config files at sub-directory level. For applications hosted by the executable host, the config file has the same name as the application, with a.
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" />
...
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With