Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created June 1, 2013 10:13
Show Gist options
  • Save wullemsb/5689903 to your computer and use it in GitHub Desktop.
Save wullemsb/5689903 to your computer and use it in GitHub Desktop.
To integrate WCF service in your ASP.NET MVC project, add the following routing info to your routeconfig file
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//Extra ignores to support WCF in ASP.NET MVC
routes.IgnoreRoute("{resource}.svc/{*pathInfo}");
routes.IgnoreRoute("{resource}.svc");
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment