Couldn’t Load Menu Style Admin/Menus/DNNAdmin

On new install of DNN6 I received the error “Couldn’t Load Menu Style Admin/Menus/DNNAdmin“.

A fuller error message is given below, including the reference to admin/Menus/DNNAdmin and the often included, somewhat unhelpful object reference not set.

An error has occurred. DotNetNuke.Services.Exceptions.ModuleLoadException:
 Couldn't load menu style 'admin/Menus/DNNAdmin': System.NullReferenceException: Object reference not set to an instance of an object.
 at DotNetNuke.Web.DDRMenu.DNNCommon.DNNContext.get_ModuleFolder()
 at DotNetNuke.Web.DDRMenu.DNNCommon.PathResolver.Resolve(String path, RelativeTo[] roots)
 at DotNetNuke.Web.DDRMenu.MenuBase.Instantiate(String menuStyle) ---> System.ApplicationException: Couldn't load menu style 'admin/Menus/DNNAdmin': System.NullReferenceException: Object reference not set to an instance of an object.
 at DotNetNuke.Web.DDRMenu.DNNCommon.DNNContext.get_ModuleFolder()
 at DotNetNuke.Web.DDRMenu.DNNCommon.PathResolver.Resolve(String path, RelativeTo[] roots)
 at DotNetNuke.Web.DDRMenu.MenuBase.Instantiate(String menuStyle)
 at DotNetNuke.Web.DDRMenu.MenuBase.Instantiate(String menuStyle)
 at DotNetNuke.Web.DDRMenu.SkinObject.OnPreRender(EventArgs e) --- End of inner exception stack trace ---

Although I was logged into the website, as a host user, there was no control panel menu for the site.

Clicking on the SuperUser Account link to edit profile details gave a page with simply the error message in the centre.

Looking in the file directory /admin/Menus/DNAdmin showed only two files:

  • DNNAdmin.xslt
  • DNNAdmin-menudef.xml

Reviewing a DNN7 installation to compare there was the same content.

Comparing the two files DNNAdmin.xslt has some differences. For example at line 78 in the failing DNN6 version there is the line

<xsl:comment>We are gonna need to add localization support here</xsl:comment>&cr;
<span>
<xsl:value-of select="@text"/> Features</span>

In the newer DNN7 installation this is shown as:

<span>
<xsl:value-of select="@text"/>
<xsl:text> </xsl:text>
<xsl:value-of select ="ddr:GetString('MenuTitleSuffix.Text','~/admin/ControlPanel/App_LocalResources/RibbonBar.ascx.resx')"/>
</span>

Following this change the error was still present.

Searching on the Internet I found a suggest to copy the reported resource into the module directory for installation. Directory referenced is /install/module

The URL to trigger the install is:

localhost/dnn6/install/install.aspx?mode=InstallResources

This was on a test installation, the website is run locally on the server and the files in the the virtual directory labelled as dnn6.