2012-01-23 82 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 –

相關問題