I have a weird problem with a site that doesn't face issues in development using Cassini, but crashes hard when deployed to an IIS 6.0. Windows 2003 server.
Basically, I'm using a rewriting engine and everything goes fine if, say, I have a URL like this:
But this actually doesn't apply to me. I'm seeing the error when browsing to the site with internet explorer!
Is there something wrong with using numbers at the end of a URL with IIS 6.0?
Again here's the error info:
Server Error in '/' Application.
Cannot use a leading .. to exit above the top directory.
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.Web.HttpException: Cannot use a leading .. to exit above the top directory.
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.
Looking at the event logs for the server, I can see an application warning providing much of the same exception information as above and noting that the URL is (paraphrased) www.site.com/list.aspx?type=products&page=2
with a request path of: /list.aspx.
I suppose it's logical that somehow, something that ASP.NET rewrites is referencing a resource like ../../resource but first: I don't know why it would be doing that as I override the form to remove the action and I don't use any ResolveUrl() functions and
second: it works perfectly with the Cassini server on Windows XP Pro!
i get the same message .i checked the entire code , i dont have the .. reference to anywhere in the code .
Is there any other reason why this does not work ? .I have tried everything including the settings of the IIS , searching the code , etc ... ALso cannot find a solution in any newsgroups on the net.
Cannot use a leading .. to exit above the top directory.
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.Web.HttpException: Cannot use a leading .. to exit above the top directory.
I actually fixed my problem. I can't remember exactly what the solution was (I'll try to double-check).
I think it ended up being that I had a .CSS file in a theme directory which got automatically added to the Page. It didn't jive with the URL rewriting, unfortunately.
I confirmed my suspicions. My problem was the way ASP.NET resolved the URL of the CSS file in the Theme directory. I simply moved the CSS file elsewhere so it wouldn't be automatically referenced (in the wrong way) and everything was fine.
I also recall that I could examine the HTML output of the page in the development environment and it had the defective reference, though it didn't manifest itself as a server-crasher until I moved the app to a Win 2k3 machine (in my case, there was a secondary
mechanism of referencing the CSS file so I was none-the-wiser for a while). My point is that if you have a local develpment copy of the app, examine the problem Page and it should give you a clue about what's going wrong.
I tried changing the .css file from the themes folder ,but still the same error exists, only for my aspx pages.I have some asp pages also in the same site,and all of them work,none of the aspx pages work with this error .
Could there be any other reason ? I tried everything mentioned in all newsgroups , but none worked..
Yes... Thanks , I could identify the problem line from the HTML produced by the problem pages . It was traced to a line in the global.asax . I corrected it and it works now.
BoulderBum
Contributor
3019 Points
610 Posts
"Cannot use a leading .. to exit above the top directory."
Aug 22, 2006 10:19 PM|LINK
I have a weird problem with a site that doesn't face issues in development using Cassini, but crashes hard when deployed to an IIS 6.0. Windows 2003 server.
Basically, I'm using a rewriting engine and everything goes fine if, say, I have a URL like this:
www.site.com/products.list
...but when I append a page number to the end like this:
www.site.com/products.list/2
ASP.NET blows up and gives me this the error at the bottom of the post.
I know there are some issues with URL rewriting in ASP.NET 2.0 as described here:
http://todotnet.com/archive/0001/01/01/7472.aspx?Pending=true
But this actually doesn't apply to me. I'm seeing the error when browsing to the site with internet explorer!
Is there something wrong with using numbers at the end of a URL with IIS 6.0?
Again here's the error info:
Server Error in '/' Application.
Cannot use a leading .. to exit above the top directory.
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.Web.HttpException: Cannot use a leading .. to exit above the top directory.
Source Error:
Stack Trace:
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
jeff@zina.co...
All-Star
87677 Points
11637 Posts
Moderator
Re: "Cannot use a leading .. to exit above the top directory."
Aug 24, 2006 08:43 PM|LINK
What is the actual rewrittent URL? What do the IIS logs show for the request?
Jeff
BoulderBum
Contributor
3019 Points
610 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Aug 24, 2006 10:07 PM|LINK
The actual rewritten url for a URL like: www.site.com/products.list/2 would be: www.site.com/list.aspx?type=products&page=2.
Looking at the event logs for the server, I can see an application warning providing much of the same exception information as above and noting that the URL is (paraphrased) www.site.com/list.aspx?type=products&page=2 with a request path of: /list.aspx.
I suppose it's logical that somehow, something that ASP.NET rewrites is referencing a resource like ../../resource but first: I don't know why it would be doing that as I override the form to remove the action and I don't use any ResolveUrl() functions and second: it works perfectly with the Cassini server on Windows XP Pro!
anpat
Member
15 Points
3 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Oct 17, 2006 02:47 AM|LINK
hi ,
i get the same message .i checked the entire code , i dont have the .. reference to anywhere in the code .
Is there any other reason why this does not work ? .I have tried everything including the settings of the IIS , searching the code , etc ... ALso cannot find a solution in any newsgroups on the net.
Cannot use a leading .. to exit above the top directory.
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.Web.HttpException: Cannot use a leading .. to exit above the top directory.
Source Error:
[No relevant source lines]BoulderBum
Contributor
3019 Points
610 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Oct 17, 2006 04:09 AM|LINK
I actually fixed my problem. I can't remember exactly what the solution was (I'll try to double-check).
I think it ended up being that I had a .CSS file in a theme directory which got automatically added to the Page. It didn't jive with the URL rewriting, unfortunately.
BoulderBum
Contributor
3019 Points
610 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Oct 17, 2006 09:21 PM|LINK
I confirmed my suspicions. My problem was the way ASP.NET resolved the URL of the CSS file in the Theme directory. I simply moved the CSS file elsewhere so it wouldn't be automatically referenced (in the wrong way) and everything was fine.
I also recall that I could examine the HTML output of the page in the development environment and it had the defective reference, though it didn't manifest itself as a server-crasher until I moved the app to a Win 2k3 machine (in my case, there was a secondary mechanism of referencing the CSS file so I was none-the-wiser for a while). My point is that if you have a local develpment copy of the app, examine the problem Page and it should give you a clue about what's going wrong.
anpat
Member
15 Points
3 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Oct 20, 2006 12:58 AM|LINK
I tried changing the .css file from the themes folder ,but still the same error exists, only for my aspx pages.I have some asp pages also in the same site,and all of them work,none of the aspx pages work with this error .
Could there be any other reason ? I tried everything mentioned in all newsgroups , but none worked..
Please HELP !!!!
BoulderBum
Contributor
3019 Points
610 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Oct 20, 2006 02:47 AM|LINK
anpat
Member
15 Points
3 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Oct 22, 2006 03:56 AM|LINK
Yes... Thanks , I could identify the problem line from the HTML produced by the problem pages . It was traced to a line in the global.asax . I corrected it and it works now.
Thanks again for the help.........
BoulderBum
Contributor
3019 Points
610 Posts
Re: "Cannot use a leading .. to exit above the top directory."
Oct 23, 2006 02:21 AM|LINK