cshtml files causing 404 on web site

J Trahair

New member
Jul 24, 2012
Programming Experience
Hi. I've done a tutorial in ASP.net, the pages have .cshtml extensions. It works fine using IIS on localhost - the pages show fine. I uploaded all files and folders correctly, but I get a 404.3:

HTTP Error 404.3 - File or directory not found: MIME map policy prevents this request. Internet Information Services (IIS)

My ISP says 'the hosting account is on Windows servers, the ASP.NET is version 4.'
I attach a zip of the tutorial site. Try http://www.foreversoftware.co.uk/web.../Movies.cshtml
I know that .cshtml files aren't normal .html files, but that's what the instructions for uploading said!
What have I missed?


  • WebPagesMovies.zip
    1.2 MB · Views: 75
I would say they haven't installed MVC, this may help you iis6 - What exactly needs done to IIS 6 to serve cshtml pages? - Stack Overflow
What I would look into if ISP won't update, from that thread:
- Add Deployable Dependencies
- web.config settings
- MIME mappings

I have deployed a Razor site myself, that webhost supported Razor right out of the box though. The account is inaccessible to me right now, so I can't check the existing IIS settings there.
Here's a screenshot of the handler mappings for .cshtml, I didn't find any other IIS settings related to cshtml on that server.


If you don't have IIS remote admin access the equivalent web.config settings can be added like this: How to: Register HTTP Handlers
Top Bottom