0

Locally the website works fine, when deployed to azure we get the view index or its master was not found or no view engine supports the searched locations.

Routeconfig

        public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "websitename",
            url: "",
             defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }

        );
        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
             defaults: new { controller = "{controller}", action = "{action}", id = UrlParameter.Optional }

        );

We are using angularjs and having no problems until deployed to azure other than this issue.

user1552172
  • 614
  • 1
  • 9
  • 27
  • Possible duplicate of [The view or its master was not found or no view engine supports the searched locations](http://stackoverflow.com/questions/18273416/the-view-or-its-master-was-not-found-or-no-view-engine-supports-the-searched-loc) – Claies Oct 13 '15 at 01:51

1 Answers1

0

You define following for home page right?

routes.MapRoute(
        name: "DoransData",
        url: "",
         defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }

    );

Change it to

routes.MapRoute(
        name: "DoransData",
        url: "{controller}/{action}/{id}",
         defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }

    );

Based on your code I think that you could only need following code

public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );

    }
Lewis Hai
  • 1,114
  • 10
  • 22