Asp.Net System.Web.Routing won't route URL unless .aspx in on the end

谁说胖子不能爱 提交于 2019-12-05 21:03:28

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:49463/site.dev/products/keylessentrykits

When I changed it to: http://localhost:49463/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.

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.

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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!