Skip to content

Setting Up your DNN Extensions Development Environment

Ernst Peter Tamminga edited this page Jul 3, 2018 · 4 revisions

The purpose of this document is to guide a developer on how to configure, build and test DNNPlatform Extensions projects. It makes the assumption that you have a version of Visual Studio 2012 or higher and a basic knowledge of Git/GitHub.

IMPORTANT NOTE

This documentation will be updated so that it references Visual Studio 2015 and higher & the use of NuGet as the replacement for referencing the various DNN DLL's directly. Feel free to start to do this...

Step 1: Install DNNPlatform

If you don't already have a development instance of DNNPlatform installed on your system, you will need to set one up. The extension project specifies which versions of DNNPlatform is required. If you have a later version of DNNPlatform installed, that will work as well, but you will need a copy of the version binaries (DLL's) as specified in the project for use as references. This will be covered more in step 6.

Step 2: Install the Latest Extension Package

Download the latest Extension install package from the releases page of the project and install it into your development instance. The purpose of this step is simply to install the Extensions objects into your DNNPlatform database. After you've completed the install, go ahead and delete the "Extensions" directory from [DNNPlatform Root]/DesktopModules/. We'll recreate this directory in step 5.

Step 3: Install Git

Next, make sure you have Git installed on your development machine. Git for Windows is all that is really required, but other files linked below can be helpful too.

Step 4: Create Your Own Fork of the Extensions Repository

If you haven't already done so, create an account on GitHub and get your security keys established. The GitHub for Windows tool linked above provides a very easy way to do this if you're new to Git. It will automatically generate your security key and associated it with your account. You can also use it to configure your Git preferences.

Once you're logged into GitHub, visit the Extensions Repository, select the Extension you are interested in and click on the "Fork" button and follow the steps to create your own fork of the project. Once you've created your fork, make note of the clone URL displayed in the right-hand column on GitHub. You'll need this in the next step.

Step 5: Clone the Fork to Your Local Repository.

Using Git Bash (or any other command window that supports git), change to your [DNNPlatform Root]/DesktopModules/.

Note: If you didn't delete the Extensions directory in step 2, do so now. The clone command will fail if the Extensions directory already exists.

Clone your fork using the following command (updated with your own username).

git clone [email protected]:YourGitUsername/TheDNNExtensionYouSelected.git

At this point, you should have a new Extensions directory that contains all of the source files including the Visual Studio project and solution files.

Note: For more information on the Extensions branching strategy, please see the Extensions Contributors Guide

Step 6: Configure Your Project References

Open Visual Studio and load the Extensions solution contained in the [DNNPlatform Root]/DesktopModules/Extensions directory.

Once the project has loaded, open the solution explorer window and right click on "References" under the Extensions project. You will need to add a reference to each of the following files.

  • ClientDependency.Core.dll
  • DNNPlatform.dll
  • DNNPlatform.Web.dll
  • DNNPlatform.Web.Client.dll
  • DNNPlatform.WebControls.dll
  • DNNPlatform.WebUtility.dll
  • Microsoft.ApplicationBlocks.Data.dll
  • Microsoft.Web.Helpers.dll
  • Microsoft.Web.Infrastructure.dll
  • Telerik.Web.UI.dll

Note: You will find the DLL files in [DNNPlatform Root]/bin. If your DNNPlatform development instance is later than version 7.0.0, you should download version 7.0.0 install package and extract the DLL files from the bin directory that it contains.

Tip: You may want to copy the all of the files from the bin directory into a separate directory tree used specifically for references. For example: c:/DNNPlatform/references/7.0.0. Using this method, you can upgrade your development instance to whatever version of DNNPlatform you like, but still have the Extensions project build against the required 7.0.0 DLL files.

Step 7: Setup Your Build Target

Now you need to configure the project so that when you build, the Extensions all files are placed into the bin directory of your DNNPlatform development instance.

In the solution explorer, right click on the "Extensions" project and select "Properties". This should bring up the properties page for the project. Click on the "build" tab. Toward the bottom of the build tab you will see a section titled "Output". Set the Output path to point to your development instances bin directory. The correct value should be "..\..\bin".

Step 8: Building Extensions

At this point, you should be able to successfully build the Extensions project and use it within your DNNPlatform development instance. You will notice that the project has "Debug" and "Release" configurations defined.

If you wish to debug the project, select the "Debug" configuration and then select "Build Solution" from the "Build" menu. Once the project has built successfully, you must attach the debugger to the IIS worker process. To do this, click the "Debug" menu and select "Attach to Process". This will bring up the process selection dialogue. Make sure the "Show processes from all users" checked and select the "w3wp.exe" process. Click the "Attach" button and follow the prompts to complete the attachment process.

Once you have successfully attached to the process, you will be able to debug the code using breakpoints, etc. Once you are done debugging, click the "Stop Debugging" button. Rebuilding the code will also stop the debugging process.

In some cases, you may want to build the Extensions installation package so you can do a test install in another DNNPlatform instance. To do this, select the "Release" configuration then rebuild the solution. Once the solution has been successfully built, you should find a new installation package in the [DNNRoot]/DesktopModules/Extensions/packages directory.