Last post Apr 22, 2019 02:43 AM by KathyW
Apr 20, 2019 12:45 AM|srforecasting|LINK
I am trying to connect to a controller in a .net mvc application that was deployed to subfolders on a hosted website but am failling.
The mvc web application was deployed to the following subfolder on the hosted server
The mvc homecontroller uses the route prefix [RoutePrefix("website/net/Home")]
public class HomeController : Controller
When I try to connect to the Index action method in the HomeController a 404 error is shown.
Both followeing urls fail
Can someone tell me what I am doing wrong.
Do I need to router with a ~ instead?
I do have the route attribute registed in the registerroute method
public static void RegisterRoutes(RouteCollection routes)
Apr 20, 2019 01:22 PM|mgebhard|LINK
Routes are dynamic and not dependent on sub folders. Your app should be deployed to the application root. My best guess is there is some confusing going from localhost IIS and your host.
Also, I don't get the attribute routing. Can you explain the intent?
Apr 22, 2019 02:43 AM|KathyW|LINK
If the application is deployed to a subfolder of your main site, you could convert that folder to an Application (easily done in IIS Manager). That would make that folder the root of the application published in it, and you wouldn't need to try and modify
routing to try and manage being in a subfolder.