I’ve created a new Application that points to the files. It is running in ASP.NET 4.0 Integrated App Pool.
The files are just a couple of CSHTML files and some CSS/Javascript.
When the files were HTML I was able to hit them just fine. Now that they are cshtml, I get
This type of page is not served
when I try to hit the Directory/File.cshtml in a browser.
I usually write MVC3 apps, but this is just a simple 2 page site that needs to be up. I’m not familiar with deployment of these types of projects. Any advice would be helpful.
My web.config is simple and looks as follows:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.webServer>
<defaultDocument enabled="true">
<files>
<add value="MyFile.cshtml"/>
</files>
</defaultDocument>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Thanks in advance for your help!
To fix this, install the “ASP.NET MVC 3 (Visual Studio 2010)” package using the “Web Platform Installer” (http://www.microsoft.com/web/downloads/platform.aspx).