Microsoft Razor

Discussion in 'General troubleshooting' started by EricDaugherty, Apr 4, 2011.

  1. I built a simple MS Razor site but I just get a directory when I FTP the files and type in my domain name. Is this because there is a default.cshtml and not a default.html? Is so, is there a workaround? If not, I am open to sugestions.

    Thanks
     
  2. Ray

    Ray

    Last edited by a moderator: Oct 14, 2015
  3. I am still getting the followin error. I have updated the DefaultDocument in IIS 7 to accept default.cshtml. I also added a MIME type to set .cshtml as text/html. Any other ideas would be appreciated.

    This type of page is not served.
    Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.cshtml' may be incorrect. Please review the URL below and make sure that it is spelled correctly.

    Requested URL: /default.cshtml
     
  4. Ray

    Ray

    Try adding this in your applications web.config file.

    <system.webServer>
    <security>
    <requestFiltering>
    <fileExtensions>
    <add fileExtension=".cshtml" allowed="true" />
    </fileExtensions>
    </requestFiltering>
    </security>
    </system.webServer>

    Also make sure your application pool is running in Integrated Pipeline mode and not Classic mode. This is set in your Winhost control panel under the Site Info Manager/Integrated Pipeline Mode.
     
    Last edited by a moderator: Oct 14, 2015
  5. Thank you for the update. I added the web.comfig and confirmed the intergrated.

    I also have the Razor .DLLs in a bin folder and in the root.

    I am still seeing the same error. I have uploaded a recular ASP site and it worked fine. Any more suggestions?

    Thank you, thank you very much.
     
  6. Ray

    Ray

    Do you have a link we can look at so we can see the error?
     
  7. Ray

    Ray

    Check, your web.config file and make sure that the requestfiltering element you inputted is not in a section where the element is commented out. Remember, comments start with <!-- and ends with a -->. Anything in between that will not be read by the system.
     

Share This Page