Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Register a Custom Built Module without a ManifestRegister a Custom Built Module without a Manifest
Previous
 
Next
New Post
3/1/2010 1:35 AM
 

In previous versions of DNN (< 5.2.2), as a developer, we were able to register new modules into DNN without using the a manifest file. Now the new Create New Module function in DNN 5.2.3 cannot handle the situation where you are registering additional modules into the same package location as it gives duplicate record errors (see below).

Let me explain our situation so it is a little clearer.... We are constantly developing new controls (modules) for our complex corporate application which has dozens of controls we use which are all stored in the same DesktopModules\OurApp subfolder. As we need new functionality, we create a new control (xyz.asc and xyz.ascx.vb), upload it to our server, register it as a new module, then use it on pages as we see fit. Well that was before DNN 5.2.1 'ish. Now that DNN have radically changed the Create Module interface, we no longer seem to be able to just "register" a new module to an existing package or DesktopModules location. If you try to add using "Create New Module", Create Module From: Control, leave Owner Folder on <Not Specified>, select our folder under DesktopModule for the Module Folder, then select our newly uploaded xyz.asx file, give it a name, then click Create Module, we get the following error message:-

 System.Data.SqlClient.SqlException: Violation of UNIQUE KEY constraint 'IX_DesktopModules_ModuleName'. Cannot insert duplicate key in object 'dbo.DesktopModules'. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlDataReader.ConsumeMetaData() at System.Data.SqlClient.SqlDataReader.get_MetaData() at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteScalar() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(SqlConnection connection, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteScalar(String connectionString, String spName, Object[] parameterValues) at DotNetNuke.Data.SqlDataProvider.AddDesktopModule(Int32 packageID, String ModuleName, String FolderName, String FriendlyName, String Description, String Version, Boolean IsPremium, Boolean IsAdmin, String BusinessControllerClass, Int32 SupportedFeatures, String CompatibleVersions, String Dependencies, String Permissions, Int32 createdByUserID) at DotNetNuke.Entities.Modules.DesktopModuleController.SaveDesktopModule(DesktopModuleInfo desktopModule, Boolean saveChildren, Boolean clearCache) at DotNetNuke.Entities.Modules.DesktopModuleController.AddDesktopModule(DesktopModuleInfo objDesktopModule) at DotNetNuke.Modules.Admin.ModuleDefinitions.CreateModuleDefinition.ImportControl(String controlSrc)
 

Does anyone know any way of just registering a new module to an existing DesktopModules folder, similar to what we could do before?

Or are we forever stuck with having to create a manifest file, just to register a new control?

 
New Post
7/2/2010 2:22 PM
 
I see that this post is from a while ago, but I am running into a similar issue. I just built a stock compiled module from the VS Template but I can't register it. As a work around I am trying now to use the ModuleName.SqlDataProvider by executing it's SQL but there are some new fields that the AddDesktopModule stored proc wants that the SQLDataProvider SQL is missing. One is a PackageID and I am trying to track down what the heck that is supposed to be. We are using version 5.2.3.

-something clever or funny.
 
New Post
7/2/2010 2:37 PM
 
OK. So I was able to register my module using the SQL approach but I had to update the SQL.  The SQLDataProvider that my VS Template spits out appears to be missing numerous fields which I have highlighted below in red.  I was missing a couple values but I took a guess (I set the PackageID to 1, SupportsPartialRendering to 0, and CreatedByUser to -1 for now.)  My module is still not showing up in my Host >> Module Definitions page so something is wrong.

exec {databaseOwner}[{objectQualifier}AddDesktopModule]
@PackageID = 1,
@ModuleName = N'Trusted.HomeFeature',
@FolderName = N'HomeFeature',
@FriendlyName = N'HomeFeature',
@Description = N'Displays a javascript based slideshow created from a specified RSS feed',
@Version = N'01.00.00',
@IsPremium = 0,
@IsAdmin = 0,
@BusinessController = N'Trusted.Modules.HomeFeature.HomeFeatureController',
@SupportedFeatures = 3,
@CompatibleVersions = '',
@Dependencies = '',
@Permissions = '',
@CreatedByUserID = -1


declare @DesktopModuleId int
select @DesktopModuleId = DesktopModuleId
from {databaseOwner}[{objectQualifier}DesktopModules]
where ModuleName = 'Trusted.HomeFeature'

exec {databaseOwner}[{objectQualifier}AddModuleDefinition] @DesktopModuleId,
@FriendlyName = N'HomeFeature',
@DefaultCacheTime = 0,
@CreatedByUserID = -1


declare @ModuleDefID int
select @ModuleDefID = ModuleDefID
from {databaseOwner}[{objectQualifier}ModuleDefinitions]
where FriendlyName = 'HomeFeature'

exec {databaseOwner}[{objectQualifier}AddModuleControl]
@ModuleDefID,
@ControlKey = NULL,
@ControlTitle = NULL,
@ControlSrc = N'DesktopModules/HomeFeature/ViewHomeFeature.ascx',
@IconFile = NULL,
@ControlType = 0,
@ViewOrder = NULL,
@HelpUrl = NULL,
@SupportsPartialRendering = 0,
@CreatedByUserID = -1


exec {databaseOwner}[{objectQualifier}AddModuleControl]
@ModuleDefID,
@ControlKey = 'Settings',
@ControlTitle = 'HomeFeature Settings',
@ControlSrc = N'DesktopModules/HomeFeature/Settings.ascx',
@IconFile = NULL,
@ControlType = 1,
@ViewOrder = NULL,
@HelpUrl = NULL,
@SupportsPartialRendering = 0,
@CreatedByUserID = -1





-something clever or funny.
 
New Post
7/2/2010 3:14 PM
 
OK I figured out how to make the module appear in the Module Definitions list.  It needs to be added to the PortalDesktopModules table.

-something clever or funny.
 
New Post
7/27/2010 5:00 PM
 
I'm running DNN5.4.4 and got the same error when creating new module (from control or manifest). I figured out that creating modules from the same folder (with DIFFERENT controls) will cause this error. I do think this is a bug since it's okay to do such things.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...Register a Custom Built Module without a ManifestRegister a Custom Built Module without a Manifest


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out