This is probably a simply routing issue but after a quick google I haven t clicked as to what I am doing wrong with the routing.
When using SignalR the routing MapConnection corrupts the default MVC route renderings.
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.IgnoreRoute("{*favicon}", new { favicon = @"(.*/)?favicon.ico(/.*)?" });
// default MVC
routes.MapRoute("Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
// SignalR routing
routes.MapConnection<EventConnection>("echo", "echo/{*operation}");
In this order I get a 404 when SignalR js client connects to /echo/ url.
If I swap the default MVC and SignalR routing around, the SignalR js client connects to /echo/ url and SignalR functions correctly but the Routes are rewritten incorrectly when rendered to the view i.e.
/echo?action=Index&controller=Home
Am I missing something obvious? I am looking at ExclusionConstraints to exclude the echo path but this seems heavy handed, surely there is a simplier way?
Also, I have tried using Regex contraint like in the following question which doesn t work.
MVC2 Routing with WCF ServiceRoute: Html.ActionLink rendering incorrect links!