简体   繁体   English

在ASP.NET Web.config中指定uploadReadAheadSize

[英]Specifying uploadReadAheadSize in ASP.NET Web.config

For a problem that I am facing I need to increase the uploadReadAheadSize from 49K to 10M. 对于我面临的问题,我需要将uploadReadAheadSize从49K增加到10M。 I am able to change IIS's setting with 我可以更改IIS的设置

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

which results in the applicationhost.config containing: 这导致applicationhost.config包含:

<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. 但是,我正在将应用程序发布到我无法直接控制IIS设置的远程服务器上。

How can I put this setting in Web.config? 如何将此设置放在Web.config中?

My attempts: 我的尝试:

  1. Adding the following inside <system.webServer> <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". 锁定默认情况下是(overrideModeDefault =“ Deny”),或者是由一个带有overlayMode =“ Deny”或旧版allowOverride =“ false”的位置标记显式设置的。

  1. Adding the following under <configuration> : <configuration>下添加以下内容:

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

    Results: No effect 结果:无影响

Any help would be appreciated 任何帮助,将不胜感激

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 请参阅在webconfig中添加serverRuntime标记导致500.19错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM