Learn More





DNN Community Blog

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.

Module Development in DNN 8: 1 – Introduction to MVC modules

DNN Loves MVCA new CTP for DNN 8 was released today.  This CTP contains updated support for building modules using the ASP.NET MVC Framework as well as new support for building HTML 5 based modules.  This adds to the existing support for building modules with ASP.NET WebForms (User Controls) and Razor scripts. 

With this extended support DNN 8 becomes the only .NET CMS that offers module developers a choice of all the available ways to build extensions.

In this new blog series I will describe these new features while building a module to manage Contacts.  This post is an introduction to developing MVC based modules.

A bit about routing

The first thing to note is that the approach we have taken is to embed the MVC application inside an ASP.NET Web Forms server control.  This is a similar approach to how we provided Razor support a few years ago, and is also the same approach we are using to support Single Page Application style modules using HTML 5, JavaScript and CSS. 

This doesn’t really affect how module developers code their MVC modules, except that it means that routing is done a little differently.  As an MVC module developer you don’t need to define any routes as DNN handles the routing (or URL Rewriting).  We will however still support Html and Url helpers that defined links using action names and controller names.  However, we will create urls that work within the DNN Url handling system.

Setting up your environment

In this introductory blog I will show how to set up Visual Studio (2015) to develop our first DNN MVC module.  As a pre-requisite you will need to install the CTP which you can get from codeplex. Alternatively you can get the latest code by cloning the feature/8.0.0 branch of the DNN.Platform Github repository (

Open Visual Studio (in my case I am using Visual Studio 2015 RC) and create a solution for you MVC module.  Once you have created your solution, add a Web Application Project – select the Empty template (1) but check MVC (2) so that the MVC references are added to the empty project.

Figure 1 - Creating an MVC Project


Remove the files and folders added by the template – except the Controllers, Models and Views folders – and add an App_LocalResources folder (for our localization resources).  You should have something that looks like Figure 2.

Figure 2 – Empty MVC Project


I like setting up my projects so that I can deploy them to my site as well as package them for installation so in order to do that we need to add some extra files to the project.

The File

The first file to add is an MS Build file.  This MS Build file is shown in Figure 3 (don’t worry if you can’t read everything in the file – as noted above the source for this project is available on Github (, so you can copy the file on Github for use in your project.

Figure 3 – The File


There are four important properties in this file some of which will need to be modified for your installation:

  1. The BuildScriptsPath points to the folder where supporting build scripts are stored.
  2. The WebsitePath must point to the root of your DNN 8.0 website
  3. The ModuleFolderName points to where your module will be deployed within the website – your module should be under the MVC folder within DesktopModules.  This is important as this will mean that the web.config file that lives in that folder will apply to your MVC module.  This web.config file allows the Razor Views to work just as they would in a stand-alone MVC Application with the change that the base WebViewPage is a DnnWebViewPage.
  4. The two Imports statements points to two MS Build files that are used to deply and/or package the module.  These files are copies of the files shipped with the DNN source and are located in the BuildScriptsPath folder.

To enable the build file to work you need to modify the module’s project file.  To do that, “Unload” the project and Edit the project as an XML file, and insert the Import element highlighted in Figure 4 at the bottom of the file.

Figure 4 – Adding the Import Statement to the Project File


The DNN Manifest file

Next we will need to add a DNN manifest file.  Figure 5 shows the DNN manifest file I have created for the ContactList project.

Figure 5 – The DNN Manifest file


Note the following 4 points about this file:

  • There is a dependency node as MVC modules require a core DNN version of 8.0.0 or later
  • The folderName property supports two levels just like legacy module types (for this property the MVC folder is implied)
  • The controlSrc property uses the “fake” extension “.mvc” to identify that this control is an MVC control.  I will go into more detail about this in a future post.
  • The ResourceFile component and any File component needs to include the MVC folder in the basePath.

Most of the other files in the root of the project are self-explanatory.  In the next post in this series I will show how to build your first MVC View.

For more information


hany darwish
waiting for more
hany darwish Sunday, May 24, 2015 5:41 AM (link)
Tony Henrich
Thanks for the info. "Add New Contact" brings up a blank popup. None of the methods in the contactcontroller gets called. It seems the module is not wired up correctly.
Tony Henrich Monday, May 25, 2015 1:45 PM (link)
Alex Santos
Great article. Can't wait for the next post!
Alex Santos Monday, June 22, 2015 1:27 PM (link)
Vineet Belani
Dear Charles

I have downloaded the DnnConnect.Demo project from GitHub and when I compile it in release mode I can only see the Install PA in the Install/Modules directory of my DNN website. My question is where can i find the Source Package??
Vineet Belani Wednesday, August 05, 2015 8:04 PM (link)
Scippy One
I've try to install the Install PA module in the Install/Modules directory of my DNN 8 ctp4 website but I receive an installation error: Error loading files from temporary folder - see below
Info Component installed successfully - Assembly
Info Starting Installation - ResourceFile
Info Expanding Resource file
Info Creating backup of previous version - App_LocalResources\Contact.resx
Info Created - App_LocalResources/Contact.resx
Info Creating backup of previous version - module.css
Failure Installation Failed - ResourceFile
Info Rolling back component install - Module
Info Component rolled back successfully - Module
Info Rolling back component install - Assembly
Info Restored backup of previous version - bin\Dnn.ContactList.Mvc.dll
Info Component rolled back successfully - Assembly
Info Installation Failed - Dnn.ContactList_Mvc
Info Deleted temporary install folder
EndJob Installation Failed
Any help about?
Scippy One Monday, September 07, 2015 11:46 AM (link)
Jonathan Opperman
Sigh... Sometimes, as a developer, I get the feeling DNN, or at least DNN Community is abandonware.
Jonathan Opperman Tuesday, September 29, 2015 8:25 AM (link)
Tony Henrich
Post in the beta forum and you'll get more exposure. You can also use the DNN source and trace the cause of the issue yourself. You're experiencing a problem where someone will have to get your PA and test it themselves. I am guessing no one has the time for this now in a CTP phase.
Tony Henrich Tuesday, September 29, 2015 12:18 PM (link)
Charles Nurse
The Contact List module was created for an earlier CTP - I will try and make sure it works in the current CTP.
Charles Nurse Tuesday, September 29, 2015 5:57 PM (link)
Scippy One
I wrote sone time ago two comments on next Charles MVC post to fix thoose little installation problem.
Read comments here:
Scippy One Wednesday, September 30, 2015 12:11 AM (link)
darrell tunnell
If you'd like a more streamlined alternative for handling the building / packaging side of the project, please checkout DnnPackager:
darrell tunnell Sunday, December 20, 2015 12:14 PM (link)
Sameer Shah
Really informative tutorial. But I have a small issue that I cant seem to resolve. I think its related to Module.Build File Settings. I decided to make modifications to and install the zip file into the DNN 8 CTP 2. I changed the DNN Manifest XML files in MVC and API projects as per Fig 5 and tried to install the module under root\Install\Module Folder. However, I got following error:

DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke
UserAgent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36
Message:Value cannot be null. Parameter name: key
InnerMessage:Value cannot be null. Parameter name: key
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at DotNetNuke.Entities.Modules.Definitions.ModuleDefinitionInfo.ReadModuleControls(XmlReader reader)
at DotNetNuke.Entities.Modules.Definitions.ModuleDefinitionInfo.ReadXml(XmlReader reader)
at DotNetNuke.Entities.Modules.DesktopModuleInfo.ReadModuleDefinitions(XmlReader reader)
at DotNetNuke.Entities.Modules.DesktopModuleInfo.ReadXml(XmlReader reader)
at DotNetNuke.Common.Utilities.CBO.DeserializeObject[TObject](XmlReader reader)
at DotNetNuke.Services.Installer.Installers.ModuleInstaller.ReadManifest(XPathNavigator manifestNav)
at DotNetNuke.Services.Installer.Installers.InstallerFactory.GetInstaller(XPathNavigator manifestNav, PackageInfo package)
at DotNetNuke.Services.Installer.Installers.PackageInstaller.ReadComponents(XPathNavigator manifestNav)
at DotNetNuke.Services.Installer.Installers.PackageInstaller.ReadManifest(XPathNavigator manifestNav)
at DotNetNuke.Services.Installer.Installers.PackageInstaller..ctor(String packageManifest, InstallerInfo info)
at DotNetNuke.Services.Installer.Installer.ProcessPackages(XPathNavigator rootNav)
at DotNetNuke.Services.Installer.Installer.ReadManifest(Boolean deleteTemp)
at DotNetNuke.Modules.Admin.Extensions.Install.wizInstall_NextButtonClick(Object sender, WizardNavigationEventArgs e)
at System.Web.UI.WebControls.Wizard.OnNextButtonClick(WizardNavigationEventArgs e)
at System.Web.UI.WebControls.Wizard.OnBubbleEvent(Object source, EventArgs e)
at System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Sameer Shah Friday, February 12, 2016 2:27 PM (link)
James Brown
What is CTP? you refer several time to CTP in this article, but some of the links are broken.
James Brown Friday, April 29, 2016 1:31 PM (link)
CTP stands for Community Technology Preview.
It is similar to a beta as it is meant to showcase new features added to Dnn, but are not considered the definitive version.
TheJeTjon Tuesday, July 19, 2016 6:00 PM (link)

Comment Form

Only registered users may post comments.


2sic Daniel Mettler (124)
Aderson Oliveira (15)
Alec Whittington (11)
Alex Shirley (10)
Andrew Nurse (30)
Anthony Glenwright (5)
Antonio Chagoury (28)
Ash Prasad (22)
Ben Schmidt (1)
Benjamin Hermann (25)
Benoit Sarton (9)
Beth Firebaugh (12)
Bill Walker (36)
Bob Kruger (5)
Brian Dukes (2)
Brice Snow (1)
Bruce Chapman (20)
Bryan Andrews (1)
cathal connolly (55)
Charles Nurse (163)
Chris Hammond (203)
Chris Paterra (55)
Clinton Patterson (28)
Cuong Dang (21)
Daniel Bartholomew (2)
Dave Buckner (2)
David Poindexter (3)
David Rodriguez (2)
Doug Howell (11)
Erik van Ballegoij (30)
Ernst Peter Tamminga (74)
Geoff Barlow (6)
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 (270)
John Mitchell (1)
Jon Henning (14)
Jonathan Sheely (4)
Jordan Coopersmith (1)
Joseph Craig (2)
Kan Ma (1)
Keivan Beigi (3)
Ken Grierson (10)
Kevin Schreiner (6)
Leigh Pointer (31)
Lorraine Young (60)
Malik Khan (1)
Matthias Schlomann (15)
Mauricio Márquez (5)
Michael Doxsey (7)
Michael Tobisch (3)
Michael Washington (202)
Mike Horton (19)
Mitchel Sellers (28)
Nathan Rover (3)
Navin V Nagiah (14)
Néstor Sánchez (31)
Nik Kalyani (14)
Peter Donker (52)
Philip Beadle (135)
Philipp Becker (4)
Richard Dumas (22)
Robert J Collins (5)
Roger Selwyn (8)
Ruben Lopez (1)
Ryan Martinez (1)
Salar Golestanian (4)
Sanjay Mehrotra (9)
Scott McCulloch (1)
Scott S (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)
Timo Breumelhof (24)
Tony Henrich (3)
Torsten Weggen (2)
Vicenç Masanas (27)
Vincent Nguyen (3)
Vitaly Kozadayev (6)
Will Morgenweck (37)
Will Strohl (163)
William Severance (5)
Try Evoq
For Free
Start Free Trial
a Demo
See Evoq Live
Need More Information?