asp.net - 未找到 View 'Index' 或其主视图或没有 View 引擎支持搜索的位置。在 IIS 8.5 上部署 MVC5/MVC4 后

标签 asp.net asp.net-mvc asp.net-mvc-4 iis asp.net-mvc-5

我从模板 2013 VS 创建了 MVC 5 应用程序。如果我从 VS 运行它,它就可以工作。
enter image description here

我使用发布和文件部署到我的文件夹,并在 IIS 上设置了新池:v4,集成。

enter image description here

比我使用这个池创建了新站点

enter image description here

我重新启动 IIS,但是如果我运行应用程序,我会收到错误消息,说它找不到我的 View 。

enter image description here

我的文件夹包含 View

enter image description here

我的功能设置如下:

enter image description here

我也有 MVC 4 的问题,但我得到了这样的页面。

enter image description here

在我的 RouteConfig.cs 中是这样的:

namespace MVC5
{
    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 }
            );
        }
    }
}

也许我的 feutures 不适合 IIS feautures,但我对此感到迷茫。
谢谢你的帮助。

最佳答案

我相信正确答案应该是给用户IIS_IUSRS进入您的 Web 文件夹的完全权限,mvc5在你的情况下
IIS_IUSRS是 IIS 工作进程帐户的组

See this answer for more info

enter image description here

然后确保应用程序使用 apppoolidentity 使用应用程序池

enter image description here

enter image description here

关于asp.net - 未找到 View 'Index' 或其主视图或没有 View 引擎支持搜索的位置。在 IIS 8.5 上部署 MVC5/MVC4 后,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27885957/

相关文章:

asp.net-mvc - 向 ASP MVC 添加 Controller 工厂

c# - 像 "home.asp"这样的 url 在 mvc 中重定向

c# - Crystal Reports 转换为 HTML 并作为正文在邮件中发送?

javascript - 使用 jquery 启用/禁用对 radio 选择的控制

html - ASP :TextBox with TextMode ="MultiLine" Wrap ="True" will not wrap

c# - 存储可以循环编辑的列表?

c# - 我可以使用 PrincipalContext() 从 Active Directory 获取用户部门吗

asp.net - 如何在 Azure 中启动 ASP.Net 状态服务

c# - 选择具有相同过滤器的多个子列

c# - MVC Razor 柱模型为空