3

I have a long querystring value I need to pass in (itself a questionable practice, I understand), and I am not able to get it to take effect on my Appharbor app instance.

Locally, I've made this change to my web.config and confirmed that the URL in question works locally:

<httpRuntime maxQueryStringLength="2097151"/>

And ensured that it exists in the resultant web.config post the transformation by my Web.Release.config. That said, when I push to AppHarbor, the transformation should pick it up...yet I'm still getting this exception:

The length of the query string for this request exceeds the configured maxQueryStringLength value.

Stack Trace:

at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)

Any ideas? Thanks for your help.

TimDog
  • 8,758
  • 5
  • 41
  • 50
  • If you've placed the setting in your master web.config file, why are you also doing stuff with the web.release.config? At any rate, you might want to check that the combo gives the desired output: webconfigtransformationtester.apphb.com – friism Jan 20 '12 at 01:28
  • Sorry, badly worded -- by "ensured that it exists in my Web.Release.config" I really meant that I ensured the resulting transformed web.config held the segment I expected. I've edited the original question. – TimDog Jan 20 '12 at 14:48

2 Answers2

6

My original testing was done against Cassini (VS 2010's built-in web server). I pushed locally to IIS 7.5 and found this error:

HTTP Error 404.15 - Not Found
The request filtering module is configured to deny a request where the query string is too long.

Which appeared because I didn't specify the maxQueryLength in the <system.webServer> section of my web.config as well as the <httpRuntime>. So the answer is to specify BOTH the <system.web> and <system.webServer> sections:

<system.web>
   <httpRuntime maxQueryStringLength="2097151"/>
</system.web>

And then:

<system.webServer>
   <security>
     <requestFiltering>
       <requestLimits maxQueryString="2097151"/>
     </requestFiltering>
   </security>
</system.webServer>

When I pushed this version of my config to AppHarbor, all was well. Hope this helps.

TimDog
  • 8,758
  • 5
  • 41
  • 50
0

Remember that HTTP.SYS has its own limits as well! They're described here: http://support.microsoft.com/kb/820129

DenNukem
  • 8,014
  • 3
  • 40
  • 45