Object reference not set to an instance of an object. - Utils.LoadExtensions();

Sep 4, 2012 at 11:01 AM

Hello all,

I was trying to fix an issue with not being able to add a blog to my blogengine 2.5 install, and restarted IIS. Since doing this on every page I am greated with this....


Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error: 

Line 97:                 if (_initializedAlready) { return; }
Line 98: 
Line 99:                  Utils.LoadExtensions();
Line 100:                _initializedAlready = true;
Line 101:            }

Source File: e:\inetpub\Shearwell New\Global.asax    Line: 99 

Stack Trace: 

[NullReferenceException: Object reference not set to an instance of an object.]
   BlogEngine.Core.Providers.XmlBlogProvider.StorageLocation(ExtensionType extensionType) in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Providers\XmlProvider\DataStore.cs:122
   BlogEngine.Core.Providers.XmlBlogProvider.LoadFromDataStore(ExtensionType extensionType, String extensionId) in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Providers\XmlProvider\DataStore.cs:46
   BlogEngine.Core.DataStore.ExtensionSettingsBehavior.GetSettings(ExtensionType extensionType, String extensionId) in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\DataStore\ExtensionSettingsBehavior.cs:29
   BlogEngine.Core.DataStore.SettingsBase.GetSettings() in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\DataStore\SettingsBase.cs:50
   BlogEngine.Core.Web.Extensions.ExtensionManager.DataStoreExtension(String name) in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Web\Extensions\ExtensionManager.cs:403
   BlogEngine.Core.Web.Extensions.ExtensionManager.LoadExtensions() in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Web\Extensions\ExtensionManager.cs:461
   BlogEngine.Core.Web.Extensions.ExtensionManager.ExtensionEnabled(String extensionName) in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Web\Extensions\ExtensionManager.cs:108
   BlogEngine.Core.Utils.b__20(SortedExtension x) in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Utils.cs:1050
   System.Linq.WhereListIterator`1.MoveNext() +58
   BlogEngine.Core.Utils.LoadExtensions() in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Utils.cs:1050
   ASP.FirstRequestInitialization.Initialize(HttpContext context) in e:\inetpub\Shearwell New\Global.asax:99
   ASP.global_asax.Application_BeginRequest(Object source, EventArgs e) in e:\inetpub\Shearwell New\Global.asax:68
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +148
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75


I am struggling to see what I've done wrong. As part of debugging I commented that line out to see what happened. The blog loaded ok, but it was like a fresh install, no theme applied, no titles, no settings, nothing.

Can anyone help me find where to start looking please? I don't think it's my source that's gone funny, more like me editing blog.xml in App_Data or something that's caused this.


Thank you very much

Sep 4, 2012 at 2:14 PM

You can disable all extensions to see if it will help, but it looks like it's trying to load data from corrupted xml file. Or object schema changed and differ from what serialized into xml.

Sep 4, 2012 at 3:36 PM

Thank you rtur.

I got a working copy from my source control and couldn't see much difference. I think it was probably a corrupted XML file. I'm back up an running again now, thank you for your help :)