Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Dan Evans 629 posts 1016 karma points
    Nov 08, 2012 @ 13:52
    Dan Evans
    0

    Error when editing razor files

     

    I've just started getting this error when trying to edit .cshtml files through Umbraco on 4.9.1

    Server Error in '/' Application.
    The extension for the current file 'macroScripts\test.c' is not of an allowed type for this editor. This is typically controlled from either the installed MacroEngines or based on configuration in /config/umbracoSettings.config

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 08, 2012 @ 17:49
    Jan Skovgaard
    0

    Hi Dan

    Is the file extension saved correctly? Seems it's missing an s so it says test.cs - or is that a part of the issue? that test.cs is being seen as test.c when editing from the backoffice?

    /Jan

  • Dan Evans 629 posts 1016 karma points
    Nov 08, 2012 @ 17:51
    Dan Evans
    0

    The files are saved fine as .cshtml. They can be edited via VS and work on the front end fine. So yes the issue appears to be that backoffice is seeing them as .c files.

    They have all worked up until recently which is what is so odd.

  • Dan Evans 629 posts 1016 karma points
    Nov 13, 2012 @ 15:39
    Dan Evans
    0

    I've just upgraded to 4.10 and am still getting this error. 

  • Dan Evans 629 posts 1016 karma points
    Nov 13, 2012 @ 16:15
    Dan Evans
    1

    Found the source. I had a URL rewrite to so that Umbraco would handle .html files but it was also picking up .cshtml files. Fix is to add in \ before .html

    <add name="html_net2"

                   redirect="Domain"

                   ignoreCase="true" rewriteUrlParameter="IncludeQueryStringForRewrite"

                   virtualUrl="http://domain.co.uk/(.*)\.html"

                   redirectMode="Permanent"

                   destinationUrl="http://www.aperfectcv.co.uk/$1" />

Please Sign in or register to post replies

Write your reply to:

Draft