Error 404 when browsing a website using ASP.NET MVC and IIS 10

-2

I'm currently creating a website using ASP.NET MVC. I have multiple links in a page, but none of them are working, they all return a 404 error. The problem is that the page does exist and the action in the controller exists too. Here's the detailed error information given on the error page:

Detailed Error Information:
Module: IIS Web Core
Notification: MapRequestHandler
Handler: StaticFile
Error Code: 0x80070002
Requested URL: http://localhost:80/Monitoring/CheckStatusTaskenvironnementId=1&serviceId=4&taskId=2
Physical Path: C:\ProjectsTfs\idkids\Sprint16\IdKids.Batchs\LifeTest\Monitoring\CheckStatusTask
Logon Method: Anonymous
Logon User: Anonymous

Edit : The previous action wasn't supposed to return a View, I tried with an other one that supposed to return one, and still a 404 error. The detailed error information are the following:

Detailed Error Information:
Module: IIS Web Core
Notification: MapRequestHandler
Handler: StaticFile
Error Code: 0x80070002
Requested URL: http://localhost:80/Monitoring/ViewHistory?environnementId=1&serviceId=1&taskId=1
Physical Path:  C:\ProjectsTfs\idkids\Sprint-16\IdKids.Batchs\LifeTest\Monitoring\ViewHistory
Logon Method: Anonymous
Logon User: Anonymous

As suggested, here's the code that deals with this action in the controller:

public ActionResult ViewHistory(int environnementId, int serviceId, int taskId)
{
    var model = _batchLogBusiness.GetTaskLog(environnementId,serviceId, taskId, false);
    return View(model);
}

and here's the RouteConfig class:

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 = "Monitoring", action = "Index", id = UrlParameter.Optional }
        );
    }
} 
c#
asp.net-mvc
iis-10
asked on Stack Overflow Jul 19, 2018 by Bastien Antoine • edited Jul 19, 2018 by Bastien Antoine

1 Answer

0

Update: I was trying to access to http://localhost:80/Monitoring/ViewHistory but the controller was located under C:\ProjectsTfs\idkids\Sprint-16\IdKids.Batchs\LifeTest\Monitoring\ViewHistory. When trying to access to http://localhost:80/lifetest/Monitoring/ViewHistory (with the appropriated parameters), everything worked.

answered on Stack Overflow Jul 19, 2018 by Bastien Antoine • edited Jul 25, 2018 by Bastien Antoine

User contributions licensed under CC BY-SA 3.0