-1

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 plain .html 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
  • 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

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.

Anyone have a clue as to what the issue could be?

1 Answer 1

0

Did you add the application to the server as a virtual directory or an application? If you add as a virtual directory than the server won't execute and will instead just serve it as files.

3
  • It's a virtual directory, but so is the sister site, and that's not having any issue with dynamic content.
    – Bluesky
    Mar 25, 2014 at 20:57
  • Try recreating as an application. I ran into a similar problem a few weeks ago and recreating as an application fixed it for me.
    – Charlie
    Mar 25, 2014 at 20:58
  • While I wait for our hosting company to set up headers for your suggestion, does it make any difference if I tell you that .aspx files serve fine out of the virtual directory? If it wasn't serving dynamic content, that would fail too, wouldn't it?
    – Bluesky
    Mar 26, 2014 at 13:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .