0

A route I had working in VS2010/.NET 4/MVC3 seems broken in VS2012 and .NET 4.5 (although with MVC3 still).

Previously I had a route like this:-

routes.MapRoute("TMS", "{controller}/{action}/{id}.{extension}");

which was successfully matched for a uri:

/Test/Test/tile.png

which invoked the Test action on TestController:-

public ActionResult Test(string id, string extension)

With id = "tile" and extension="png".

Yet, in an identical project in VS2012, albeit with .NET 4.5, I get a 404 because the route does not match. Changing the period to a / in the route, and the uri, causes the route to match and invoke the action, but that's not good enough - i need to have that period in the route, as was working previously (because this action is designed to serve tiles as a TMS server; the URL format is an API).

Has anyone come across a problem like this?

<httpRuntime relaxedUrlToFileSystemMapping="true"/> does not help at all.

slippyr4
  • 852
  • 7
  • 18

1 Answers1

0

I wonder if the web server settings are different between the 2 environments you are testing: If the .png extension is not set up to be handled by MVC or the "verify that physical file exists" option is checked.

Jose Paul
  • 11
  • 1