I've lost several hours trying to figure out how to put multiple Modules (as in modules I can select in the 'Add Module' drop-down at the top of a page I'm editing), into a single installation package using the version 5 format of the .dnn manifest file.
I've produced a really simple VS2008 project that has two modules and builds 4 variations of the installation package.
you can find it here:
http://drop.io/damphlett/asset/dnnmul...
I'm really trying to get the 'DNNMultipleModulePackageExample-2C.zip to work - that one has two
component type="module"
sections in it. each with it's own module definition.
What I'm finding is that on installation (into a clean 05.04.01) it creates
two entries in the DesktopModules table. However both have the same FriendlyName - that is the package friendly name from "/dotnetnuke/packages/package/friendlyName" in the manifest, not the friendly name of the desktopModule from "/dotnetnuke/packages/package/components/component[@type='Module']/desktopModule/friendlyName".
I get exceptions on viewing most pages from that point on:
DotNetNuke.Services.Exceptions.ModuleLoadException: An entry with the same key already exists. ---> System.ArgumentException: An entry with the same key already exists. at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) at System.Collections.Generic.SortedList`2.Add(TKey key, TValue value) at DotNetNuke.Entities.Modules.DesktopModuleController.GetPortalDesktopModules(Int32 portalID) at DotNetNuke.UI.ControlPanel.AddModule.LoadModuleList() in C:\inetpub\wwwroot\ScatteredFist\trunk\Admin\ControlPanel\AddModule.ascx.vb:line 266 at DotNetNuke.UI.ControlPanel.AddModule.LoadAllLists() in C:\inetpub\wwwroot\ScatteredFist\trunk\Admin\ControlPanel\AddModule.ascx.vb:line 211 at DotNetNuke.UI.ControlPanel.AddModule.Page_Load(Object sender, EventArgs e) in C:\inetpub\wwwroot\ScatteredFist\trunk\Admin\ControlPanel\AddModule.ascx.vb:line 81 --- End of inner exception stack trace ---
However, if I go into the database and JUST tweak the friendlyName of one of the two DesktopModules to be different (say by adding a 'b' on the end of the second one), everything works fine. They both appear in the drop down list and I can add them independently to pages.
I suggest that using the .dnn package/friendlyName to populate the DesktopModule.friendlyName database field is a bug, and that the .dnn DesktopModule/friendlyName should be used instead (at least if it's specified - maybe package/friendlyName could be a default if it isn't specified at the DesktopModule level)
Of course - it's quite possible I've been a total muppet and done all this wrong - comments, corrections, suggestions much appreciated.