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!

The Community Blog is a personal opinion of community members and by no means the official standpoint of DNN Corp or DNN Platform. This is a place to express personal thoughts about DNNPlatform, the community and its ecosystem. Do you have useful information that you would like to share with the DNN Community in a featured article or blog? If so, please contact .

The use of the Community Blog is covered by our Community Blog Guidelines - please read before commenting or posting.

Packaging and protecting your DotNetNuke® Module

You want to create a DotnetNuke module and you want to distribute it but you don't want to give away your source code?

Step 1

Follow these directions to set up your development environment:

Setting-up the Development Environment

Step 2

Create a Module using the Web Site Project format used in this tutorial:

Super-Fast Super-Easy Module (DAL+)   

Step 3

Package the module. This package will include the source code. The source code will be replaced with compiled assemblies (.dll's) in a later step.

While logged in as the Host account, Select Module Definitions from the Host menu.

Click the pencil icon next to the module to select it and navigate to the details.

In this example we are using the module ThingsForSale that was created in the tutorial from Step 2.

From the menu for the module definition for ThingsForSale, select Create Module Package.

Enter a name that ends with .zip and click the Create link.

The Private Assembly will be created.

However it will not contain any assemblies at this point. It will contain source code.

You can retrieve the .zip file from the root directory of the portal.

When you open the .zip file you can see the module elements.

The source code is contained in the files with the .vb extension. These will be replaced with compiled assemblies.

Note: At this point the file can be used to install the module. Therefore, you will want to save a copy for use when you want to distribute a source code version of your module or to archive the version of the module.

See this post for information on installing modules

Remove all the files with the .vb and .ascx and .config extensions from your .zip file

Protect Your Source Code

To create a .zip file with compiled assemblies (so that you will have a version that does not contain your source code), follow these steps:

  • Create the compiled assemblies (.dll's)

  • Update the .dnn configuration file 

(Note: You must use Visual Studio for this. you cannot use Visual Web Developer Express)

Open Visual Studio 2005 and from the File menu select Open Web Site.

Navigate to your DotNetNuke site...

And open it

Create the compiled assemblies

From the Build menu, select Publish Web Site

From the Publish Web Site menu, enter a path for the compiled site (for example C:\compiled) and check the boxes next to:

  • Allow this precompiled site to be updatable

  • Use fixed naming and single page assemblies

Click the Ok button.

For more information, see the "Precompiling for Deployment" section in ASP.NET Web Site Precompilation Overview

When you look in the C:\compiled\bin folder you can see all the assemblies.

Locate any assemblies with the .dll extension that contain the name of the folder your module was in.

For example, the ThingsForSale module was in the \DesktopModules\ThingsForSale directory. Therefore, any assembly that has the words thingsforsale in it's name is a compiled assembly for the module.

Place them in into your .zip file

Copy any files with the .ascx extension that reside in the folder for your module (In this example C:\compiled\DesktopModules\ThingsForSale) to your .zip file

Update the .dnn configuration file 

Open the .dnn file and remove any reference to any files with a .vb or a .config extension

Add the names of any of the assemblies you added to the .zip file.

Surround the names with the tags

You will now have a .zip file that can be installed in a DotNetNuke site.

See this post for information on installing modules

Click Here to download the file created with this tutorial.

Upgrading You Module

  • When you create a new version of your module you will want to allow it to be upgraded.

  • To upgrade the module the portal administrator will upload the new version of the module.

  • The DotNetNuke framework will detect that a new version has been uploaded and upgrade it.

Removing old Assemblies

The problem you will have is the old assemblies will need to be removed, otherwise you will have a potential namespace conflict because the old and the new assemblies will both reside in the /bin directory at the same time.

To resolve this you will need to include a .txt file in your .zip file that will instruct the DotNetNuke framework to remove all previous assemblies for all previous versions of the module.

Implementing the Upgrade

This is assuming you have created a new version of the ThingsForSale module.

The first step is to change the version in the .dnn file.

Next, create a text file named 02.00.00.txt and place the names of the assemblies for all previous version of the module using bin/assembly name format.

Place this file in the .zip file for the new version of the module.


Comment Form

Only registered users may post comments.


Aderson Oliveira (22)
Alec Whittington (11)
Alessandra Davies (3)
Alex Shirley (10)
Andrew Hoefling (3)
Andrew Nurse (30)
Andy Tryba (1)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (37)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Bogdan Litescu (1)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (213)
Chris Paterra (55)
Clint Patterson (108)
Cuong Dang (21)
Daniel Bartholomew (2)
Daniel Mettler (181)
Daniel Valadas (48)
Dave Buckner (2)
David Poindexter (12)
David Rodriguez (3)
Dennis Shiao (1)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (80)
Francisco Perez Andres (17)
Geoff Barlow (12)
George Alatrash (12)
Gifford Watkins (3)
Gilles Le Pigocher (3)
Ian Robinson (7)
Israel Martinez (17)
Jan Blomquist (2)
Jan Jonas (3)
Jaspreet Bhatia (1)
Jenni Merrifield (6)
Joe Brinkman (274)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Kelly Ford (4)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matt Rutledge (2)
Matthias Schlomann (16)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Miguel Gatmaytan (3)
Mike Horton (19)
Mitchel Sellers (40)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Oliver Hine (1)
Patricio F. Salinas (1)
Patrick Ryan (1)
Peter Donker (54)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Sacha Trauwaen (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott Schlesier (11)
Scott Wilkinson (3)
Scott Willhite (97)
Sebastian Leupold (80)
Shaun Walker (237)
Shawn Mehaffie (17)
Stefan Cullmann (12)
Stefan Kamphuis (12)
Steve Fabian (31)
Steven Fisher (1)
Timo Breumelhof (24)
Tony Henrich (3)
Torsten Weggen (3)
Tycho de Waard (4)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (40)
Will Strohl (180)
William Severance (5)
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out