This project is read-only.

DNNtc MSBuild Tasks

The purpose of this MSBuild extention is to be able to generate Installation and Source Packages for a DNN 5 Module with minimal effort. This documentation describes how to install the MSBuild extention and how to use it.

Prerequisits

When you want to use this MSBuild extention, you will have to develop your module in the DesktopModules folder of your DNN Installation. The project output has to be in the root of your project (bin\). You can use VS2012.

DNNtc MSBuild Tasks Installation

When you want to use the MSBuild tasks you have to install both these items.

  • MSbuild Community Tasks. This is an open source project for MSBuild tasks Download
  • DNNtc MSBuild for DotNetNuke module development Download

DNNtc Module template installation

Download the DNNtc Module template zip file and place it in the templates folder. You can Find your template folder in your “My Documents” folder :

 [My Documents]\Visual Studio 2011\Templates\ProjectTemplates\Visual C#\Web\

IF you put the zip file there Visual Studio will use the template automatically.

Using the DNNtc MSBuild Tasks

DNNtc Module template Installation

There are the steps you have to take for each project you want to use the DNNtc MSBuild Tasks for. You only have to do this once for each project.

  • Step 1: Create a new project using the DNNtc module template
  • Step 2: Fill the Properties
  • Step 3: Let the Build Process know which items it to include in the manifest file and the Package


Step 1: Create a new project using the DNNtc module template
Open Visual Studio and create a new project. Give it a name and click Ok. It is very important that the project location is your DesktopModules folder.

A brief overview of the items included in the folder:

CleanUp
This folder contains the files to be cleaned up during installation. On each line in the file there is a instruction for a clean action for that file. It contains the path and the filename. For example:

Install\Module\YourModule01.00.00Install.resources
Install\Module\YourModule01.00.01Install.resources
DesktopModules\YourModule\bgcolor.gif

Config
This folder contains a file that helps you manipulate the web.config file in your installation. By adding a line of commands the dnn file will be merged with a section for web.config changes. The usage of this file is described inside the file itself. An example of the command could be:

/configuration/appSettings:add:key="newConfigItem":value="newConfigValue":collision=overwrite


ReleaseNotes
This folder contains the ReleaseNotes. Depending on the version you are building, the MSBuils extention includes the file that is corresponding to the Module version. This can contain either html or plain text

SqlDataProvider files
Since they are part of the installation process, they are included in this folder.

Attributes
This file is used to add the attributes to the components.

License.txt
This file contains the License information. This can be either html or plain text

Project.targets
This file contains the actual extentions for the Build process.


Step 2: Fill the Properties
Open the Project.targets file and change the properties to suit your needs. You can change the company properties and the module properties. A brief overview:

CompanyName
The name of your Company. This can be an empty field.

CompanyUrl
The Url of your module homepage. This can be an empty field.

CompanyEmail
The emailadress you wish to add to the installation info. This can be an empty field.

BinDir
Default this is the bin dir in the project root. When your output goes to another folder you can change it here.

ModuleName
The name of your module. This field cannot be empty.

FolderName
The Folder of your module. This is default the same as your modulename.

FriendlyName
The friendlyname of your module. This is default the same as your modulename.

ModuleDescription
The description of your module.

azureCompatible

Signals if the module is Azure compatible

AlsoBuildSourcesZip

Indicate if you want a “Sources” Zip file to be created in addition to the “Install” zip file. The default setting for this is false. To enable it set the value to true

!Important: After changing the project.targets file you have to reload the project to use the changed targets file. 

Step 3: Let the Build Process know which items it to include in the manifest file and the Package
The build extention must gather information about all the parts of the Module to be able to generate a manifest file and package it into a PA. The attributes file added earlier contains all the attributes needed to add this information. You can add multiple attributes to a class. An overview:

ModuleControlProperties
Each control that must be included in the manifest file, must have its properties filled. To do this you can add the DNNtc.ModuleControlProperties attribute to the class. this attribute will take the propperties as input. When the attribute is not added to a UserControl, it will still be added to the resources.zip file, but it will not be a Control in the moduledefinition.

Usage:

VB.NET
   <DNNtc.ModuleControlProperties("Yourkey", "YourTitle", DNNtc.ControlType.View, "http://YourHelpUrl.com", True)> _
   Partial Class YourView
      'View control 
   End Class	

C#
   [DNNtc.ModuleControlProperties("Yourkey","YourTitle",DNNtc.ControlType.View,"http://YourHelpUrl.com",true)]
   partial class YourView
   {
      //View control 
   }




ModuleDependencies
Your module might have a dependency on some object. You can add a attribute to the View control to have the build extention add a <Dependencies> tag to the manifest file.

Usage:

VB.NET
   <DNNtc.ModuleDependencies(DNNtc.ModuleDependency.CoreVersion, "05.02.00")> _
   Partial Class YourView
      'View control 
   End Class	

C#
   [DNNtc.ModuleDependencies(DNNtc.ModuleDependency.CoreVersion, "05.02.00")]
   partial class YourView
   {
      //View control 
   }




ModulePermission
You might have extended permissions added to your Module. You can add a attribute to the View control to have the build extention add a <Permissions> tag to the manifest file.

Usage:

VB.NET
   <DNNtc.ModulePermission("YOUR_MODULE", "PERMISSION_NAME", "Friendly Permission Name")> _
   Partial Class YourView
      'View control 
   End Class	

C#
   [DNNtc.ModulePermission("YOUR_MODULE", "PERMISSION_NAME", "Friendly Permission Name")]
   partial class YourView
   {
      //View control 
   }



BusinessControllerClass and UpgradeEventMessage
The businesscontroller contains information about the implemented interfaces. This is used to generate the <Supported Features> tag. When the module implements the IUpgradeable interface it will also need an <eventmessage> tag in the manifest file

Usage:

VB.NET
   <DNNtc.UpgradeEventMessage("01.01.01,04.00.02,04.01.00")> _
   <DNNtc.BusinessControllerClass()> _
   Public Class YourController
      'Controller Class
   End Class	

C#
   [DNNtc.UpgradeEventMessage("01.01.01,04.00.02,04.01.00")]
   [DNNtc.BusinessControllerClass()]
   public class YourController
   {
      //Controller Class
   }

Last edited Jul 18, 2013 at 1:41 PM by EPT, version 6

Comments

No comments yet.