locked
ASP.NET 2.0 maximum URL length? RRS feed

  • Question

  • User-916934919 posted

    I originally posted this question in microsoft.public.dotnet.framework.aspnet but after kicking it around for a couple of days, one of the MVPs there suggested to post it here. Please click the link above to see what was already tried. Here is the original post:
    ************
    Using IIS7, Vista x64, ASP.NET 2.0.

    I am getting HTTP 400 "Bad Request" for the following URL:
    /HTTPVPNWebPortal/62ccc22e-069b-441e-b9f0-83b45e7f4f1e/UdVpnSGFuZGxlcnMvQ292ZXJBcnQuYXNoeD9DJTNhJTVjRG9jdW1lbnRzK2FuZCtTZXR0aW5ncyU1Y011c2hyb29tJTVjTXkrRG9jdW1lbnRzJTVjTXkrTXVzaWMlNWNGcmVuY2glNWNBbWVpbGUlNWNZYW5uK1RpZXJzZW4rLStMYStOb3llZS5tcDM=/SecureTunnel.axd

    Here's what makes difference:
    - URL length: As soon as I make this URL two chars shorter - HTTP 400 error
    goes away. Note that length of the first URL segment - the application name
    (HTTPVPNWebPortal) - is irrelevant. App name's length makes no different -
    only the rest of the URL does. Also splitting URL into more segments by
    adding '/' to it makes no difference either.
    - Changing URL resource extension from .AXD to .HTM makes 400 go away, so looks
    like it's an ASP.NET thing. Changing the extension to .ASPX brings error back.

    My question is this: is it possible to configure ASP.NET to allow longer
    URLs for .ASPX and .AXD resources?

    Thank you,
    --
    Vlad Hrybok
    http://UltiDev.com

    Tuesday, May 1, 2007 10:13 AM

Answers

  • User511787461 posted
    The .Net Framework has a restriction of MAX_PATH (260) characters on physical path and so asp.net has a similar restriction on urls - there is no way to get around this restriction.
    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, May 1, 2007 11:22 AM

All replies

  • User511787461 posted
    The .Net Framework has a restriction of MAX_PATH (260) characters on physical path and so asp.net has a similar restriction on urls - there is no way to get around this restriction.
    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Tuesday, May 1, 2007 11:22 AM
  • User1982491842 posted

    Do you know if this is fixed in the .NET 4.0 framework?  If so I could fix this problem by upgrading my app to .net 4.0 rather than spend time working out a hack to handle the long URLs I have in my MVC 2.0 app.

    Wednesday, April 21, 2010 10:12 AM
  • User-46028669 posted

    Yes, this issue is now fixed in ASP.NET 4.0. Read this link for more: http://www.asp.net/Learn/whitepapers/aspnet4#0.2__Toc253429244

    Cheers

    Vishal K Khanna

    http://www.dotnetuncle.com

     

    Monday, May 10, 2010 7:08 AM