mccalltd/AttributeRouting — Issue #29: HTTP 404 Not Found
Author: devmondo
Created: 2011-12-15 20:16:21+00:00
State: open

Hi,

awesome library, that i cant work without it anymore, thanks so much for you for giving us such a tool to ease up our lives.

i had my site working fine up until i upgraded to your latest build, now i get
HTTP 404 Not Found

i have made a test by disabling the route attribute temporarily and use normal ASP MVC routing and it is working, so my code is fine.

now i dug a little deeper and found out that if i remove registration to global.asax.cs everything works fine again, so the problem is in the App_Start file that you provide

here is my code in the appstart

[assembly: WebActivator.PreApplicationStartMethod(typeof(MyWebApplication.App_Start.AttributeRouting), "Start")]

namespace Syrianmartyrs.App_Start
{
public static class AttributeRouting
{
public static void RegisterRoutes(RouteCollection routes)
{

routes.MapAttributeRoutes(config =>
{
config.ScanAssembly(Assembly.GetExecutingAssembly());
config.UseLowercaseRoutes = true;
config.AddRoutesFromControllersOfType();
});
}

public static void Start()
{
RegisterRoutes(RouteTable.Routes);
}
}
}