Length cannot be less than zero. Parameter name: length

C

ctk70

I receive the following error when I try to run this asp.net 1.1 app:

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:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
System.String.Substring(Int32 startIndex, Int32 length) +172
PPL.ESPA.WebSecurity.BaseWebSecurity..ctor(String userName) +71
PPL.ESPA.WebSecurity.EspWebSecurity..ctor(String userName) +5
PPL.ESPA.WebUI.BasePage.get_EspWebSecurity() +142
PPL.ESPA.WebUI.BasePage.AuthorizeUser(String[] authorizedRoles) +18
PPL.ESPA.WebUI.BasePage.PageLoad(Object sender, EventArgs e) +65
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET
Version:1.1.4322.2032

This works fine on my Windows 2000 SP4 server, but not on my Windows 2003
server.

Any idea why User.Identity.Name returns nothing on the Windows 2003 server?
 
J

Joe Kaplan \(MVP - ADSI\)

Do you have anonymous disabled in IIS and have Windows set for
authentication mode in ASP.NET?

Joe K.
 
C

ctk70

That was it. Thanks!

PS: I wish the error message was a little more indicative of the problem.

Joe Kaplan (MVP - ADSI) said:
Do you have anonymous disabled in IIS and have Windows set for
authentication mode in ASP.NET?

Joe K.

ctk70 said:
I receive the following error when I try to run this asp.net 1.1 app:

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:


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
System.String.Substring(Int32 startIndex, Int32 length) +172
PPL.ESPA.WebSecurity.BaseWebSecurity..ctor(String userName) +71
PPL.ESPA.WebSecurity.EspWebSecurity..ctor(String userName) +5
PPL.ESPA.WebUI.BasePage.get_EspWebSecurity() +142
PPL.ESPA.WebUI.BasePage.AuthorizeUser(String[] authorizedRoles) +18
PPL.ESPA.WebUI.BasePage.PageLoad(Object sender, EventArgs e) +65
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750




--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032;
ASP.NET
Version:1.1.4322.2032

This works fine on my Windows 2000 SP4 server, but not on my Windows 2003
server.

Any idea why User.Identity.Name returns nothing on the Windows 2003
server?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top