I've setup an ASP.NET MVC 2 site several times on our test system on IIS 6. I'm fine with having to use the .aspx extension on controllers. The Global.asax.cs file looks like this:
public static void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.html/{*pathInfo}");
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
"Default",
"{controller}.aspx/{action}/{id}",
new { controller = "Account", action = "LogOn", id = UrlParameter.Optional }
);
routes.MapRoute(
"Root",
"",
new { controller = "Account", action = "LogOn", id = "" }
);
}
Other than this, deployment is pretty basic. I copied the files to the server, created a new virtual directory in IIS, set Account.aspx as the default document, and clicked ok.
Repeating these same steps for production doesn't work. It seems like IIS 6/ASP.NET doesn't want to route correctly (even thought it did so just fine on our test server).
My url looks like this:
http://_server_name:90/<IS APPLICATION NAME/Account
The site load with the basic IIS 'site cannot be found'. The url has been changed to look like:
http://_server_name>:90/IIS APPLICATION NAME/CustomErrorView?aspxerrorpath=/_APPLICATION_NAME_/Account.aspx/Logon
(underscores begin and end place holder values and are not literall开发者_运维技巧y in the url).
CustomErrorView is a view I created for custom errors to forward to (including 404's).
Both servers are running windows 2003. Any thoughts?
Try making a Webform page that just redirect to your path!! And configure iis to point that page!!!! Let me know if was this scenario
Okay, I'm an idiot. When deploying an asp.net mvc application, it helps to ensure mvc is installed on the server. I installed it through the web platform installer and, presto, everything worked.
Sorry about such a lame question. I was moving to production and the steps I just knew should work didn't work and I sort of panicked.
Thanks for your input Marco. Haven't had a chance to try that solution, but its running now.
精彩评论