cshtml files causing 404 on web site

J Trahair

New member
Joined
Jul 24, 2012
Messages
2
Programming Experience
10+
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?
 

Attachments

JohnH

C# Forum Moderator
Staff member
Joined
Apr 23, 2011
Messages
811
Location
Norway
Programming Experience
10+
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.
 

J Trahair

New member
Joined
Jul 24, 2012
Messages
2
Programming Experience
10+
Thank you - I added the lines to web.config, still getting a 404. Waiting to hear from my ISP...
 
Top Bottom