Server Error in '/' Application.

String "166409" is not a valid udi.

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: System.FormatException: String "166409" is not a valid udi.

Source Error:


Line 6:    //var root = Model.Content.AncestorOrSelf(2).Children.Where(x => x.IsVisible());
Line 7:    //var currentPage = @CurrentPage;
Line 8:    var mediaId = Model.Content.Value<IPublishedContent>("GalleryMainLocation");
Line 9:    if (mediaId != null)
Line 10:   {

Source File: D:\domains\counties-2022\html\Views\MacroPartials\rblGallery.cshtml    Line: 8

Stack Trace:


[FormatException: String "166409" is not a valid udi.]
   Umbraco.Core.Udi.ParseInternal(String s, Boolean tryParse, Boolean knownTypes, Udi& udi) in D:\a\1\s\src\Umbraco.Core\Udi.cs:156
   Umbraco.Core.Udi.Parse(String s) in D:\a\1\s\src\Umbraco.Core\Udi.cs:91
   System.Linq.WhereSelectArrayIterator`2.MoveNext() +145
   System.Linq.Buffer`1..ctor(IEnumerable`1 source) +284
   System.Linq.Enumerable.ToArray(IEnumerable`1 source) +90
   Umbraco.Core.Models.PublishedContent.PublishedPropertyType.ConvertSourceToInter(IPublishedElement owner, Object source, Boolean preview) in D:\a\1\s\src\Umbraco.Core\Models\PublishedContent\PublishedPropertyType.cs:210
   Umbraco.Web.PublishedCache.NuCache.Property.GetInterValue(String culture, String segment) in D:\a\1\s\src\Umbraco.Web\PublishedCache\NuCache\Property.cs:192
   Umbraco.Web.PublishedCache.NuCache.Property.GetValue(String culture, String segment) in D:\a\1\s\src\Umbraco.Web\PublishedCache\NuCache\Property.cs:211
   Umbraco.Web.PublishedPropertyExtension.Value(IPublishedProperty property, String culture, String segment, Fallback fallback, T defaultValue) in D:\a\1\s\src\Umbraco.Web\PublishedPropertyExtension.cs:39
   Umbraco.Web.PublishedContentExtensions.Value(IPublishedContent content, String alias, String culture, String segment, Fallback fallback, T defaultValue) in D:\a\1\s\src\Umbraco.Web\PublishedContentExtensions.cs:177
   ASP._Page_Views_MacroPartials_rblGallery_cshtml.Execute() in D:\domains\counties-2022\html\Views\MacroPartials\rblGallery.cshtml:8
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in D:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:25
   Umbraco.Web.Mvc.ControllerExtensions.RenderViewResultAsString(ControllerBase controller, ViewResultBase viewResult) in D:\a\1\s\src\Umbraco.Web\Mvc\ControllerExtensions.cs:80
   Umbraco.Web.Macros.PartialViewMacroEngine.Execute(MacroModel macro, IPublishedContent content) in D:\a\1\s\src\Umbraco.Web\Macros\PartialViewMacroEngine.cs:98
   Umbraco.Web.Macros.<>c__DisplayClass17_0.<ExecuteMacroOfType>b__0() in D:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:342
   Umbraco.Web.Macros.MacroRenderer.ExecuteProfileMacroWithErrorWrapper(MacroModel macro, String msgIn, Func`1 getMacroContent, Func`1 msgErr) in D:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:313
   Umbraco.Web.Macros.MacroRenderer.ExecuteMacroWithErrorWrapper(MacroModel macro, String msgIn, String msgOut, Func`1 getMacroContent, Func`1 msgErr) in D:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:272
   Umbraco.Web.Macros.MacroRenderer.ExecuteMacroOfType(MacroModel model, IPublishedContent content) in D:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:339
   Umbraco.Web.Macros.MacroRenderer.Render(MacroModel macro, IPublishedContent content, IDictionary pageElements) in D:\a\1\s\src\Umbraco.Web\Macros\MacroRenderer.cs:245
   Umbraco.Web.UmbracoComponentRenderer.RenderMacro(IPublishedContent content, String alias, IDictionary`2 parameters) in D:\a\1\s\src\Umbraco.Web\UmbracoComponentRenderer.cs:131
   Umbraco.Web.UmbracoComponentRenderer.RenderMacro(Int32 contentId, String alias, IDictionary`2 parameters) in D:\a\1\s\src\Umbraco.Web\UmbracoComponentRenderer.cs:102
   ASP._Page_Views_rblCountyContentPage_cshtml.<Execute>b__3_1() in D:\domains\counties-2022\html\Views\rblCountyContentPage.cshtml:29
   System.Web.WebPages.<>c__DisplayClass42_0.<RenderSection>b__0(TextWriter tw) +414
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +108
   ASP._Page_Views_branch_layout_cshtml.<Execute>b__3_3() in D:\domains\counties-2022\html\Views\branch_layout.cshtml:485
   System.Web.WebPages.<>c__DisplayClass42_0.<RenderSection>b__0(TextWriter tw) +414
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +108
   ASP._Page_Views_rbl_layout_2022_cshtml.Execute() in D:\domains\counties-2022\html\Views\rbl_layout_2022.cshtml:77
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +252
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +148
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +122
   System.Web.WebPages.<>c__DisplayClass40_0.<RenderPageCore>b__0(TextWriter writer) +309
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +108
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +89
   System.Web.WebPages.WebPageBase.PopContext() +310
   System.Web.WebPages.<>c__DisplayClass40_0.<RenderPageCore>b__0(TextWriter writer) +309
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +108
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +89
   System.Web.WebPages.WebPageBase.PopContext() +310
   Umbraco.Web.Mvc.ProfilingView.Render(ViewContext viewContext, TextWriter writer) in D:\a\1\s\src\Umbraco.Web\Mvc\ProfilingView.cs:25
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +378
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +91
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult) +795
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +81
   System.Web.Mvc.Async.<>c__DisplayClass3_1.<BeginInvokeAction>b__1(IAsyncResult asyncResult) +188
   System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginExecuteCore>b__152_1(IAsyncResult asyncResult, ExecuteCoreState innerState) +29
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +52
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +39
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
   System.Web.Mvc.<>c.<BeginProcessRequest>b__20_1(IAsyncResult asyncResult, ProcessRequestState innerState) +43
   System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +73
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +651
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +220
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +134


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4700.0