I have looked through other posts but none seem to answer what I need.
In my case I set webpages:Enabled to true under appSettings:
webpages:Enabled
true
appSettings
According to post: what is the function of webpages:Enabled in MVC 3 web.config, this prevents files in the Views folder from being directly accessible from a web browser.