After moving a 4.7.1.1 solution to a new server, we got problems with these razor statements:
var mediaItem = Model.MediaById(item.Element("slideshowImage").Value); DynamicMedia media = new DynamicMedia(item.Element("slideshowImage").Value);
They throw an error saying:
Error Loading Razor Script (file: Front Page Slideshow) 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 umbraco.MacroEngines.DynamicMedia..ctor(String mediaId) at ASP._Page_macroScripts_FrontPageSlideShow_cshtml.Execute() in d:\web\tican.dk\www\macroScripts\FrontPageSlideShow.cshtml:line 28 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)
There's an API that can be called to regenerate media cache / examine indexes, but since this seems to be just a slideshow that we're talking about. Go to the media section and resave each slideshow media item.
DynamicMedia and Model.MediaById not working
Hi,
After moving a 4.7.1.1 solution to a new server, we got problems with these razor statements:
var mediaItem = Model.MediaById(item.Element("slideshowImage").Value);
DynamicMedia media = new DynamicMedia(item.Element("slideshowImage").Value);
They throw an error saying:
Check to make sure that the media cache has been generated.
One thing you can do to see if it's the cache would be to go to the media item in question and "save" it. Then check to see if the code now works.
Hi,
Thanks for your answer. How do i check to see, if the media cache has been generated?
There's an API that can be called to regenerate media cache / examine indexes, but since this seems to be just a slideshow that we're talking about. Go to the media section and resave each slideshow media item.
its actually all images
is working on a reply...