During an update from DNN 4.9.5 to DNN 6x we experienced:
All pages with HTML blank when logged out, but show this error logged in.
Error: Services is currently unavailable.DotNetNuke.Services.Exceptions.ModuleLoadException: The type initializer for ‘DotNetNuke.Modules.Html.DataProvider’ threw an exception. —> System.TypeInitializationException: The type initializer for ‘DotNetNuke.Modules.Html.DataProvider’ threw an exception. —> System.InvalidCastException: Unable to cast object of type ‘DotNetNuke.Modules.HTML.SqlDataProvider’ to type ‘DotNetNuke.Modules.Html.DataProvider’. at DotNetNuke.Modules.Html.DataProvider.CreateProvider() — End of inner exception stack trace — at DotNetNuke.Modules.Html.WorkflowStateController.GetWorkflows(Int32 PortalID) at DotNetNuke.Modules.Html.HtmlTextController.GetWorkflow(Int32 ModuleId, Int32 TabId, Int32 PortalId) at DotNetNuke.Modules.Html.HtmlModule.OnInit(EventArgs e) — End of inner exception stack trace —
In our case, the upgrade left 2 things behind that DNN 6 did not like.
- in the app_code directory, we deleted the ‘HTML’ folder (since it does not seem that it was in use anymore and was potentially conflicting with new html module code)
- in web.config, I removed the following line in the <Codesubdirectories> section
<add directoryName="HTML" />
Save and you are done.