I have an Azure Web Role project, which was recently MVC'd by another developer. According to the developer, the application works without problems when it runs on it (i.e., as a simple web application). However, when I try to run it in the context of the Azure cloud service, I see several 404 errors. I suspect that something is wrong with the routing. Here's a shortened version of the current RegisterRoutes method, which is part of Global.asax.cs:
public static void RegisterRoutes(RouteCollection routes){ routes.IgnoreRoute("{Services}/{*pathInfo}"); routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Configuration", "Configuration", new { controller = "Configuration", action = "Index" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Account", action = "Index", id = "" } );}
When the application starts, the correct view from the action of the index of the account controller will be displayed. However, if I try to proceed to Configuration, I get 404. Convertible if I change the method to this:
public static void RegisterRoutes(RouteCollection routes){ routes.IgnoreRoute("{Services}/{*pathInfo}"); routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Account", "Account", new { controller = "Account", action = "Index" } ); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Configuration", action = "Index", id = "" } );}
I get the correct view from the action of the index of the configuration controller, but I can not go to the view of the account.
I suppose this is a simple problem to solve, but not knowing what was done for MVC, the Azure application and the new one for MVC, I hit my head against the wall.
Here is the machine configuration where I am facing this problem: Windows 7 Ultimate with IIS 7.0 Visual Studio 2008 SP1 ASP.NET MVC 1.0 Windows Azure SDK 1.0
Thoughts?