0

I've published on Azure a .NET Framework 4.8 web application (which front end is made in Vue.js 2). If I go to https://XXX.azurewebsites.net/ it shows an error page with the following message:

"Server Error in '/' Application. The resource cannot be found."

Instead if I add index.html in the path (https://XXX.azurewebsites.net/index.html) I can see the login page of my web app. How can I avoid to add index.html in the url?

4
  • 2
    Hi ! Have you set the default page (index.html) in your website configuration ? Perhaps it's something else. Please have a look at stackoverflow.com/a/40704310/4698373 Commented Sep 24, 2021 at 10:21
  • Hi @Philippe, yes, I have index.html in the default documents list Commented Sep 24, 2021 at 10:45
  • Sorry @andref94 if it is a poor additional question, but don't you have to select one of them in the list ? Or perhaps a routing issue in your web app configuration. The working direct access to your page via its url, means that the code inside seems to be correct. Commented Sep 24, 2021 at 11:05
  • It's a simple list, I can't select one of the items. index.html is the only file of the ones in the list that I also have in my project folder. While developing on my pc I can access the webapp from localhost:8080 without index.html in the path, so I don't think that it's a routing problem Commented Sep 24, 2021 at 13:16

1 Answer 1

1

I found out that the problem was caused by a configuration of the mvc application. In global.asax file there is a call to a static method:

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

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

I've removed the MapRoute method call and everything has started working as expected

Sign up to request clarification or add additional context in comments.

1 Comment

"route or no route" ;) Glad to read you pointed out the origin of the issue. It sounds like it will help other people.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.