Rustam Salakhutdinov
Rustam Salakhutdinov

Reputation: 804

Get server error: "The view 'Index' or its master was not found or no view engine supports the searched locations" ans simple solutios don't work

I've created my site and it is work fine in my local system, but when I download it to server I get this error:

The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:

~/Views/Home/Index.aspx
~/Views/Home/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/Home/Index.cshtml
~/Views/Home/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml

At first look it is easy. Server say me that I don't have specified files, but there is Views\Home\Index.cshtml file in my hosting folder! And as I said before it is work fine in my local system. Also I have controller with Home name.

This is my route config:

        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );

And this is link to the site.

Upvotes: 0

Views: 1542

Answers (2)

Rustam Salakhutdinov
Rustam Salakhutdinov

Reputation: 804

I found my problem: I publish site to local folder and there is all files. But when I copy it to server via FTP there is no my View files. Sorry for extra question!

Upvotes: 1

Earth
Earth

Reputation: 3571

You check with MVC versions between provider server and in your development environment. Then you need to upgrade or downgrade the version as same on both.

Upvotes: 1

Related Questions