webPages:enabled
with value false
prevents .cshtml
or .vbhtml
files in the Views
folder from being directly accessible from a web browser.
According to documentation it prevents .cshtml and .vbhtml files from being accessed directly (www.myweb.com/views/home/index.cshtml
for example)
To allow Razor pages to be served, it's not enough to set <add key="webpages:Enabled" value="true" />
. You also need to add the Microsoft.AspNet.WebPages package to packages.config
using NuGet.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With