I'm trying to use Razor without MVC.. I've created a new ASP.NET Empty Web Application and then installed the following package: Microsoft.AspNet.Razor
I've then got an Index.cshtml
in the root of my directory but when I launch the site I get the following error:
HTTP Error 403.14 - Forbidden
A default document is not configured for the requested URL,
and directory browsing is not enabled on the server.
If I add an Index.html
file it works fine, but I'd like to use Razor. Is there any additional configuration I need to do? My web.config
looks like this:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" />
</system.web>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
I'm using Visual Studio 2013 and IIS Express 8
Note
All I've done is create a new empty web application, left Web API, Web Forms, MVC unchecked, no authentication.
Installed: Microsoft.AspNet.Razor
through nuget.
Created Index.cshtml
page in the root and launched the site locally to reproduce the error.