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?
Honestly, the best bet if you want is use Chris's template as a base, and edit it to get it as plain as you want it to be.
I have a plain template that only has the MSBuild configuration in it as I don't even have local copies of DNN on any of my development machines.
The key magic pieces of his template is the MSBuild stuff, and I go one step further and use NuGet to manage the packages/references to DNN that way I don't have any other DNN files locally.
This is what I used to do BEFORE I started using a template. Very similar to @bdukes but rather than developing in the DesktopModules folder, I like to keep my modules in their own projects outside DNN.
- In Visual Studio, select File -> New -> Project.
- Select '.NET Framework 4' from the version dropdown and C# -> Web from the tree pane on the left then 'ASP.NET Empty Web Application'.
- Delete the web.config file.
- Add a reference to the DotNetNuke dll.
- Add a new user control to the project, this will be your main view for your project.
- Make sure the user control inherits from DotNetNuke.Entities.Modules.PortalModuleBase instead of System.Web.UI.UserControl.
- Build the project in Visual Studio.
- Right click on the Project in Visual Studio and select 'Open Folder in File Explorer'.
- Copy the DLL of your project into the bin folder of your dotnetnuke instance.
- Paste the project folder in your DotNetNuke instances DesktopModules folder.
- Delete all files except the user control you created from the folder you pasted under DesktopModules.
- Login into your DNN instance.
- Navigate to Host -> Extensions -> Create New Module.
- Select 'Control' from the dropdown.
- Select the module folder (not owner folder) you pasted in DesktopModules.
- Give your module a name and tick the option 'Add Test Page'.
- Click 'Create Module'.
You will then be taken to a test page with your new module running with only an empty user control. You can then add controls into the modules folder, rebuild and copy the new DLL into DNN's bin folder and you'll see the changes in DNN.
I would then go back to Host -> Extensions and click edit (the pencil) next to the newly created module. At the bottom of the page there is a 'Create Package' button. Follow the prompts until you're at the preview manifest file. Copy this as your modules manifest file and add it to your project.
Don't forget to add any new views, edits, settings controls to the module definitions and re-create the manifest. (Host -> Extensions and click edit (the pencil) next to the module -> Module Definitions heading)