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+)
- 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.
- 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)
- 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.
- 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)
- 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.
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.
- Install using the Tools\Extensions and Updates menu in Visual Studio 2013 (will not work in Visual Studio Express editions)
- Mouse over the Tools menu
- Click on Extensions and Updates
- Search for DotNetNuke
- Choose the Install button for the DotNetNuke Project Templates option
- Install manually by downloading the VSIX file from the online gallery (will not work in Visual Studio Express editions)
- Visit the Visual Studio Gallery – DotNetNuke Project Templates page
- Download the VSIX file via the Download link.
- Double click on the downloaded file to install the templates.
- Install manually by downloading from Codeplex (should work in Visual Studio Express editions)
- Download the VSIX file from Codeplex
- 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
- (you should have this done already) Install Visual Studio 2013
- (you should have this done already) Install DotNetNuke Project Templates from the Visual Studio Gallery
- 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/).
- Run Visual Studio 2013 as an Administrator (right click on the shortcut to do so)
- File –> New Project
- Choose either C# or VB.Net from the Languages section of the new project dialog
- Select the DotNetNuke Folder under your preferred language (C# or Visual Basic)
- Choose either DotNetNuke C# Compiled Module or DotNetNuke 7 C# DAL2 Compiled Module template for your project template (or the VB.NET versions)
- For the new project creation screen using the following settings
- Name: ModuleName (something unique here, example DNNTaskManager)
- Location: c:\websites\dnndev.me\desktopmodules\ (this assumes you setup your development environment as instructed in Step 3)
- Solution: Create new solution
- 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)
- Add to source control: Unchecked (I typically get my project running before adding it to source control)
- 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.
- Install Visual Studio 2013 (currently available from MSDN downloads)
- Install Visual Studio 2013 SDK (currently available from MSDN downloads)
- Download the VSIX Source Code project from Codeplex (click here to go to codeplex
- Extract the package to a folder (I use c:\projects\dnntemplates\vsix)
- Open the Solution in the VSIX folder (dnntemplates.sln) in Visual Studio 2013
- Open the source.extension.vsixmanifest file (it should default into the designer)
- Change the Product Name to something other than DotNetNuke Project Templates
- Expand the CSharp-Template (mirror process for VB-Template to modify the VB template)
- Open the vstemplate files.
- Change the Name found within TemplateData in the vstemplate file, I would suggest relating this to the name of your company.
- Find the CustomParameters section and modify the Values of any of the necessary parameters.
- 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.
- Deploy the VSIX file by double clicking on the file (found in the dnntemplates/bin/release folder).
- V2.3 - Released 6/5/2013, contains a couple of minor fixes and documentation updates
- V2.1 - Released 4/3/2013, fixes target location for the release build, changed copyrights to Christoc.com
- V2.1 - Released 1/28/2013, contains a couple of changes for customizing the Templates
- V2.0 - Released 1/24/2013, contains both DAL and DAL2 templates for DNN 7.0.2 in both C# and VB.NET
- V1.0/1.1 - Contains a DAL template for DNN 6.2.* in both C# and VB.NET
- V10.1.0 - VS 2019 Updates