question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[5.3.17] Issue with a view Rendering and the RenderingModel Sitecore class

See original GitHub issue

Last week I had an issue : https://github.com/mikeedwards83/Glass.Mapper/issues/371 and your last version fixed it.

Unfortunately your last version give me an error related to the LazyObjectInterceptor if I inspect my stacktrace.

[NullReferenceException]
   Castle.Proxies.RenderingModelProxy.get_Item_callback() +16
   Castle.Proxies.Invocations.RenderingModel_get_Item.InvokeMethodOnTarget() +39
   Castle.DynamicProxy.AbstractInvocation.Proceed() +109
   Glass.Mapper.Pipelines.ObjectConstruction.Tasks.CreateConcrete.LazyObjectInterceptor.Intercept(IInvocation invocation) in C:\TeamCity\buildAgent\work\9693a2d38f55a4a\Source\Glass.Mapper\Pipelines\ObjectConstruction\Tasks\CreateConcrete\LazyObjectInterceptor.cs:107
   Castle.DynamicProxy.AbstractInvocation.Proceed() +443
   Castle.Proxies.RenderingModelProxy.get_Item() +163
   ASP._Page_Views_Shared__BlocContenuFondGrisAvecCoinBouton_cshtml.Execute() in C:\Inetpub\wwwroot\IA\Website\Views\Shared\_BlocContenuFondGrisAvecCoinBouton.cshtml:10
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +251
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +147
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +121
   System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) +135
   Sitecore.Mvc.Presentation.ViewRenderer.Render(TextWriter writer) +314

[InvalidOperationException: Error while rendering view: '/Views/Shared/_myView.cshtml' (model: 'Castle.Proxies.RenderingModelProxy, DynamicProxyGenAssembly2').
]

Model.Item (of type RenderingModel) throw an exception in my view.

This was not the case with the version 5.3.15.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mikeedwards83commented, May 17, 2019

In release 5.4.21

0reactions
mikeedwards83commented, May 17, 2019

Hi,

I have pushed a fix into the develop branch. I will create a release later today to fix this issue.

Thanks

Mike

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sitecore MVC : Error while rendering view
The problem occurs most likely when your rendering parameters template does not inherit from the default rendering parameters template that defines fields ...
Read more >
- Errors in logs - ViewRenderings expects RenderingModel ...
Hello,. Recently I came across issue on prod system, My logs there contains errors as below: 4020 16:03:27 ERROR Application error. Exception: System.Web....
Read more >
Releases
5.3.17. ISSUE 370 The lazy object inceptor will now ignore class ... the view requires a Glass model but is passed the Sitecore...
Read more >
Rendering Model differences in Sitecore 8.2 vs 9.1
In Sitecore 9.1.1, this exact same view and rendering definition item create an unhandled exception: The model item passed into the dictionary ...
Read more >
View Rendering Error - mvc
I am stuck in one issue. While browsing to a new sitecore item created like http://sc92/newpage I am getting the below error. Error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found