I've just upgraded a site to 4.11.0 from 4.10.1 and all my razor scripts now give errors - mainly from 2 packages, uBlogsy and CultivContactForm.
On the website, I see (for example): Error loading MacroEngine script (file: CultivContactForm.cshtml)
In the back office, I see:
Server Error in '/' Application.
The extension for the current file
'macroScripts\CultivContactForm.cshtml' 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\CultivContactForm.cshtml' 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\CultivContactForm.cshtml' 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) +244
umbraco.cms.presentation.developer.editPython.OnInit(EventArgs e) +219
System.Web.UI.Control.InitRecursive(Control namingContainer) +140
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +480
I'd really appreciate any input on this so I can get the new version live.
This seems to be fixable by reverting to the umbraco.MacroEngines dll file from 4.10.1, but hopefully someone will look at what's wrong in the 4.11 version.
I have also noticed that I can't create razor scripts at all in 4.11 - my 'Choose a language' combo is empty. Reverting umbraco.MacroEngines didn't help me..
No MacroEngine found for extension 'cshtml' at umbraco.cms.businesslogic.macro.MacroEngineFactory.GetByExtension(String extension) at umbraco.macro.loadMacroScript(MacroModel macro) at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
Changing the umbraco.MacroEngines dll worked for me, but the new file was 1kb bigger than the oldd one.
Guess there will be a fix soon.
Still got one macro tho that's not fully cooperating, but that one broke since I've updated from 4.7 to 4.9 and still broken in 4.11. Could be my own bad code :o. Was some bad code, forgot the to uppercase some letters, so fixed that.
Similar problem. Can't create script under "Scripting Files", choose a language is indeed empty. Added umbraco.MacroEngines.dll from 4.10.0 and added cshtml to <scriptFileTypes>js,xml</scriptFileTypes>
Doing something else wrong, or need to wait for a bugfix?
The "Choose a language" dropdown box is also empty for me. Inline C#/Razor scripts also fail inside of my templates indicating No MacroEngine found for extension 'cshtml' in the Umbraco trace log. Please see this topic for what I did to solve both issues:
Error with all razor scripts in 4.11.0
I've just upgraded a site to 4.11.0 from 4.10.1 and all my razor scripts now give errors - mainly from 2 packages, uBlogsy and CultivContactForm.
On the website, I see (for example): Error loading MacroEngine script (file: CultivContactForm.cshtml)
In the back office, I see:
Server Error in '/' Application.
The extension for the current file 'macroScripts\CultivContactForm.cshtml' 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\CultivContactForm.cshtml' 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'd really appreciate any input on this so I can get the new version live.
Thanks in advance
Allan
This seems to be fixable by reverting to the umbraco.MacroEngines dll file from 4.10.1, but hopefully someone will look at what's wrong in the 4.11 version.
I have also noticed that I can't create razor scripts at all in 4.11 - my 'Choose a language' combo is empty. Reverting umbraco.MacroEngines didn't help me..
Similar problem here.
Error loading MacroEngine script (file: , Type: ''
No MacroEngine found for extension 'cshtml'
at umbraco.cms.businesslogic.macro.MacroEngineFactory.GetByExtension(String extension)
at umbraco.macro.loadMacroScript(MacroModel macro)
at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)
My masterpage file use
<umbraco:Macro Language="cshtml" runat="server">@RenderPage("~/macroscripts/RegisterStyleSheetFile/CurrentCulture.cshtml")</umbraco:Macro>umbracoSettings.config is
<templates> <useAspNetMasterPages>true</useAspNetMasterPages> <defaultRenderingEngine>WebForms</defaultRenderingEngine> </templates>Fixed it after modify umbracoSettings.config, no need to replace umbraco.MacroEngines.dll
<scriptFileTypes>js,xml,cshtml</scriptFileTypes>Changing the umbraco.MacroEngines dll worked for me, but the new file was 1kb bigger than the oldd one.
Guess there will be a fix soon.
Still got one macro tho that's not fully cooperating, but that one broke since I've updated from 4.7 to 4.9 and still broken in 4.11. Could be my own bad code :o. Was some bad code, forgot the to uppercase some letters, so fixed that.
Seems (for me atlleast) like the file-extension check has been implemented.
I found this in umbracoSettings.config witch seems odd since my Razor-scripts is .cshtml
So I added it and looks like it works. Like this:
It appears the umbraco.MacroEngines namespace isn't referenced correctly in 4.11.0. Try adding the following line to Global.asax:
Then, restart your Umbraco application pool in IIS.
Just touch(open, resave) the Global.asax file.
Similar problem. Can't create script under "Scripting Files", choose a language is indeed empty.
Added umbraco.MacroEngines.dll from 4.10.0 and added cshtml to <scriptFileTypes>js,xml</scriptFileTypes>
Doing something else wrong, or need to wait for a bugfix?
I got it working, but I'm not really sure what helped. I tried:
1) referencing <%@ Import Namespace="umbraco.MacroEngines" %> to global.asax
2) removing umraco/create/DLRScripting.ascx (the dialog for selecting script type) and putting it back
3) after installing log manager to check if there is some error i noticed that the script templates and script types are back..
Now i removed reference from global.asax and it still works so maybe simply recycling the pool would do the magic
The "Choose a language" dropdown box is also empty for me. Inline C#/Razor scripts also fail inside of my templates indicating No MacroEngine found for extension 'cshtml' in the Umbraco trace log. Please see this topic for what I did to solve both issues:
http://our.umbraco.org/forum/developers/razor/36894-No-MacroEngine-found-for-extension-'cshtml'
David
I have the same problem with umbraco 4.11.0
I did what "kristofer månsson" posted and it work for me like charm !
You have to allow razor (cshtml) file to be listed as script file, so after you will add in umbracoSettings.config file the cshtml like this:
After this change all the razor files will work and in "Choose a language:" will appear all languages including razor
is working on a reply...