UPDATE February 2021: These instructions apply for VS 2019 and the latest release of the templates as well (v10+). Some of the content below is out of date, but the process is the same.

This page contains information about the DotNetNuke Project Templates for Visual Studio 2013 (no longer updated for 2012) found in the Visual Studio Gallery. These templates are part of the http://github.com/chrishammond/dnntemplates project. You can download the source project from Codeplex if you want to modify the templates.

These templates utilize the MSBuild Community Tasks project, but you no longer need to download and install that project, they ship with the NUGET package for the project which installs it into the local directory when you create a new project.

These templates are currently configured for DNN 7.0.2+, meaning your development environment should be at least version 7.0.2 of DotNetNuke.

Template Descriptions (for v2.0+)

  1. DotNetNuke 7 C# DAL2 Compiled Module - a DAL2 module template that comes preconfigured with functionality for creating, editing and deleting items. There are three controls, VIEW/EDIT/SETTINGS though the settings control is not used in the default functionality, it can easily be implemented with custom settings.
  2. DotNetNuke 7 C# Compiled Module - a standard DNN module with VIEW/EDIT/SETTINGS controls, and classes for the abstract and concrete data providers for the original DAL (data access layer)
  3. DotNetNuke 7 VB.Net DAL2 Compiled Module - a DAL2 module template that comes preconfigured with functionality for creating, editing and deleting items. There are three controls, VIEW/EDIT/SETTINGS though the settings control is not used in the default functionality, it can easily be implemented with custom settings.
  4. DotNetNuke 7 VB.Net Compiled Module - a standard DNN module with VIEW/EDIT/SETTINGS controls, and classes for the abstract and concrete data providers for the original DAL (data access layer)
  5. DotNetNuke 7 C# Compiled Theme - (new in template release V4.0) a standard DNN skin based on the HammerFlex free open source skin, utilizing Bootstrap V3.1.1. 

Template Instructions

How to Install the Visual Studio 2013 DotNetNuke Project Templates

Installation of the templates is pretty easy, there are multiple ways to do this, choose one of the three options below and perform the steps listed for the option you choose. You only need to do one of these options, not all three.

  1. Install using the Tools\Extensions and Updates menu in Visual Studio 2013 (will not work in Visual Studio Express editions)
    1. Mouse over the Tools menu
    2. Click on Extensions and Updates
    3. Search for DotNetNuke
    4. Choose the Install button for the DotNetNuke Project Templates option
  2. Install manually by downloading the VSIX file from the online gallery (will not work in Visual Studio Express editions)
    1. Visit the Visual Studio Gallery – DotNetNuke Project Templates page
    2. Download the VSIX file via the Download link.
    3. Double click on the downloaded file to install the templates.
  3. Install manually by downloading from Codeplex (should work in Visual Studio Express editions)
    1. Download the VSIX file from Codeplex
    2. Double click on the downloaded file to install the templates.

Creating a DotNetNuke Module using the Templates

(See how to create a Theme using the templates)

Once you've installed the templates, you can setup a project based on the templates. To do so you should follow the steps below

  1. (you should have this done already) Install Visual Studio 2013
  2. (you should have this done already) Install DotNetNuke Project Templates from the Visual Studio Gallery
  3. Setup your DotNetNuke Development environment following the steps listed here in this tutorial (the templates assume you have your development environment setup at http://dnndev.me/).
  4. Run Visual Studio 2013 as an Administrator (right click on the shortcut to do so)
  5. File –> New Project
  6. Choose either C# or VB.Net from the Languages section of the new project dialog
  7. Select the DotNetNuke Folder under your preferred language (C# or Visual Basic)
  8. Choose either DotNetNuke C# Compiled Module or DotNetNuke 7 C# DAL2 Compiled Module template for your project template (or the VB.NET versions)
  9. For the new project creation screen using the following settings
    1. Name: ModuleName (something unique here, example DNNTaskManager)
    2. Location: c:\websites\dnndev.me\desktopmodules\ (this assumes you setup your development environment as instructed in Step 3)
    3. Solution: Create new solution
    4. Create directory for solution : Unchecked (this will cause path problems if checked, the templates assume the SLN is in the same folder as the project file)
    5. Add to source control: Unchecked (I typically get my project running before adding it to source control)
    6. Click OK

This will create a folder under c:\websites\dnndev.me\desktopmodules\ModuleName and should contain all of the files necessary for your module, including the Solution. There are a couple of next steps just to finalize the process, these steps are documented in the Documentation\Documentation.html file, which should open up automatically in Visual Studio after your project gets created, follow these steps to configure the final project properties, then you are ready to build/deploy your module. You can delete the documentation folder once you have completed those steps.

Build and Installation

To build and install your module, you should switch to Release mode in Visual Studio and then choose Build Solution from the Build menu. This will compile and package your module for distribution.

The module will be packaged into the INSTALL folder inside of desktopmodules\ModuleName. This is different a location from the prior version of my templates.

From there you can install the SOURCE package into the Host/Extension page of your development environment, that will install the module within DNN and allow you to place it on a page and start working with module. For more information check out the Task Manager tutorial series

How to Customize the Templates

You may want to customize these templates in order to define your own namespace, email address, and domain name for the project properties.

There are two ways to customize the templates, the first, modifying the ZIP files, is the recommended way.

Modify the ZIP files

Check out this tutorial for customizing the templates by modifying the ZIP files.

Modify the VSIX files

For the other approach to template customization you will want to download the Source for the DNNTemplates project on codeplex, make changes, and recompile that project to create your own VSIX file, you will then use this VSIX file to install your custom templates. I do recommend that you change the name of the templates using the VSIX manifest interface in Visual Studio. You can follow the steps below to customize and package your own templates.

  1. Install Visual Studio 2013 (currently available from MSDN downloads)
  2. Install Visual Studio 2013 SDK (currently available from MSDN downloads)
  3. Download the VSIX Source Code project from Codeplex (click here to go to codeplex
  4. Extract the package to a folder (I use c:\projects\dnntemplates\vsix)
  5. Open the Solution in the VSIX folder (dnntemplates.sln) in Visual Studio 2013
  6. Open the source.extension.vsixmanifest file (it should default into the designer)
    1. Change the Product Name to something other than DotNetNuke Project Templates
  7. Expand the CSharp-Template (mirror process for VB-Template to modify the VB template)
  8. Open the vstemplate files.
    1. Change the Name found within TemplateData in the vstemplate file, I would suggest relating this to the name of your company.
    2. Find the CustomParameters section and modify the Values of any of the necessary parameters.
  9. Now you will need to compile the DNNTemplates solution in Release mode, this will generate a new VSIX file under the vsix/dnntemplates/bin/release folder.
  10. Deploy the VSIX file by double clicking on the file (found in the dnntemplates/bin/release folder).

Version History

  1. V2.3 - Released 6/5/2013, contains a couple of minor fixes and documentation updates
  2. V2.1 - Released 4/3/2013, fixes target location for the release build, changed copyrights to Christoc.com
  3. V2.1 - Released 1/28/2013, contains a couple of changes for customizing the Templates
  4. V2.0 - Released 1/24/2013, contains both DAL and DAL2 templates for DNN 7.0.2 in both C# and VB.NET
  5. V1.0/1.1 - Contains a DAL template for DNN 6.2.* in both C# and VB.NET
  6. V10.1.0 - VS 2019 Updates