Asp Net application does not run

Asked

Viewed 47 times

0

Someone could explain to me why, when running my application on Asp Net it does not run, presenting the message "Server Error in Application '/'."?

Error screen: inserir a descrição da imagem aqui

File Routeconfig.Cs:

 namespace Praca_Projeto
{
    public class RouteConfig
    {
        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 }
            );
        }
    }
}

My controller calls Pracascontroller.

Could someone please tell me where the problem is? I’ve changed the controller name in Routeconfig but it didn’t work.

  • 1

    Are you running the application while index.cshtml is open? Remove from the "/Views/Pracas/Index.cshtml address bar"

  • George, I’m trying to run with F5. I removed the bar information and it didn’t work. I updated the image.

  • 1

    If your controller calls PracasController within the MapRoute should indicate this and not Home

  • I changed the way you said, and it’s still the same mistake. Maproute looks like this: Routes.Maproute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Pracascontroller", action = "Index", id = Urlparameter.Optional } );

  • I managed to solve it, my controller was like "Pracascontroller", so I switched to "Pracas" and it worked.

  • Thank you George Wurthmann and Barbetta for their help!

  • It could be an error in IIS Express, right click and Exit on IIS, next to Windows clock. Another thing is running on MS Edge instead of Chrome that brings many debugging problems.

Show 2 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.