Developer forum

Forum » Development »  Error in razor template

Error in razor template

Ivan Marijanović
Ivan Marijanović
Reply

Hi guys,

When I look at live site Event viewver I see "Error in razor template", but cannot understand where error happend. How can I find out where erro is?

This is Log content:

2019-04-07 05:28:55.513: Error in razor template. System.Threading.ThreadAbortException: Thread was being aborted.
at Dynamicweb.Frontend.Content.GetModuleOutput(Paragraph paragraph, PageView pageview)
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at CompiledRazorTemplates.Dynamic.afdabedbdbc.<RenderModule>b__c(TextWriter __razor_helper_writer)
at RazorEngine.Templating.TemplateWriter.WriteTo(TextWriter writer)
at RazorEngine.Templating.TemplateBase.WriteTo(TextWriter writer, TemplateWriter helper)
at CompiledRazorTemplates.Dynamic.afdabedbdbc.<>c__DisplayClass1.<RenderContent>b__0(TextWriter __razor_helper_writer)
at RazorEngine.Templating.TemplateWriter.WriteTo(TextWriter writer)
at RazorEngine.Templating.TemplateBase.Write(TemplateWriter helper)
at CompiledRazorTemplates.Dynamic.afdabedbdbc.Execute()
at RazorEngine.Templating.TemplateBase.RazorEngine.Templating.ITemplate.Run(ExecuteContext context)
at RazorEngine.Templating.TemplateService.Run(ITemplate template, DynamicViewBag viewBag)
at RazorEngine.Templating.TemplateService.Parse(String razorTemplate, Object model, DynamicViewBag viewBag, String cacheName)
at RazorEngine.Razor.Parse[T](String razorTemplate, T model, DynamicViewBag viewBag, String cacheName)
at Dynamicweb.Rendering.Template.RenderRazorTemplate()

 

Ivan


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

ThreadAbortException typically doesn't happen direclty in your code, but later in the processing pipeline. it's usually causd by a Response.Redirect. Do you calls to that in your templates?

Imar

Votes for this answer: 1
 
Ivan Marijanović
Ivan Marijanović
Reply

Hi Imar

Thank you for your answer. 

I dont use it in Tempalte but have OnExtranetLogin watcher that redirects user after he logs in!

Ivan

 
Nicolai Pedersen
Reply

On a side not, this exception is not logged in 9.6 when redirect happens in templates.

 
Ivan Marijanović
Ivan Marijanović
Reply

I was still unable to find reason for this error. I checked my redirects and they look ok! From error I do not see in which template or file error happend.

Ivan

   
Ivan Marijanović
Ivan Marijanović
Reply

Thanx.

So it's not an error but exception that I can forget about.

Ivan

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Yep. And one that DW should forget about too which apparently is the case since 9.6.

 
Nicolai Pedersen
Reply

Yes, we changed the event viewer to not log this exception.

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I'm on 9,15 and still see tons of ThreadAbortException records:

 

Is there a setting or so I am missing to suppress these?

Imar

 

You must be logged in to post in the forum