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 '/'."?
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.
Are you running the application while index.cshtml is open? Remove from the "/Views/Pracas/Index.cshtml address bar"
– George Wurthmann
George, I’m trying to run with F5. I removed the bar information and it didn’t work. I updated the image.
– Luis
If your controller calls
PracasController
within theMapRoute
should indicate this and notHome
– Barbetta
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 } );
– Luis
I managed to solve it, my controller was like "Pracascontroller", so I switched to "Pracas" and it worked.
– Luis
Thank you George Wurthmann and Barbetta for their help!
– Luis
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.
– Jean_Pinhal