If you’ve ever built a custom module where it compiled without error and then you attempt to put it on a page and the whole thing just freezes up? Maybe you edited the extension settings of an existing module because you were trying to make it compliant with all your new “standards.” Only to have a module that was working suddenly through a bizarre “Value cannot be null” error.
The problem might just be the Business Class Controller.
The Problem
When you select the module to put on a page, it starts to load but the page freezes with either an outline of a box, or floating box you can’t place on the page. When you close out of this error and check the page settings you see, under Page Settings -> Advanced, the module is listed as it should be, but won’t load on the page.
The entry in the Admin Logs looks something like this:
AbsoluteURL:/Default.aspx DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke ExceptionGUID:e4bf933c-d899-4125-ae6a-620663a6aab8 AssemblyVersion: PortalId:-1 UserId:-1 TabId:-1 RawUrl: Referrer: UserAgent: ExceptionHash:RT8QxMlAlRRJPlcjalwtKqaV3LQ= Message:Value cannot be null. Parameter name: type StackTrace: at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at DotNetNuke.UI.Skins.Pane.IsVesionableModule(ModuleInfo moduleInfo) at DotNetNuke.UI.Skins.Pane.InjectModule(ModuleInfo module) at DotNetNuke.UI.Skins.Skin.InjectModule(Pane pane, ModuleInfo module) InnerMessage: InnerStackTrace: Source:mscorlib FileName: FileLineNumber:0 FileColumnNumber:0 Method:
The problem is possibly in the Business Controller Class field of the Extension Settings.
The Solution
Navigate to Extensions in the DNN admin menu. Edit the extension. Select the Extension Settings tab. Look for the Business Controller Class field.
If the entry in that field doesn’t point to an actual available class and dll, it will cause an error.
The Business Controller Class should be in the format of {Namespace.ClassName}, {Assembly}. The Assembly is the name of the dll without the dll extension. If you’re dll is MyDll.dll, you enter “MyDll”.
If, for some reason, you can’t get to the Extension Settings, open the table DesktopModules and enter NULL in the BusinessControllerClass field for the modules that you use.
Conclusion
Hopefully this helped. If you have any questions, feel free to ask in the comments.