I have a host on which I hosted a webpage with an extension .cshtml. My host is arvixe.com, which provides ASP and .NET hosting, but when I try to load my webpage, I get this error message.
Server error in application "/".
This page type is not served.
Description. The type of page requested is not served because it is explicitly prohibited. The .cshtml extension may be incorrect. Check out the URL below and make sure it is spelled correctly.
Requested URL: /samples/WoT/Default.cshtml
Version Information: Microsoft.NET Framework Version: 4.0.30319; ASP.NET Version: 4.0.30319.276
I read something that I need to write something in the web.config file so that it works like this
<compilation>
<assemblies>
<add assembly="System.Web.WebPages.Razor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
<buildProviders>
<add extension=".cshtml" type="System.Web.WebPages.Razor.RazorBuildProvider, System.Web.WebPages.Razor"/>
</buildProviders>
</compilation>
But I tried everything, inserted it in different lines, nothing worked. What am I missing or doing wrong?
source
share