Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. enter image description here

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

enter image description here

than I created new site using this pool

enter image description here

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

enter image description here

My folder contains views

enter image description here

My feautures is set like this:

enter image description here

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

enter image description here

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.

like image 620
tonco Avatar asked Jan 01 '26 21:01

tonco


2 Answers

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

enter image description here

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

enter image description here

enter image description here

like image 147
Frank Fu Avatar answered Jan 03 '26 09:01

Frank Fu


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.

like image 26
tonco Avatar answered Jan 03 '26 11:01

tonco



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!