Skip to content

What does the DnnPackager NuGet package do

nvisionative edited this page Mar 29, 2016 · 7 revisions

Update: For an introduction to DnnPackager - read my blog post

When the DnnPackager NuGet package is installed, it adds the following files to your project:

  1. manifest.dnn
  2. licence.txt
  3. relasesnotes.txt
  4. DnnPackageBuilderOverrides.props

It also add's a custom msbuild .targets file to your project, containing the necessary build logic to do the wonderful things that it does.

Lastly, it also extends the package manager console in VS, with additional commands that you can use to help streamline your development workflow.

Automated Installation Zips When You Build Your Project..

From now on, when you build your project, it will be packaged up into a DotNetNuke Installation Zip. Check your projects output directory for that installation zip file.

What You Should Do

1. Update the "manifest.dnn" file in your project appropriately. 

Automated Deployments from within Visual Studio

You can deploy your module to a local DotNetNuke website (hosted on your local IIS) very easily.

1. In VS, Open up the "Package Manager Console" window, and select your project from the projects dropdown.
2. Type: `Install-Module [name of your website]` and hit enter.
3. Watch as your module project is built, packaged up as a zip, and then the zip is deployed to your local Dnn website!

For example, if your Dnn website is named "Dnn7" in IIS, then you would run:

Install-Module Dnn7

Note: This will build and install the module for your active build configuration. You can override this by using:

Install-Module [name of your website] [Build Configuration Name]

e.g if your current active build configuration was debug, but you wanted to install the release build of your module, you could type:

Install-Module Dnn7 Release

For debugging, you can automatically attach the debugger! Run:

Install-Module [name of your website] [Build Configuration Name] Attach

e.g: Install-Module Dnn7 Debug Attach

That will install your module, and then attach the debugger for you.

Note: To save time in future, you can hit "up" arrow key in Package Console Manager to get the last command you executed to save you having to type it every time. So typically you can just hit "up" and then hit enter key, and you will be debugging your module in no time.

The DnnPackageBuilderOverrides.props file - Customising Installation package Content.

A file named "DnnPackageBuilderOverrides.props" was added to your project. This file allows you to override the default packaging logic for your project. For example, you could include additional files in your zip file etc. Please take a look at the contents of "DnnPackageBuilderOverrides.props" - it has commented out sections that demonstrate properties that you can override if you want to. It shows how to include additional files, dll's etc etc.

Advanced Features

Debug and Release packages

When doing a Debug build, wouldn't it be handy if the Dnn zip installation package (and manifest file) included pdb's? When doing a release build however, wouldn't it be handy if the zip installation package (and manifest file) didn't have those pdb's included? DnnPackager supports this scenario, by allowing you to have multiple manifest files in your project, one per build configuration. If one is found for the current build configuration then it will be used. For example, if you have a manifest.debug.dnn in your project, then when doing debug builds, this manifest will be included in the zip file. This means you can have a seperate manifest.debug.dnn and a manifest.release.dnn, and include things like pdb's in the debug version, but not in the release version of the install package.

Output NuGet Packages

See wiki.

I'm just one man..

I hope this helps you. If you do have any feedback, raise an issue and we'll discuss.

Darrell Tunnell (Dazinator) http://darrelltunnell.net/