Creating DotnetNuke Module Visual Studio 2010 and Fixing bugs not answered on Google


Please remember to donate to help us stay online and improve
Lately I tried creating module extensions in dotnetnuke using codeplex templates by Chris Hammond and I experience a lot of issues. Checking google I noticed many people experienced same issues and bugs with no answer. This article tends to take you through the steps of doing this.

I advise you watch the tutorial video by Chris Hammond below. This article only tries to solve the problems experienced while implementing the steps in the video.

Keep in mind, you will need to make changes to some steps giving in the video
1) Install Dotnetnuke from the website:

This tutorial uses the community download and works well with the professional version. You can download the community version here. You can download either standard process or ms web matrix version, both worked fine and the only difference is that ms web matrix version is easy to configure and setup. Just follow the web matrix and install. On my system, it installed Sql Server 2008 on my system even though I have Sql server 2012 so I'm guessing that is a dotnetnuke default Sql Server and no problem experienced with it till date.

2) Download MS BUILD Community Task:

This is very important as the template created by Chris Hammond for buildingthe  module template contains build scripts for creating tpackages that will be installed in dotnetnuke. You can download MS Build Community Task Here

3) Download Module Template

As at the time of writing this tutorial, the website contains new templates compared to that shown in the video tutorial, you only need to download version 00.00.06. From my experience, new templates does not work with Visual Studio 2010. Download a copy of the template here. Ensure you place template in the right folder as described in the video (I placed mine in Documents->Visual Studio 2010->Templates)

4) Continue the Tutorial Steps: 

  • Open Visual Studio 2010
  • Ensure you running Visual Studio 2010 in C# Environment as explained in the tutorial video
  • Click File -> New -> Project (to create a new module project)
  • Under Visual C# Tab, you should see your module downloaded at the top (Select Dotnetnuke C# Compiled Module)
  • Type your Module name (Dnn Explained)
  • Ensure Location is same as Dotnetnuke files location (mine is C:Usersakins_000DocumentsMy Web SitesdotnetnukeDesktopModules)
  • Do not select any option and click OK as shown in the image below



You might see an MS BUILD Warning "Warning 1 "C:Program Files (x86)MSBuildMicrosoftVisualStudiov10.0WebApplicationsMicrosoft.WebApplication.targets" cannot be imported again. It was already imported at "C:Usersakins_000DocumentsMy Web SitesdotnetnukeDesktopModulesDnnTaskManagerDnnExplained.csproj (152,3)". This is most likely a build authoring error. This subsequent import will be ignored. DnnExplained".

You can ignore this warning or simply go to DocumentsMy Web SitesdotnetnukeDesktopModulesDnnTaskManager and open DnnExplained.csproj  in Notepad. Delete the lines:

<Import Project="$(VSToolsPath)WebApplicationsMicrosoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)MicrosoftVisualStudiov10.0WebApplicationsMicrosoft.WebApplication.targets" Condition="false" />

This warning was shown because there are two lines of the same above.

6) Configure the start URL:

Unlike the video steps, you don't need to set root URL to dnndev or make changes to your root settings. In this tutorial, I leave the default settings as it is and make only make changes to the start URL by putting http://localhost:18740/. This is done by Right clicking on project->clicking properties-> Under web, enter the start URL-> Leave other options default as shown below



7) Build your project in Release Mode and Remove Errors:

You might get errors after building the project in release mode. This is because the new version of dotnetnuke downloaded utilises .NET Framework 4.0 and above compared to the templates 3.5. You will need to change the target Framework of your module project by Right Clicking on Project->Select Properties-> Under Applications, Select .NET Framework 4

I hope this post was helpful.


check out dotnetnuke tutorial here

check out other templates by Chris here


Please remember to donate to help us stay online and improve

Share this page...

Twitter icon
Facebook icon
Google icon
StumbleUpon icon icon
Digg icon
LinkedIn icon
MySpace icon
Newsvine icon
Pinterest icon
Reddit icon
Technorati icon
Yahoo! icon
e-mail icon