I have an Evoq Content site on which we're in the process of testing the upgrade from version 6.2.7 to version 7.2.2. In testing creating new sites/portals, I'm seeing the error message
"Object reference not set to an instance of an object."
This error isn't logged when it's thrown, but I was able to reproduce the behavior locally and attach a debugger to figure out where it's coming from.
The
AddPortalAlias
method of the PortalAliasController
is using its _dataProvider
field to add the portal alias, and _dataProvider
is null
. Now, the _dataProvider
is readonly
with an initializer that calls DataProvider.Instance()
, so, unless I'm missing something, the only way that _dataProvider
can be null
is for DataProvider.Instance()
to return null
then the instance of PortalAliasController
is instantiated. In 7.2.2, it's getting instantiated via TestablePortalAliasController.Instance
, which uses a Lazy<IPortalAliasController>
to ensure that the instance is only created once. It certainly seems possible that the instance was created before the component factory was initialized with the DataProvider
instance. (As a side note, this is the only method in the PortalAliasController
which uses this field, the others just call DataProvider.Instance()
directly).
I've tested this in another instance, and didn't see the same result (and I can't believe that this wouldn't have been noticed by anyone else), so I'm sure that there's something in my environment that's causing this issue with initialization. So, my question is: does anyone have any ideas as to what I could check to figure out why I'm (consistently) getting this error?
One thing that I have tried was matching my web.config's <modules>
section with a working site, to make sure the initialization difference wasn't coming from there.