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

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

Fix :

Try to make sure that the App Pool Identity that is being used for your application in IIS has required rights to the folders pointing the application.

As we are running IIS 7.5 on Windows Server 2008 R2,we don’t need to do anything to use the new identity. For every newly created application pool, the Identity property of the new application pool is set to ApplicationPoolIdentity by default. The IIS Admin Process normally creates a virtual account with the name of the new application pool and runs the application pool’s worker processes under that account by default.

In our case we changed to run the identity as Network Service (as shown in the below image). Network Service is a built-in Windows identity. It doesn’t require a password and has only user privileges so it is relatively low-privileged. Running as a low-privileged account is always a good security practice because then a software bug can not be used by a malicious user to take over the whole system.

Featured image

Now we need to assign required permissions to network service account on the desired folder pointing to our MVC5 application as shown below :

Featured image

Now you can browse your MVC application without any issues and the problem was with the App Pool Identity security,now fixed by applying the required permissions as required.