2

I'm trying to get an ASP.NET WebPages (Not MVC) site up and running with IIS 6, but I can't get it to serve .cshtml pages - It just spits back a 404 error every time. I've confirmed that it can serve .html and .aspx pages with no problem. So far, I've done the following:

  • Install ASP.NET 4.0 (aspnet_regiis -i)
  • Configure site to use ASP.NET 4.0 (aspnet_regiis -s ...)
  • Allow ASP.NET v4.0 Web Service Extension
  • Map aspnet_isapi.dll as handler for .cshtml files in Application Configuration (And as a wildcard mapping, no dice)
  • Add .cshtml to MIME types in Application Configuration
  • Ensure only ASP.NET 4.0 applications are in the app pool
  • Add <modules runAllManagedModulesForAllRequests="true" /> to web.config
  • Ensure that necessary .dll's are in the site's bin folder
  • Give "Everyone" group full control of the site folder and subfolders

I have a working site on the same framework that I set up a while back (And failed to document my process, lesson learned), so I tried exporting that site's config, creating a new site from file, and pointing it at the proper directory for the new site, but I'm still getting a 404.

I know that there are a whole lot of IIS/ASP.NET questions out there already, but every one I've seen is either not applicable to my situation (A lot of the MVC ones), or was solved by one or more of the things I've already tried.

Anyone have a clue as to what could be causing this?

Bluesky
  • 123
  • 1
  • 9
  • I have edited your title. Please see, "[Should questions include “tags” in their titles?](http://meta.stackexchange.com/questions/19190/)", where the consensus is "no, they should not". – John Saunders Mar 25 '14 at 21:39
  • @JohnSaunders, appreciated, but the fact that it's IIS 6 is relevant, so I've added it back to the title in non-tag form. – Bluesky Mar 26 '14 at 13:02
  • Installing MVC on the server will make all the necessary files available, even though you are not using MVC. http://www.asp.net/mvc/mvc4 – johna Apr 01 '14 at 02:03

1 Answers1

0

CSHTML is templated page served by the Razor engine. Try opening an ASPX Page. For serving cshtml, you need the Razor Engine configured.

Also, CSHTML are served differently based on the Routing configuration

Raja Nadar
  • 9,409
  • 2
  • 32
  • 41
  • ASPX page serves fine as well. I'm aware that CSHTML is served by the Razor engine. What configuration needs to be done other than including System.Web.Razor.dll and System.Web.WebPages.Razor.dll in my bin folder? The functioning sister site didn't require any Razor config. – Bluesky Mar 26 '14 at 12:56
  • just to confirm your app pool is .net 4.0 integrated right? also, do you see any ForbiddenHandlers for your cshtml extensions in IIS? – Raja Nadar Mar 26 '14 at 17:24
  • here is a SO link with more details: http://stackoverflow.com/questions/5900066/what-exactly-needs-done-to-iis-6-to-serve-cshtml-pages – Raja Nadar Mar 26 '14 at 17:32