У меня проблема с необязательным предложением регулярных выражений (\ .ashx)? в маршруте ASP.NET MVC
routes.IgnoreRoute("resizer\\.debug(\\.ashx)?");
routes.IgnoreRoute("[^?]+\\.(psd|bmp|gif|exif|png|tif|tiff|tff|jpg|jpeg|jpe|jif|jfif|jfi)(\\.ashx)?");
Я получаю ошибку
The route URL cannot start with a '/' or '~' character and it cannot contain a '?' character.
Parameter name: routeUrl
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.ArgumentException: The route URL cannot start with a '/' or '~' character and it cannot contain a '?' character.
Parameter name: routeUrl
[ArgumentException: The route URL cannot start with a '/' or '~' character and it cannot contain a '?' character.
Parameter name: routeUrl]
System.Web.Routing.RouteParser.Parse(String routeUrl) +21953
System.Web.Routing.Route.set_Url(String value) +12
System.Web.Routing.Route..ctor(String url, IRouteHandler routeHandler) +9
System.Web.Mvc.RouteCollectionExtensions.IgnoreRoute(RouteCollection routes, String url, Object constraints) +106
System.Web.Mvc.RouteCollectionExtensions.IgnoreRoute(RouteCollection routes, String url) +6
MvcApplication2.MvcApplication.RegisterRoutes(RouteCollection routes) in C:\Users\Administrator\Documents\resizer\Tests\Hidden\MvcApplication2\Global.asax.cs:15
MvcApplication2.MvcApplication.Application_Start() in C:\Users\Administrator\Documents\resizer\Tests\Hidden\MvcApplication2\Global.asax.cs:29
Как вы делаете необязательные группы регулярных выражений в маршрутах MVC?