The view Index or master was not found azure deployment issue

964 Views Asked by At

I am new to Azure Deployment. I have an ASP.NET MVC app running fine locally working fine. Trying to deploy it on Azure. Using a BitBucket repository to create the app. But accessing it gives

The view 'Index' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/User/Index.aspx
~/Views/User/Index.ascx
~/Views/Shared/Index.aspx
~/Views/Shared/Index.ascx
~/Views/User/Index.cshtml
~/Views/User/Index.vbhtml
~/Views/Shared/Index.cshtml
~/Views/Shared/Index.vbhtml

I have used Kudu Console to check that the D:\home\site\repository has every bit of the project. But D:\home\site\wwwroot misses controllers etc.

I think that it access wwwroot directory as the project directory. But I am not sure about that.

Any pointers to actual issue and solution are highly appreciated.

1

There are 1 best solutions below

1
On BEST ANSWER

I have used Kudu Console to check that the D:\home\site\repository has every bit of the project. But D:\home\site\wwwroot misses controllers etc.

As I known, for classical (regardless of .NET Core applications) ASP.NET MVC Website, the Controllers would compiled into the .DLL file with the name of your web application. You could find it under D:\home\site\wwwroot\bin via KUDU.

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

Since your website could work locally, I assumed that there be something wrong with the web content you deployed to Azure. You could try to check the *.cshtml files have been deployed to Azure (under D:\home\site\wwwroot\Views) successfully via KUDU.

Also, please make sure the Build Action of your views has been configured as "Content" as follows:

Also, for deploying apps to Azure Web App, you could follow this official document.