首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >专用NuGet服务器:请求实体太大

专用NuGet服务器:请求实体太大
EN

Stack Overflow用户
提问于 2012-06-29 23:45:31
回答 4查看 7.6K关注 0票数 18

我们有一个内部NuGet服务器(使用NuGet.Server包的ASP.net应用程序),我们希望将其与八达通一起使用来部署软件包。所以你遇到的第一件事就是包太大了。

当你推送一个大于大约7兆的包时,你会得到:无法处理请求。‘请求实体太大’。远程服务器返回错误:(413)请求实体太大..

基于八达通的文档,我更新了web.config文件以进行更改。

<configuration>
    <configSections>
        <sectionGroup name="elmah">
            <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah"/>
            <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah"/>
            <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah"/>
            <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah"/>
        </sectionGroup>
    </configSections>
    <system.web>
        <compilation debug="true" targetFramework="4.0"/>
        <httpModules>
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/>
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah"/>
            <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah"/>
        </httpModules>
        <httpRuntime maxRequestLength="419430400" executionTimeout="3600"/>
    </system.web>
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules runAllManagedModulesForAllRequests="true">
            <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler"/>
            <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler"/>
            <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler"/>
        </modules>
        <staticContent>
            <mimeMap fileExtension=".nupkg" mimeType="application/zip"/>
        </staticContent>
        <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="419430400"/>
            </requestFiltering>
        </security>
    </system.webServer>
    <elmah>
        <security allowRemoteAccess="false"/>
        <errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data"/>
    </elmah>
    <location path="elmah.axd" inheritInChildApplications="false">
        <system.web>
            <httpHandlers>
                <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
            </httpHandlers>
        </system.web>
        <system.webServer>
            <handlers>
                <add name="ELMAH" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode"/>
            </handlers>
        </system.webServer>
    </location>
    <appSettings>
        <add key="apiKey" value="KeyHere"/>
        <add key="packagesPath" value=""/>
    </appSettings>
    <system.serviceModel>
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    </system.serviceModel>
</configuration>

这是行不通的。其他帖子谈到运行类似(IIS7)的东西: appcmd.exe set config -section:system.webServer/serverRuntime /uploadReadAheadSize:"419430400“/commit:apphost

或者(IIS6):cscript adsutil.vbs set w3svc/1/uploadreadaheadsize 419430400

我两个都试过了,但都没有用。这两个命令都没有返回错误,所以我假设值'419430400‘对于所有调用都是正确的(字节与其他大小单位)。

有人知道我错过了什么吗?

我最终只是将包复制到web服务器上的一个共享位置,但我真的希望push命令能起作用。

谢谢。

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11264902

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档