本地环境中的应用程序运行良好,但何时发布 在实时Web服务器上显示
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
答案 0 :(得分:0)
我解决了这个问题。对的,这是可能的。
但是,web.config中未定义默认页面。它必须在App_Start目录中的RouteConfig.cs中指定。像这样:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Account", action = "Login", id = UrlParameter.Optional }
);
正如您所看到的,绝对路径没有cshtml扩展名,因此可以在url浏览器中输入: