473,406 Members | 2,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Path Too Long Exception being thrown before HTTPHandler gets request


Ok, here is my setup. I have a fully functioning HTTP Handler
implemented. The handler is supposed to handle every single request
that comes in to a particular virtual directory. Thus, in IIS, I have a
mapping of .* to the aspnet_isapi.dll. And my web.config has an entry
thusly:

<add verb="*" path="*" type="HandlerClass, HandlerAssembly" />

And this is working just fine thus far. The handler gets all the
requests and works like a champ. The requests coming in usually have
the format like:

http://localhost/Handler/4737651658416573246119

And since we are capturing everything irregardless of the filenames or
extensions or whatever, that finds its way to the handler.

And now my problem. We hit a snag today during testing where
apparently, the string of numbers after http://localhost/Handler/ was
too long. We are getting this exception:

-----------------------------------------------------------------------

The path is too long after being fully qualified. Make sure path is less
than 260 characters.

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.IO.PathTooLongException: The path is too long
after being fully qualified. Make sure path is less than 260 characters.

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:

[PathTooLongException: The path is too long after being fully qualified.
Make sure path is less than 260 characters.]
System.IO.Path.nGetFullPathHelper(String path, Char[]
invalidPathChars, Char[] whitespaceChars, Char directorySeparator, Char
altDirectorySeparator, Char volumeSeparator, Boolean fullCheck, String&
newPath) +0
System.IO.Path.GetFullPathInternal(String path) +165
System.IO.Path.GetFullPath(String path) +19
System.Web.HttpApplication.CheckSuspiciousPhysical Path(String
physicalPath) +19

System.Web.Configuration.HttpConfigurationSystem.C omposeConfig(String
reqPath, IHttpMapPath configmap) +175
System.Web.HttpContext.GetCompleteConfigRecord(Str ing reqpath,
IHttpMapPath configmap) +434
System.Web.HttpContext.GetCompleteConfig() +49
System.Web.HttpContext.GetConfig(String name) +195
System.Web.CustomErrors.GetSettings(HttpContext context, Boolean
canThrow) +20
System.Web.HttpResponse.ReportRuntimeError(Excepti on e, Boolean
canThrow) +39
System.Web.HttpRuntime.FinishRequest(HttpWorkerReq uest wr,
HttpContext context, Exception e) +486

---------------------------------------------------------------------

And I know for a fact that I am not throwing this exception. I have the
1st line of my ProcessRequest function breakpointed, and I am not
hitting my breakpoint when this exception is thrown. Somewhere in the
bowels of ASP.net, it is being thrown. If I shorten the string of
numbers in the URL, it works. But that isn't a viable solution.

Finally, my question. Is there anyway to force ASP.net to ignore the
length of the URL?
Nov 19 '05 #1
2 3852
this was a security fix added with sp1 to prevent buffer overflow errors.

http://support.microsoft.com/?kbid=886903
-- bruce (sqlwork.com)

"Seth" <a@b.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

Ok, here is my setup. I have a fully functioning HTTP Handler
implemented. The handler is supposed to handle every single request that
comes in to a particular virtual directory. Thus, in IIS, I have a
mapping of .* to the aspnet_isapi.dll. And my web.config has an entry
thusly:

<add verb="*" path="*" type="HandlerClass, HandlerAssembly" />

And this is working just fine thus far. The handler gets all the requests
and works like a champ. The requests coming in usually have the format
like:

http://localhost/Handler/4737651658416573246119

And since we are capturing everything irregardless of the filenames or
extensions or whatever, that finds its way to the handler.

And now my problem. We hit a snag today during testing where apparently,
the string of numbers after http://localhost/Handler/ was too long. We
are getting this exception:

-----------------------------------------------------------------------

The path is too long after being fully qualified. Make sure path is less
than 260 characters.

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.IO.PathTooLongException: The path is too long
after being fully qualified. Make sure path is less than 260 characters.

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:

[PathTooLongException: The path is too long after being fully qualified.
Make sure path is less than 260 characters.]
System.IO.Path.nGetFullPathHelper(String path, Char[] invalidPathChars,
Char[] whitespaceChars, Char directorySeparator, Char
altDirectorySeparator, Char volumeSeparator, Boolean fullCheck, String&
newPath) +0
System.IO.Path.GetFullPathInternal(String path) +165
System.IO.Path.GetFullPath(String path) +19
System.Web.HttpApplication.CheckSuspiciousPhysical Path(String
physicalPath) +19

System.Web.Configuration.HttpConfigurationSystem.C omposeConfig(String
reqPath, IHttpMapPath configmap) +175
System.Web.HttpContext.GetCompleteConfigRecord(Str ing reqpath,
IHttpMapPath configmap) +434
System.Web.HttpContext.GetCompleteConfig() +49
System.Web.HttpContext.GetConfig(String name) +195
System.Web.CustomErrors.GetSettings(HttpContext context, Boolean
canThrow) +20
System.Web.HttpResponse.ReportRuntimeError(Excepti on e, Boolean
canThrow) +39
System.Web.HttpRuntime.FinishRequest(HttpWorkerReq uest wr, HttpContext
context, Exception e) +486

---------------------------------------------------------------------

And I know for a fact that I am not throwing this exception. I have the
1st line of my ProcessRequest function breakpointed, and I am not hitting
my breakpoint when this exception is thrown. Somewhere in the bowels of
ASP.net, it is being thrown. If I shorten the string of numbers in the
URL, it works. But that isn't a viable solution.

Finally, my question. Is there anyway to force ASP.net to ignore the
length of the URL?

Nov 19 '05 #2

Well, I'm guessing that answers my question. If Microsoft changed how
ASP.net handled long URLs via a security patch, chances are there is no
good way to get it to ignore the long URLs. Uninstalling the security
patch isn't really an option.

So if anyone else is interested, our current (although unsatisfactory)
solution is to turn our long string of number into a query string
instead of a path. Thus,

http://localhost/Handler/4737651658416573246119

turns into:

http://localhost/Handler/?4737651658416573246119

Apparently, there are no length limitations on the query string.

Thanks for the link Bruce.

Bruce Barker wrote:
this was a security fix added with sp1 to prevent buffer overflow errors.

http://support.microsoft.com/?kbid=886903
-- bruce (sqlwork.com)

"Seth" <a@b.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Ok, here is my setup. I have a fully functioning HTTP Handler
implemented. The handler is supposed to handle every single request that
comes in to a particular virtual directory. Thus, in IIS, I have a
mapping of .* to the aspnet_isapi.dll. And my web.config has an entry
thusly:

<add verb="*" path="*" type="HandlerClass, HandlerAssembly" />

And this is working just fine thus far. The handler gets all the requests
and works like a champ. The requests coming in usually have the format
like:

http://localhost/Handler/4737651658416573246119

And since we are capturing everything irregardless of the filenames or
extensions or whatever, that finds its way to the handler.

And now my problem. We hit a snag today during testing where apparently,
the string of numbers after http://localhost/Handler/ was too long. We
are getting this exception:

-----------------------------------------------------------------------

The path is too long after being fully qualified. Make sure path is less
than 260 characters.

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.IO.PathTooLongException: The path is too long
after being fully qualified. Make sure path is less than 260 characters.

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:

[PathTooLongException: The path is too long after being fully qualified.
Make sure path is less than 260 characters.]
System.IO.Path.nGetFullPathHelper(String path, Char[] invalidPathChars,
Char[] whitespaceChars, Char directorySeparator, Char
altDirectorySeparator, Char volumeSeparator, Boolean fullCheck, String&
newPath) +0
System.IO.Path.GetFullPathInternal(String path) +165
System.IO.Path.GetFullPath(String path) +19
System.Web.HttpApplication.CheckSuspiciousPhysical Path(String
physicalPath) +19

System.Web.Configuration.HttpConfigurationSystem .ComposeConfig(String
reqPath, IHttpMapPath configmap) +175
System.Web.HttpContext.GetCompleteConfigRecord(Str ing reqpath,
IHttpMapPath configmap) +434
System.Web.HttpContext.GetCompleteConfig() +49
System.Web.HttpContext.GetConfig(String name) +195
System.Web.CustomErrors.GetSettings(HttpContext context, Boolean
canThrow) +20
System.Web.HttpResponse.ReportRuntimeError(Excepti on e, Boolean
canThrow) +39
System.Web.HttpRuntime.FinishRequest(HttpWorkerReq uest wr, HttpContext
context, Exception e) +486

---------------------------------------------------------------------

And I know for a fact that I am not throwing this exception. I have the
1st line of my ProcessRequest function breakpointed, and I am not hitting
my breakpoint when this exception is thrown. Somewhere in the bowels of
ASP.net, it is being thrown. If I shorten the string of numbers in the
URL, it works. But that isn't a viable solution.

Finally, my question. Is there anyway to force ASP.net to ignore the
length of the URL?


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ollie | last post by:
I have wrriten a reverse proxy for a client of mine, this reverse proxy takes the url takes it attempt to access a *.XXXX and returns the the contents of an aspx web page from another internal...
3
by: Jason | last post by:
I'm having a hard time getting a call to HttpWebRequest's GetRequestSteam to work. Each time I try to run it, I get the following error: The underlying connection was closed: Unable to...
6
by: I am Sam | last post by:
I keep getting this error and I don't know why: The path is too long after being fully qualified. Make sure path is less than 260 characters. Description: An unhandled exception occurred...
2
by: deepak.bhardwaj | last post by:
Hi, I have implemented the IHttpHandler interface for generating images and writing them to response stream in binary format. I use an IHttpHandlerFactory to instantiate that handler. A .aspx...
0
by: Baptiste Lepilleur | last post by:
I activated httplib debug, and when trace are printed, a UnicodeError exception is thrown. I have already set sys.stdout to use utf-8 encoding (this removed the exception when *I* was printing...
3
by: c676228 | last post by:
Hi everyone, I have a piece of code in sales.aspx.vb like this: Protected WithEvents Message As System.Web.UI.WebControls.Label Try ... ChartImage.ImageUrl = "ChartGenerator.aspx?" + DataStr +...
1
by: royston | last post by:
Hi, I have wrote a httpHandler module which rewrite the users url. In Web.Config <httpHandlers> <add verb="*" path="/*/*.aspx" type="Sample.URL.PageHandler,Sample.URLManager"/>...
132
by: Zorro | last post by:
The simplicity of stack unraveling of C++ is not without defective consequences. The following article points to C++ examples showing the defects. An engineer aware of defects can avoid...
35
by: eliben | last post by:
Python provides a quite good and feature-complete exception handling mechanism for its programmers. This is good. But exceptions, like any complex construct, are difficult to use correctly,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.