November Happy Hour will be moved to Thursday December 5th.

@Html.AlternateLinks() is filling up my logfile

Vote:
 

Hi!

We started to use @Html.AlternateLinks() on a website.

For the most part it works just perfectly, but it's also filling up the logfiles. Been trying to google the problem but can't find anything I can use. Does anyone here know why and what I can do to avoid it?

Stacktrace

System.ArgumentNullException: Parameter has no value set
Parameter name: contentLink
   at EPiServer.Core.Internal.DefaultContentRepository.GetLanguageBranches[T](ContentReference contentLink)
   at EPiServer.Web.Internal.AlternateLinksRenderer.GetAlternateLanguages(ContentReference contentLink)
   at EPiServer.Web.Internal.AlternateLinksRenderer.Render(ContentReference contentLink, String action)
   at EPiServer.Web.Mvc.Html.AlternateLinksExtensions.AlternateLinks(HtmlHelper html, ContentReference contentLink, String action)
   at ASP.Page_Views_Shared_Layouts_Root_cshtml.Execute() in d:\DLAPI\www.com\Views\Shared\Layouts_Root.cshtml:line 30
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
   at System.Web.Mvc.WebViewPage.ExecutePageHierarchy()
   at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
   at System.Web.WebPages.WebPageBase.<>c_DisplayClass3.<RenderPageCore>b_2(TextWriter writer)
   at System.Web.WebPages.WebPageBase.Write(HelperResult result)
   at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
   at System.Web.WebPages.WebPageBase.PopContext()
   at System.Web.WebPages.WebPageBase.<>c_DisplayClass3.<RenderPageCore>b_2(TextWriter writer)
   at System.Web.WebPages.WebPageBase.Write(HelperResult result)
   at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
   at System.Web.WebPages.WebPageBase.PopContext()
   at System.Web.WebPages.WebPageBase.<>c_DisplayClass3.<RenderPageCore>b_2(TextWriter writer)
   at System.Web.WebPages.WebPageBase.Write(HelperResult result)
   at System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body)
   at System.Web.WebPages.WebPageBase.PopContext()
   at System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilterRecursive(IList`1 filters, Int32 filterIndex, ResultExecutingContext preContext, ControllerContext controllerContext, ActionResult actionResult)
   at System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c_DisplayClass21.<BeginInvokeAction>b_1e(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
   at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
   at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

/Jocke

#206848
Sep 02, 2019 11:00
Vote:
 

Update: EPi Version 10.9.1.0

#206849
Sep 02, 2019 11:04
Vote:
 

Hi Jocke,

Could you please send the real code that's using @Html.AlternateLinks ? in your layout (d:\DLAPI\www.com\Views\Shared\Layouts_Root.cshtml:line 30)

Are you using it like: @Html.AlternateLinks()? (Without param contentLink?) then it's cause null reference exception?

// Ha Bui

#206859
Sep 02, 2019 13:36
Jocke Pihlström - Sep 06, 2019 9:54
Thanks Ha Bui! Your answer did put me on the right track. We actually had a few pages using the layout that was outside the epi context.
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.