Length cannot be less than zero. Parameter name: length

Discussion in 'ASP .Net Security' started by ctk70, Feb 10, 2005.

  1. ctk70

    ctk70 Guest

    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?
    --
    Thanks,
    Chris
     
    ctk70, Feb 10, 2005
    #1
    1. Advertising

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

    Joe K.

    "ctk70" <.(donotspam)> wrote in message
    news:...
    >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?
    > --
    > Thanks,
    > Chris
    >
     
    Joe Kaplan \(MVP - ADSI\), Feb 10, 2005
    #2
    1. Advertising

  3. ctk70

    ctk70 Guest

    That was it. Thanks!

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

    "Joe Kaplan (MVP - ADSI)" wrote:

    > Do you have anonymous disabled in IIS and have Windows set for
    > authentication mode in ASP.NET?
    >
    > Joe K.
    >
    > "ctk70" <.(donotspam)> wrote in message
    > news:...
    > >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?
    > > --
    > > Thanks,
    > > Chris
    > >

    >
    >
    >
     
    ctk70, Feb 10, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Mason

    Length cannot be less than zero

    John Mason, Apr 16, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    6,737
    John Mason
    Jun 2, 2004
  2. =?Utf-8?B?SG96aQ==?=
    Replies:
    1
    Views:
    7,008
    Ken Cox [Microsoft MVP]
    Jun 2, 2004
  3. Replies:
    2
    Views:
    5,960
  4. MattB

    Custom CheckBoxList "Length cannot be less than zero" error

    MattB, Aug 2, 2004, in forum: ASP .Net Building Controls
    Replies:
    4
    Views:
    263
    Bill Cohagan
    Sep 28, 2004
  5. Replies:
    0
    Views:
    490
Loading...

Share This Page