Visual Studio 2012 Templates

Return to previous page

  • 4/7/2015
  • 13372 Views

Comments

13372 Views

Visual Studio 2012 Templates

Last updated 4 years ago

Comments

Common

(Enter the content of this article below)

Advanced

 

Visual Studio 2012 Project Template Introduction

This page contains information about the DotNetNuke Project Templates for Visual Studio 2012 found in the Visual Studio Gallery.

These templates are part of the ChristocTemplate.codeplex.com 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.

Update 1-24-2013 The 2.0 release of the ChristocTemplates project contains 4 total template, 2 for VB.NET and 2 for C#. There is a DAL (data access layer) and DAL2 (data access layer 2) template for both languages. These templates are configured for DNN 7.0.2+



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)

Template Instructions

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 in Visual Studio 2012 (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 (should 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

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 2012
  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 the Wiki (the templates assume you have your development environment setup at http://dnndev.me/). Development Environment
  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 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

  1. Download the ZIP file for the template that you want to modify, found at http://christoctemplate.codeplex.com
  2. Extract the ZIP file’s contents into a folder
    1. You might need to unblock the ZIP file first by right clicking on the file
    2. Choose properties
    3. Choose Unblock
  3. Edit the *.vstemplate file with a text editor
  4. Modify the Name of the template to something other than “DotNetNuke 7 VB.Net Compiled Module”, perhaps use your company name, “Christoc.com DNN7 VB.Net Compiled Module”
  5. Modify the CustomParameter values for
    1. rootnamespace – The namespace of your project, something like Christoc.Modules., that will become Christoc.Modules.ProjectName (where ProjectName is provided when you create the project in Visual Studio)
    2. ownername – The name used for Copyright text in the projects, and also in the owner information of the DNN manifest during module installation
    3. owneremail – The email address listed in the DNN manifest file used during module installation
    4. ownerwebsite – The website listed in the DNN manifest file used during module installation
    5. devenvironmenturl – The URL of your development environment, only change if you are using something different.
  6. Rename the *.vstemplate file to use a new name, ex: Christoc-VB-Module.vstemplate
  7. Select all the files in the extracted template folder (press Control-A)
  8. Right click on the *.vstemplate file
    1. Choose Send To
    2. Compressed Zip File
    3. Copy the newly created ZIP file (file should have the same name as the VSTEMPLATE file just with a ZIP extension)
  9. In Windows go to your My Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual Basic folder (or Visual C# if you are working with the C# templates)
  10. Create a new folder called DotNetNuke
  11. Paste the ZIP file copied in Step 8.iii into the newly created DotNetNuke folder
  12. Repeat the process for any additional templates you want to modify.
  13. Start Visual Studio 2012 (if you had it open already, close it and open again)
  14. Create a new project, choosing one of your newly created templates.


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 2012 (currently available from MSDN downloads)
  2. Install Visual Studio 2012 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 2012
  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.1 - Released 1/28/2013, contains a couple of changes for customizing the Templates
  2. V2.0 - Released 1/24/2013, contains both DAL and DAL2 templates for DNN 7.0.2 in both C# and VB.NET
  3. V1.0/1.1 - Contains a DAL template for DNN 6.2.* in both C# and VB.NET
Contents
No sections defined

DNN Digest is our monthly email newsletter. It highlights news and content from around the DNN ecosystem, such as new modules and themes, messages from leadership, blog posts and notable tweets. Keep your finger on the pulse of the ecosystem by subscribing.  


Copyright 2017 by DNN Corp Terms of Use Privacy
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out