After this error occured the application stops working and this same error messages gets displayed in all the pages.
If i replace the dll files again then the application starts working again.
I am pasting the complete error message below
-------------------------
Length cannot be less than zero. Parameter name: length
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length
Source Error:
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. |
Stack Trace:
|
please help me if someone know how to fix this error.

Length cannot be less than zero. Parameter name: length
dexxter
After getting this error i will replace the dll. then the application will work again adn if i view the same page that caused the error it will work fine but i will get this error in some other page.
Is it some bug in ASP.NET
jkreps
Just do what the messages says: Check the stack trace.
Launch the program in the debugger and see what happens. Usually you should see the wrong code line somewhere in the callstack.
Bhuvaneshwari K
Hello
i got this error inconstantly in my appications page and itself it becoming ok...i belive i got this problem in a mean while i upgrade my dll in the web.....i think u too faced some problem like this
please let me know the solution.........
System.Web.HttpUnhandledException: Exception of type System.Web.HttpUnhandledException was thrown. ---> System.ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length
at System.String.Substring(Int32 startIndex, Int32 length)
at System.Web.UI.Util.GetScriptLocation(HttpContext context)
at System.Web.UI.WebControls.BaseValidator.RegisterValidatorCommonScript()
at System.Web.UI.WebControls.BaseValidator.OnPreRender(EventArgs e)
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Control.PreRenderRecursiveInternal()
at System.Web.UI.Page.ProcessRequestMain()
--- End of inner exception stack trace ---
at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain()
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at System.Web.CallHandlerExecutionStep.System.Web.HttpApplication+IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Ryan Po
The error i was talking about is happening Inconstantly. It happens all of a sudden in a page and after that i am not able to access any page. But if i replace the application dll i am able to acces the application and the error does not occur if i do the same operation again which caused the errror perviously.
I am not doing any substring operation in my page. its usually in view pages i get this error. and the beauty is next time i will get this error in some other page.
please help.
stack
AnotherAndy
I am getting the same issue as well. It JUST started happening. It seems to only be happening if my .DLL is in Release mode. If I switch out of Release and compile in debug mode and re-upload the dll to my host (atlantic.net) its works...
YAYASOFT
I'm getting the same problem.. I'm not sure where it starts from either.
It occurs when I am Rendering attributes for a custom control. The only reference to Length is:
strAppName = HttpContext.Current.Request.ServerVariables["APPL_MD_PATH"]; int i = strAppName.IndexOf ("Root/");strAppName = strAppName.Substring(i + 4) + "/";
strCompleteAction = HttpContext.Current.Request.FilePath.Substring(strAppName.Length)+HttpContext.Current.Request.Url.Query;
Is this because of the way I am using APPL_MD_PATH It only occurs on one deployment of many, so I think there may be something in IIS or elsewhere affecting this.
The most difficult part is, I cant replicate the error locally.
Any ideas would be appreciated!
Arkiliknam
Ron Gliane
You might want to try the newsgroups at http://msdn.microsoft.com/newsgroups/ for more feedback.
Thanks,
Ayman Shoukry
VC++ Team
Bernard Bout
Do you have a sample to reproduce the issue
Thanks, Ayman Shoukry VC++ Teamrickm2005