Showing posts with label Common Errors. Show all posts
Showing posts with label Common Errors. Show all posts

Wednesday, October 31, 2012

Operation is not valid due to the current state of the object.


Error : Operation is not valid due to the current state of the object.

Stack Trace:



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

[HttpException (0x80004005): The URL-encoded form data is not valid.]
   System.Web.HttpRequest.FillInFormCollection() +206
   System.Web.HttpRequest.get_Form() +68
   System.Web.HttpRequest.get_HasForm() +8743911
   System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
   System.Web.UI.Page.DeterminePostBackMode() +63
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +133

This error occurs when form fields are very large in numbers.By default, the maximum value of MaxHttpCollection is 1000.

Solution:

To solve this error, increase MaxHttpCollection value. Try adding the following setting in your web.config's <appsettings> block. 

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

 </appSettings> 

you can change the value accordingly as per your need. 

Saturday, April 21, 2012

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster

Here are few steps to fix "Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster" error.

Step 1 : Visit this link and generate your machine key.
http://www.eggheadcafe.com/articles/GenerateMachineKey/GenerateMachineKey.aspx

Step 2 : Copy the machine key given by above link and paste it to your web.config file.


<?xml version=”1.0″?>

<configuration>

    <appSettings/>
    <connectionStrings/>
    <system.web>

       <machineKey validationKey='4C8B22744D71B73CE6B16262A97CF3862E584829229EDE45C9DF207DDF5F3507782A3F2F6506085028628868F6AFFC25D16BE4AD8BB677637B11C892F95FE819'   decryptionKey='53EA49CFEC5C5A1E4720DE83E1CC75337674757144EB1DCB'   validation='SHA1'/>

    </system.web>
</configuration>


Step 3 : By doing above two steps you will be relieved by this error.But you must know why this error occurs.To get a good detail about this error you must visit this link.

http://www.codeproject.com/Articles/16645/ASP-NET-machineKey-Generator

Tuesday, December 6, 2011

error code 0x8007045D

Meaning of Error 0x8007045d is "ERROR_IO_DEVICE" i.e. "The request could not be performed because of an I/O device error. There are various cause for this error like :
  1.  May be the brand of the disc is incompatible with the burner.
  2. May be the disc is defective.Use another one .
  3. May be the burner have malfunctioned.
In summary, "error code 0x8007045D" simply means the media is bad.