HTTP Error 500.19 When trying to Change Max Reqest Length

1

I am trying to have a basic feature for uploading audio files to my website. I ran across the max length error and used the solution found here. However, whenever I try to run the website I get HTTP Error 500.19 with error code 0x800700b7. My web I config looks like this:

<configuration>
  <system.web>
    <compilation debug="true" targetFramework="4.5.2"/>
    <httpRuntime targetFramework="4.5.2"/>
        <httpRuntime maxRequestLength="1048576" />
  </system.web>
  <system.webServer>
   <security>
      <requestFiltering>
         <requestLimits maxAllowedContentLength="1073741824" />
      </requestFiltering>
   </security>
 </system.webServer>
  <system.codedom>
    <compilers>
      <compiler language="c#;cs;csharp" extension=".cs"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
      <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
        type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
        warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&quot;Web\&quot; /optionInfer+"/>
    </compilers>
  </system.codedom>
</configuration>

I have searched the internet. I tried this, and it didn't do anything. I can't do this because I need the line to the malformed lined to change the max length. This didn't help me at. What can I do to fix this? If it matters, I am using C#.

iis
web-config
asked on Stack Overflow Mar 14, 2018 by White Eagle • edited Mar 14, 2018 by White Eagle

1 Answer

0

I managed to figure out my problem and thought I would post it here in case it would help anyone. It turns out that:

<httpRuntime targetFramework="4.5.2"/>
        <httpRuntime maxRequestLength="1048576" />

Should have been:

<httpRuntime targetFramework="4.5.2" maxRequestLength="1048576" />

Referencing httpRuntime twice was the problem.

answered on Stack Overflow Mar 15, 2018 by White Eagle

User contributions licensed under CC BY-SA 3.0