1

If I create a new MVC web application project, build and run it the home page comes up as expected. However, if you change the project's Web Properties to use a "Virtual Path" that contains a dot (for example: "Version1.2"), it will fail to work ("The resource cannot be found.").

What options are there?

Jason Berkan
  • 8,734
  • 7
  • 29
  • 39
jbierling
  • 681
  • 6
  • 12

2 Answers2

0

If the URL is automatically generated you could add a slash at the end of the url. Ending the URL with a slash prevents the routing system from trying to look it up as a file even though the last component of the URL contains a dot.

For example, use this URL :

http://www.example.com/version1.2/

Kevin Coulombe
  • 1,517
  • 1
  • 17
  • 35
0

Using something else instead of a dot, maybe? ;)

Custom Route class

You could write custom route class and provide you own functionality that will be able to consume URLs with dots. But be warned: writing a custom Route class requires a bit deeper understanding of Asp.net routing than just routes.MapRoute().

I've done a custom Route class in the past. It serves a different purpose, but you can check it out. Maybe it will lighten things up a bit for you. Click this link and check it out.

Community
  • 1
  • 1
Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404