Editor trying to load cshtml macroscripts as .c.aspx
I've got a live site running on Umbraco 6.1.6. I was able to edit the razor macro files on the staged as well as the production site. It's been running for a few months and no changes have been made to the site; but now it's trying to load all the .cshtml files in the editor as files with the extension c.aspx. For each of them I get the error message shown below:
The extension for the current file 'macroScripts\ProductDisplay.c.aspx' 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
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Umbraco.Core.IO.FileSecurityException: The extension for the current file 'macroScripts\ProductDisplay.c.aspx' 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
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[FileSecurityException: The extension for the current file 'macroScripts\ProductDisplay.c.aspx' 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]
Umbraco.Core.IO.IOHelper.ValidateFileExtension(String filePath, List`1 validFileExtensions) +151
umbraco.cms.presentation.developer.editPython.OnInit(EventArgs e) +216
System.Web.UI.Control.InitRecursive(Control namingContainer) +140
I'm not sure that the answer is to adjust the config to allow this file extension because the files do still have the correct extension of cshtml. I think the issue is that something is telling the editor to pull them in with .c.aspx extension.
I've tried:
-touching web.config
-touching global.aspx
-looking through config files for a place this extension is set
-adding cshtml to this line in the umbraco config (although I think this is for the js files) <scriptFileTypes>js,xml,cshtml</scriptFileTypes>
I have not updated the version of the site at any time or added any packages that weren't there to begin with.
I think your extenstion on your Razor files is wrong. When I created Razor files in Umbraco I always use .cshtml (Razor Macro Engine), and when I create files like this the files gets the extenstion of .cshtml. From whatyou write your Razor has the extenstion c.aspx
So what I think you should do is rename the extenstion from c.aspx to cshtml.
You could try to create a razor file through the Umbraco UI in the backoffice, and see if you can edit the file in Umbraco.
Thank you for the suggestion. I verified the files all end in cshtml. When I create a new file it creates it correctly as a cshtml but I immediatly cannot edit it because I get the same error.
Editor trying to load cshtml macroscripts as .c.aspx
I've got a live site running on Umbraco 6.1.6. I was able to edit the razor macro files on the staged as well as the production site. It's been running for a few months and no changes have been made to the site; but now it's trying to load all the .cshtml files in the editor as files with the extension c.aspx. For each of them I get the error message shown below:
The extension for the current file 'macroScripts\ProductDisplay.c.aspx' 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
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: Umbraco.Core.IO.FileSecurityException: The extension for the current file 'macroScripts\ProductDisplay.c.aspx' 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
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
I'm not sure that the answer is to adjust the config to allow this file extension because the files do still have the correct extension of cshtml. I think the issue is that something is telling the editor to pull them in with .c.aspx extension.
I've tried:
-touching web.config
-touching global.aspx
-looking through config files for a place this extension is set
-adding cshtml to this line in the umbraco config (although I think this is for the js files) <scriptFileTypes>js,xml,cshtml</scriptFileTypes>
I have not updated the version of the site at any time or added any packages that weren't there to begin with.
Any help is appreciated. Thanks!
-Hilary
Hi BSS and welcome to our.
I think your extenstion on your Razor files is wrong. When I created Razor files in Umbraco I always use .cshtml (Razor Macro Engine), and when I create files like this the files gets the extenstion of .cshtml. From what you write your Razor has the extenstion c.aspx
So what I think you should do is rename the extenstion from c.aspx to cshtml.
You could try to create a razor file through the Umbraco UI in the backoffice, and see if you can edit the file in Umbraco.
Hope this helps,
/Dennis
Hello Dennis,
Thank you for the suggestion. I verified the files all end in cshtml. When I create a new file it creates it correctly as a cshtml but I immediatly cannot edit it because I get the same error.
Thanks,
-Hilary
is working on a reply...