Razor Examine.ExamineManager exception when invoking new DynamicMedia
I'm getting the following error on the production server:
Error
Loading Razor Script (file: Homepage Main) The type initializer for
'Examine.ExamineManager' threw an exception. at
Examine.ExamineManager.get_Instance() at umbraco.MacroEngines.ExamineBackedMedia.GetUmbracoMedia(Int32 id) at umbraco.MacroEngines.DynamicBackingItem..ctor(Int32 Id) at umbraco.MacroEngines.DynamicNode..ctor(String NodeId) at ASP._Page_macroScripts_HomepageMain_cshtml.Execute() 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)
The UmbracoManager.GetNodesForTreeListPicker(Model.LastProjects) method is implemented as following:
public static DynamicNodeList GetNodesForTreeListPicker(dynamic treeListProperty) { var nodes = new DynamicNodeList(); foreach (DynamicXml dynamicXml in treeListProperty) { var dynamicNode = new DynamicNode(dynamicXml.InnerText); nodes.Add(dynamicNode); } return nodes; }
Can anybody please help, cause locally it's working, and in the production environment it is not.
The production environment is a shared hosting environment running in medium trust.
The web.config settings are NOT set with requiredPermission="false"
Examine is not compatible with Umbraco 4.8. http://umbraco.codeplex.com/releases/view/92481. There is a workaround for uComponents but that is not the same as Examine and I am getting a long way from being able to use an image I chose in MediaPicker on my site.
My stack trace (the beginning) was
Error Loading Razor Script (file: Tg Profile Image) The type initializer for 'Examine.ExamineManager' threw an exception. at Examine.ExamineManager.get_Instance() at umbraco.MacroEngines.ExamineBackedMedia.GetUmbracoMedia(Int32 id) at umbraco.MacroEngines.Library.RazorLibraryCore.MediaById(Int32 Id) at umbraco.MacroEngines.Library.RazorLibraryCore.MediaById(String Id) at umbraco.MacroEngines.DynamicNode.MediaById(String Id) at ASP._Page_macroScripts_tgProfileImage_cshtml.Execute() in c:\Websites\UmbracoSites\Todd
which is mystifying as I wasn't even using Examine to start with.
Razor Examine.ExamineManager exception when invoking new DynamicMedia
I'm getting the following error on the production server:
Error Loading Razor Script (file: Homepage Main) The type initializer for 'Examine.ExamineManager' threw an exception. at Examine.ExamineManager.get_Instance()
at umbraco.MacroEngines.ExamineBackedMedia.GetUmbracoMedia(Int32 id)
at umbraco.MacroEngines.DynamicBackingItem..ctor(Int32 Id)
at umbraco.MacroEngines.DynamicNode..ctor(String NodeId)
at ASP._Page_macroScripts_HomepageMain_cshtml.Execute()
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)
This is the Razor code:
foreach (DynamicNode projectNode in UmbracoManager.GetNodesForTreeListPicker(Model.LastProjects))
{
<div class="wrapper border-bot img-indent-bot">
@{
if (!UmbracoManager.IsFieldEmpty(projectNode.GetPropertyValue("ImageOverview")))
{
var imageCarousel1 = new DynamicMedia(projectNode.GetPropertyValue("ImageOverview"));
<figure class="img-indent">
<a href="@projectNode.Url">
<img src="@imageCarousel1.Url(185)" alt="@projectNode.GetPropertyValue("PageTitle")" />
</a>
</figure>
}
}
<div class="extra-wrap">
<h4>
@projectNode.GetPropertyValue("PageTitle")</h4>
@projectNode.GetPropertyValue("PageIntroduction") <a class="link-1" href="@projectNode.Url">Lees meer</a>
</div>
</div>
}
The UmbracoManager.GetNodesForTreeListPicker(Model.LastProjects) method is implemented as following:
public static DynamicNodeList GetNodesForTreeListPicker(dynamic treeListProperty)
{
var nodes = new DynamicNodeList();
foreach (DynamicXml dynamicXml in treeListProperty)
{
var dynamicNode = new DynamicNode(dynamicXml.InnerText);
nodes.Add(dynamicNode);
}
return nodes;
}
Can anybody please help, cause locally it's working, and in the production environment it is not.
The production environment is a shared hosting environment running in medium trust.
The web.config settings are NOT set with requiredPermission="false"
<section name="Examine" type="Examine.Config.ExamineSettings, Examine" />
<section name="ExamineLuceneIndexSets" type="UmbracoExamine.Config.ExamineLuceneIndexes, UmbracoExamine" />
Thanks in advance for the help
Robbert
Robert,
Try rebuilding your internal index you can install the Examine manager package http://our.umbraco.org/projects/developer-tools/examine-dashboard if you have not already done so. I have seen this issue before looks like your index is corrupt.
Regarsd
Ismail
Examine is not compatible with Umbraco 4.8. http://umbraco.codeplex.com/releases/view/92481. There is a workaround for uComponents but that is not the same as Examine and I am getting a long way from being able to use an image I chose in MediaPicker on my site.
My stack trace (the beginning) was
Error Loading Razor Script (file: Tg Profile Image) The type initializer for 'Examine.ExamineManager' threw an exception. at Examine.ExamineManager.get_Instance()
at umbraco.MacroEngines.ExamineBackedMedia.GetUmbracoMedia(Int32 id)
at umbraco.MacroEngines.Library.RazorLibraryCore.MediaById(Int32 Id)
at umbraco.MacroEngines.Library.RazorLibraryCore.MediaById(String Id)
at umbraco.MacroEngines.DynamicNode.MediaById(String Id)
at ASP._Page_macroScripts_tgProfileImage_cshtml.Execute() in c:\Websites\UmbracoSites\Todd
which is mystifying as I wasn't even using Examine to start with.
is working on a reply...