简体   繁体   中英

The view 'Index' or its master was not found or no view engine supports the searched locations. After deploy MVC5/MVC4 on IIS 8.5

I created MVC 5 application from template 2013 VS. If I run it from VS it works. 在此输入图像描述

I used publish and file deploy to my folder and on IIS I setup new pool: v4, integrated.

在此输入图像描述

than I created new site using this pool

在此输入图像描述

I restart IIS but if I run app I get error which is saying that it can't find my Views.

在此输入图像描述

My folder contains views

在此输入图像描述

My feautures is set like this:

在此输入图像描述

I have problem with MVC 4 also but I get page like this.

在此输入图像描述

In my RouteConfig.cs is this coud:

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 }
            );
        }
    }
}

Maybe my feutures are not set good for IIS feautures but I'm lost with this. Thanks for any help.

I believe the correct answer should be to give the user IIS_IUSRS full permission into your web folder, mvc5 in your case

IIS_IUSRS is the group for IIS Worker Process Accounts

See this answer for more info

在此输入图像描述

and then sure that the application is using an application pool using the apppoolidentity

在此输入图像描述

在此输入图像描述

Finaly I found where was my problem.

Path to my deployed folder was: "C:\\Users\\Anton\\Downloads\\MVC5d"

But probably IIS is not happy with path located in folder "Users" .

I moved it into "C:\\MyProjects\\MVC5d" and everything is working now.

Your steps looks good - I don't see any problem. Try it on different pc or reinstall win.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM