2012-01-23 81 views
20

试图在相当复杂的ASP.net页面上调试一个随机错误,有很多ADO.net MS-SQL,这是我开始的地方故障排除。然而至今我还没有能够缩小它的范围。有趣的是,当我在VS本地调试代码(针对同一个数据库连接)时,我没有收到错误。然而,当代码针对IIS运行时,会引发以下错误。任何人遇到类似的事情ASP错误:由于对象的当前状态,操作无效

源错误:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

堆栈跟踪:

[InvalidOperationException: Operation is not valid due to the current state of the object.] 
System.Web.HttpValueCollection.FillFromEncodedBytes(Byte[] bytes, Encoding encoding) +11368719 
System.Web.HttpRequest.FillInFormCollection() +329 

[HttpException (0x80004005): The URL-encoded form data is not valid.] 
    System.Web.HttpRequest.FillInFormCollection() +11482818 
    System.Web.HttpRequest.get_Form() +157 
    System.Web.HttpRequest.get_HasForm() +11483620 
    System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +141 
    System.Web.UI.Page.DeterminePostBackMode() +100 
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +259 

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 

回答

51

难道是相对于this issue?一个建议的解决方法是添加以下在你的web.config:

<appSettings> 
    <add key="aspnet:MaxHttpCollectionKeys" value="2000" /> 
</appSettings> 

斯科特谷也blogged有关此漏洞在ASP.NET中发现的。

+0

我不知道,直到我回到那里,但我认为这是问题,因为页面非常复杂,我知道sysadmin刚刚更新了服务器。这是填充oracle的漏洞的补丁吗? –

+2

@bumble_bee_tuna,不,这不是填充预言。这是一个新的。 –

+2

哇,ASP安全的糟糕的一年,大声笑。感谢那些有可能导致我头痛的洞察力。我将标记为答案,因为所有迹象都指出了这一点。代码工作得很好几个月,服务器只是打补丁,非常大的复杂页面。再次感谢Darin –

相关问题