Copied to clipboard

Flag this post as spam?

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


  • Stefan 117 posts 215 karma points
    Aug 24, 2013 @ 18:42
    Stefan
    0

    Fails to load razor script when also accessing related nodes

    I'm experiencing some errors when navigating to pages that have related nodes. I have followed this great article to be able to access the nodes that have been picked from another node (http://24days.in/umbraco/2012/who-picked-this/).

    The error is only showing when a node is actually picked (and published) regarding if the current page is the one that has the picker or if its the node picked.

    The error is noticeable by an razor macro not loading provided by the package MultiLanguage tools (http://our.umbraco.org/projects/website-utilities/multi-language-tools). It could potentially be a bug in this package, but because of the nature of the error I don't think it's the actual cause.

    Here is what I see when providing the query string ?umbDebugShowTrace=true:

    Error Loading Razor Script (file: ) An item with the same key has already been added.    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
    at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
    at ASP.MultiLanguage.Functions.GetChildren(Int32 id, Relation[] relations)
    at ASP.MultiLanguage.Functions.GetUrlsAndLanguages(Int32 nodeid)
    at ASP._Page_macroscripts_MultiLanguage_LanguageSwitcher_LSM_cshtml.Execute() in c:\Users\Stefan\Documents\My Web Sites\LSM\macroScripts\MultiLanguage\LanguageSwitcher\LSM.cshtml:line 3
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
    at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
    at System.Web.WebPages.WebPage.ExecutePageHierarchy()
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
    at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer)
    at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
    at System.Web.WebPages.WebPageBase.Write(HelperResult result)
    at ASP._Page_App_Data_TEMP_Razor_inline_16e7cb6c0c341e497d5191837ee956eb_cshtml.Execute() in c:\Users\Stefan\Documents\My Web Sites\LSM\App_Data\TEMP\Razor\inline-16e7cb6c0c341e497d5191837ee956eb.cshtml:line 1
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
    at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
    at System.Web.WebPages.WebPage.ExecutePageHierarchy()
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
    at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
    at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
    Error loading MacroEngine script (file: , Type: ''
    An item with the same key has already been added.
    at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
    at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
    at ASP.MultiLanguage.Functions.GetChildren(Int32 id, Relation[] relations)
    at ASP.MultiLanguage.Functions.GetUrlsAndLanguages(Int32 nodeid)
    at ASP._Page_macroscripts_MultiLanguage_LanguageSwitcher_LSM_cshtml.Execute() in c:\Users\Stefan\Documents\My Web Sites\LSM\macroScripts\MultiLanguage\LanguageSwitcher\LSM.cshtml:line 3
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
    at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
    at System.Web.WebPages.WebPage.ExecutePageHierarchy()
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
    at System.Web.WebPages.WebPageBase.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer)
    at System.Web.WebPages.HelperResult.WriteTo(TextWriter writer)
    at System.Web.WebPages.WebPageBase.Write(HelperResult result)
    at ASP._Page_App_Data_TEMP_Razor_inline_16e7cb6c0c341e497d5191837ee956eb_cshtml.Execute() in c:\Users\Stefan\Documents\My Web Sites\LSM\App_Data\TEMP\Razor\inline-16e7cb6c0c341e497d5191837ee956eb.cshtml:line 1
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
    at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
    at System.Web.WebPages.WebPage.ExecutePageHierarchy()
    at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
    at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
    at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
    at umbraco.macro.loadMacroScript(MacroModel macro)
    at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId)

    Any help is greatly appreciated! Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft