Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Null Reference exception DNN Core 5.6.3

Tags:

My site has been running fine for sometime now until recently I see in the event viewer a null reference exception in the DNN core:

DotNetNuke.Common.Globals.GetStatus() in

F:\Builds\Maintenance\WorkingDirectory\Library\Common\Globals.vb:line 1125 at DotNetNuke.Common.Initialize.InitializeApp(HttpApplication app) in F:\Builds\Maintenance\WorkingDirectory\Library\Common\Initialize.vb:line 138 at DotNetNuke.Common.Initialize.Init(HttpApplication app) in F:\Builds\Maintenance\WorkingDirectory\Library\Common\Initialize.vb:line 228 at DotNetNuke.Common.Global.Global_BeginRequest(Object sender, EventArgs e) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

the line 1125 is:

_Status = UpgradeStatus.None

Which is a property of the Globals class and an Enum

Also when this happens it doesnt just do it once then sort its self it does it roughly every minute for an hour or so.

I made sure all dataprovider.instances are either in a using or a try catch finally or self closing(if the reader is not used)

Any suggestion most welcome, as I'm officially lost.

Thanks

like image 838
Matt Avatar asked Jul 26 '11 08:07

Matt


People also ask

How to fix NullReferenceException in c#?

Solutions to fix the NullReferenceException To prevent the NullReferenceException exception, check whether the reference type parameters are null or not before accessing them. In the above example, if(cities == null) checks whether the cities object is null or not.

What is a Null reference exception?

A NullReferenceException exception is thrown when you try to access a member on a type whose value is null . A NullReferenceException exception typically reflects developer error and is thrown in the following scenarios: You've forgotten to instantiate a reference type.

What is DotNetNuke error?

DotNetNuke Error Domain Name Does Not Exist In The Database DotNetNuke supports multiple portals from a single database/codebase. It accomplishes this by converting the URL of the client browser Request to a valid PortalID in the Portals database table.


1 Answers

Similar to what ScottS mentioned, that line is setting a static enum value, so I don't see how a NullReferenceException could be thrown. Indeed, it could be a side-effect from something else.

That particular error is coming from Global.asax BeginRequest, which calls Initialize.Init(app). The only thing I can think of is to check your Http Modules. Both the RequestfilterModule and the UrlRewriteModule (which are default DNN http modules) also call Initialize.Init(app).

Perhaps check your web.config and IIS (particularly if you're running IIS 7) and make sure everything checks out?

like image 134
JonH Avatar answered Nov 16 '22 06:11

JonH