views:

257

answers:

3

I have a weird problem with routing. I have an existing website that I am trying to add this to. It works, but only if .aspx is on the end of the URL. If I remove the .aspx, it gives me an error: "The resource cannot be found." I created a quick test website and copied the code over to it, it works just fine. The code between the 2 are identical. Both are running on the VS 2008 web server. I just don't get it. Any ideas?

Thanks, Vincent

A: 

I think you need to set the ISAPI dll to handle all files (i.e. add a wildcard). It's working because it's set to handle .aspx.

IainMH
I am only using the built-in web server in VS 2008.
vincentw56
+1  A: 

Okay, I found the problem. I don't understand why this caused the problem, but if there is a period (.) anywhere in the URL, it errors.

I had this: http://localhost%3A49463/site.dev/products/keylessentrykits

When I changed it to: http://localhost%3A49463/sitedev/products/keylessentrykits, removing the period between site and dev, it worked fine.

Anyone have a clue to why this is? Is it a bug?

Also, I should have said something before, but this is not an MVC app.

vincentw56
Yeah, I think this is a bug. You should file it - https://connect.microsoft.com/VisualStudio/feedback/
Christopher Edwards
A: 

Thank you kindly for finding the solution and posting it. I have been suffering from the exact same issue and have been trying to get it resolved for days now!

My solution contains several projects: web, business logic, data access, etc. My web project was called "SystemName.WebForms" and when I was compiling and running from Visual Studio's debugging environment only routes that contained a period were being routed properly. Once I renamed my web project to "SystemName_WebForms" all of the routes were processed properly. I highly suspect this is a bug that you discovered.

Many thanks for finding the workaround and having the generosity to post it!

MomentSurfer

MomentSurfer