Search code examples
dotnetnukedotnetnuke-module

Templateless Module Development


Throughout the internet documentation for DotNetNuke is far and wide, this in itself is quite useful. However one hurdle exist and I can't appear to solve it. How do you do DotNetNuke Module development without Chris Hammond's Template?

This template has become so widely accepted and utilizes that no other documentation exists.

I've already accomplished the following:

  • Configured SQL Server Database
  • Configured Internet Information System (Bindings)
  • Modified the System32 Host File (For local IP to reflect web-site Name)
  • Installed the MSBuild Community Task
  • Installed DotNetNuke Instance

Everything is installed and in place, now I have open DotNetNuke's Site into Visual Studio and configure my project to actually build the module.

I figured if I reference the .dll for DotNetNuke that should suffice, but the Web Forms Project loads all this extra garbage that impacts the development.

Could someone outline the proper way to build your environment from scratch without the template for Visual Studio?


Solution

    1. Setup a DNN Development environment, even if you aren't using my templates I recommend the same dev environment approach http://www.christoc.com/Tutorials/All-Tutorials/aid/1
    2. Using Visual Studio create a new Web Application Project, with a location of /desktopmodules/ in your DNN dev environment. (Follow Step 9 of this tutorial http://www.christoc.com/Tutorials/All-Tutorials/aid/4)
    3. Remove everything that Visual Studio puts into the WAP project (folders, web.config, etc).
    4. Add an assembly reference to DotNetNuke.dll in the website's BIN folder
    5. Right click on the Project properties and set properties on the project to have the Build location be the website's BIN folder (../../bin)
    6. Change the web tab have the following properties set

      IISUrl:http://dnndev.me/desktopmodules/MODULENAME

      OverrideIISAppRootUrl:True

      IIS App Root URL:http://dnndev.me

    7. Add an ASCX file to your project. (view.ascx)
    8. Change the BASE class for the ASCX file to inherit from PortalModuleBase
    9. Compile your module
    10. Register the module with DNN (host/extensions)
    11. Add the Module to a page.

    TL;DR

    1. Save yourself the trouble of steps 2-8 and 10 by using the template.