Developer forum

Forum » Development » System.NullReferenceException at Template.Output()

System.NullReferenceException at Template.Output()


Reply
Hi

I have a problem in my Dynamicweb solution where i get the following error:

20 13:11:07.279 [7:ERROR] [<Project name>]
System.NullReferenceException: Object reference not set to an instance of an object.
   at Dynamicweb.Templatev2.Template.RequestTags()
   at Dynamicweb.Templatev2.Template.Output()
...


The error does not occur when I use an older version of dynamicweb.dll (product version 18.9.1.1), But when I use either version 19.0.3.0 or the newest version 19.1.0.5, I get the error.

Did any dependencies or the like change in these versions of Dynamicweb which would result in this error when calling Template.Output?


Replies

 
Nicolai Høeg Pedersen
Reply

The call for requesttags inside output is relatively new, and it seems to be the issue.

It depends on a HttpContext which you might not have?

What is the context in which you get the error? Mayeb post the piece of code that makes the call.

 
Reply
Ok. A missing HttpContext makes sense. I was trying to call Output() in a test, which would explain the missing HttpContext.

Good to get an explanation. Thank you.

 

You must be logged in to post in the forum