Hi,
I recently went to check on my installed portals and noticed that the Export Template part of Host->Portals was coming back with a ModuleLoadException. It appears to be a result of a portion of the 05.00.00.SqlDataProvider not running correctly (on my upgrade at least - can someone from the Core confirm if this is a general issue?). Here's what I discovered, and the fix I applied.
I believe the problem arose out of part of the 05.00.00.SqlDataProvider (lines 933-937) not running as intended. The failure is "silent" and does not produce a message in the log file for 05.00.00.log. That whole section of the script (lines 909-943) have to do with the change of Admin and Host modules to becoming "standard Desktop Modules". Part of that change entailed the moving of the physical code from being under "~/Admin/..." to being under "~/DesktopModules/Admin/...". The script attempts to do the move the location of the controls where the Friendly Name is 'Portals'. The reason that the Export Template (lines 933-937) didn't move is that its Friendly Name was 'Export Template' (even though it was a "subset" of Portals, as appears to be intended by 04.04.00.SqlDataProvider, lines 1138-53).
I was able to confirm the error by running the following script:
select * from ModuleControls where ControlSrc in ('Admin/Portal/Portals.ascx','Admin/Portal/SiteSettings.ascx','Admin/Portal/Template.ascx','Admin/Portal/Signup.ascx')
Running the script returned one row - the Template.ascx that wasn't loading. To fix the error, I ran the following script:
UPDATE ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Portals/Template.ascx',
IconFile = '~/images/icon_sitesettings_32px.gif'
WHERE ControlSrc = 'Admin/Portals/Template.ascx'
After running the script, I went to Host->Host Settings and clicked "Restart Application" at the bottom. When I revisited Host->Portals, everything was fine once again.
I hope this helps anyone else who had this problem!
Background Info:
Here's a trimmed copy of the exception in the Event Viewer:
FriendlyName: Export Template
ModuleControlSource: Admin/Portal/Template.ascx
AssemblyVersion: 5.2.3
ActiveTabName: Portals
InnerException: The file '/Admin/Portal/Template.ascx' does not exist.
FileName:
FileLineNumber: 0
FileColumnNumber: 0
Method: System.Web.UI.Util.CheckVirtualFileExists
StackTrace:
Message: DotNetNuke.Services.Exceptions.ModuleLoadException: The file '/Admin/Portal/Template.ascx' does not exist. ---> System.Web.HttpException: The file '/Admin/Portal/Template.ascx' does not exist.at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)at System.Web.Compilation.BuildManager.GetVPathBuildResult(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)at System.Web.UI.TemplateControl.LoadControl(String virtualPath)at DotNetNuke.UI.ControlUtilities.LoadControl[T](TemplateControl containerControl, String ControlSrc)at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl()--- End of inner exception stack trace ---
Here's the portion of 05.00.00.SqlDataProvider that this relates to (lines 909-943):
/* Update Portals Module */
/*************************/
DECLARE @ModuleDefID int
SET @ModuleDefID = (SELECT ModuleDefID FROM {databaseOwner}{objectQualifier}ModuleDefinitions WHERE FriendlyName = 'Portals')
UPDATE {databaseOwner}{objectQualifier}DesktopModules
SET FolderName = 'Admin/Portals',
IsPremium = 1
WHERE ModuleName = 'Portals'
UPDATE {databaseOwner}{objectQualifier}ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Portals/Portals.ascx',
IconFile = '~/images/icon_sitesettings_32px.gif'
WHERE ControlSrc = 'Admin/Portal/Portals.ascx'
AND ModuleDefID = @ModuleDefID
UPDATE {databaseOwner}{objectQualifier}ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Portals/SiteSettings.ascx',
ControlType = 3,
IconFile = '~/images/icon_sitesettings_32px.gif'
WHERE ControlSrc = 'Admin/Portal/SiteSettings.ascx'
AND ModuleDefID = @ModuleDefID
UPDATE {databaseOwner}{objectQualifier}ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Portals/Template.ascx',
IconFile = '~/images/icon_sitesettings_32px.gif'
WHERE ControlSrc = 'Admin/Portal/Template.ascx'
AND ModuleDefID = @ModuleDefID
UPDATE {databaseOwner}{objectQualifier}ModuleControls
SET ControlSrc = 'DesktopModules/Admin/Portals/Signup.ascx',
IconFile = '~/images/icon_sitesettings_32px.gif'
WHERE ControlSrc = 'Admin/Portal/Signup.ascx'
AND ModuleDefID = @ModuleDefID