Products

Solutions

Resources

Partners

Community

About

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.


New Visual Studio 2012 Project Templates for DotNetNuke

UPDATE: 1/25/2013 - There is a new release for the VS2012 templates, be sure to read that blog announcement if you want to use the templates.

dnntemplates-1Earlier this month Microsoft put the bits up for Visual Studio 2012 RTM out on MSDN Subscriber downloads, and during the first two weeks of September they will officially be releasing Visual Studio 2012. I started working with VS2012 late in the release candidate cycle, doing some DNN module development using my templates at http://christoctemplate.codeplex.com.

These templates work fine in Visual Studio 2012 from my testing, but they still face the same problem that they had in Visual Studio 2008 and 2010, you have to install the MSBuild Community Tasks project prior to using the templates, otherwise projects failed to be created.

The other problem with the templates is that they are not easily discoverable, you couldn’t find them in Visual Studio, and they weren’t part of the Visual Studio Gallery. Enter the latest version of my module development templates.

I’ve from the ground up rewritten the project templates, and built them into a VSIX package, a unit of deployment for Visual Studio 2012. While it is true that you can create VSIX files that work in both Visual Studio 2010 and 2012, this project was designed specifically for 2012, and will not likely work in 2010, though I will do some testing and see if I can’t make it work in the future.

Overview of the DotNetNuke Project Templates

There are currently two templates available within the project, one for C# and one for VB.Net. These templates utilize MSBuild for automated packaging of the modules you create, just as previous versions of the templates have. They create compiled modules, meaning stand alone projects, that have their own DLL’s, making them easy to deploy and manage. They differ slightly from the previous version of the templates in that the deployable packages are now in the INSTALL folder within the module, instead of the packages folder.

You can now download new templates directly from within Visual Studio using the Tools\Extensions and Updates menu option. The templates are currently packaged as a Tool in the Visual Studio Gallery, not as individual template projects, so they can only be found by searching for them online, or via the Tools\Extensions and Updates option. As I release new versions of the template project you will be able to upgrade to the later templates using the same Extensions and Updates interface.

In order to start using the templates for you module development within DotNetNuke you will need to perform a number of steps, the first thing being installing the templates (if you don’t have Visual Studio 2012 installed, that would be your first step).

How to Install the Visual Studio 2012 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
    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
    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
    1. Download the VSIX file from Codeplex
    2. UPDATED - Right Click on the downloaded VSIX and choose Properties
    3. Click on the UNBLOCK button before proceeding
    4. Double click on the downloaded file to install the templates.

Creating a DotNetNuke Module 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

      <!--EndFragment-->
  1. (you should have this done already) Install Visual Studio 2012
  2. (you should have this done already) Install DotNetNuke Project Templates from the Visual Studio Gallery<!--EndFragment-->
  3. Setup your DotNetNuke Development environment following the steps listed here in the Wiki (the templates assume you have your development environment setup at http://dnndev/).
  4. Run Visual Studio 2012 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 VB.Net Compiled Module for your project template
  9. For the new project creation screen using the following settings dnntemplates-2
    1. Name: ModuleName (something unique here, example DNNTaskManager)
    2. Location: c:\websites\dnndev\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\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.

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. In order to customize these templates, you will want to download the Source for the DNNTemplates project, 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 2012 (currently available from MSDN downloads)
  • Install Visual Studio 2012 SDK (currently available from MSDN downloads)
  • Download the VSIX Source Code project from Codeplex (click here to go to codeplex)
  • UNBLOCK THE FILE BEFORE PROCEEDING
  • Extract the package to a folder (I use c:\projects\dnntemplates\vsix)
  • Open the Solution in the VSIX folder (dnntemplates.sln) in Visual Studio 2012
  • 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 DotNetNuke 6 C Compiled Module.vstemplate (or DotNetNuke 6 VB Compiled Module.vstemplate) file
    • 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).

What’s Next for the Project?

My intention is to create some additional templates to be included within the DotNetNuke Project Templates package, likely one for doing custom Skin Development, and maybe even some for other types of DNN Extensions. I will also be adding "ItemTemplates” into the distribution in the future. I will most likely also list both the C# and VB.NET templates as individual templates so they can be found searching for a simple project template, rather than having to search for a Tool as they are now, though I will see if there are other options for making them discoverable.

If you have any feedback on these templates, please feel free to post on the Discussion portion of the Codeplex project, I’m always open to ideas that will improve upon these templates.

Note: If you are having problems "installing" the module, be sure to close visual studio before uploading the ZIP file into DNN, sometimes Visual Studio will lock files and the installation of your module will fail. 

Comments

Luis Valle
Hello. I wanted to customize the template so I can have both instances of DNN 6 & DNN 7 templates in Visual Studio.

I downloaded the Source Code for DNN 6 template but when I run the "dnntemplates.sln" I get a prompt stating that "Team Foundation Server Version Control... The solution you are opening is bound to source control on the following Team Foundation Server..."

How can I get around that?
Luis Valle Tuesday, September 23, 2014 2:25 PM (link)
Kevin
Since codeplex.com is no longer in service, I can't find any DNN templates for VS 2013? Since GitHub is 2015 and the latest template is for 2017, where can I find a DNN template for VS 2013?
Kevin Monday, October 9, 2017 10:05 PM (link)
Chris Hammond
I will see if I can't get the older releases up on GitHub since Codeplex has essentially gone dark (useless at this point)
Chris Hammond Monday, October 9, 2017 11:26 PM (link)

Comment Form

Only registered users may post comments.

NewsArchives


Aderson Oliveira (22)
Alec Whittington (11)
Alessandra Daniels (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)
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