C# Compiled DotNetNuke Module Template
Location: BlogsBrian Dukes    
Posted by: Brian Dukes 10/7/2008 9:32 AM

It shouldn't be hard to get started writing a module for DotNetNuke, but it doesn't seem like there's a whole lot of help especially when you are wanting to use C#.  At Engage, we have created a Visual Studio project template which will get you started developing a C# DotNetNuke module, using a Web Application project (rather than the, in my opinion, much more cumbersome Web Site project).  It is available for free on our downloads page after registering on the site.

The template will get you started with the basics of a DotNetNuke module, providing basic placeholder controls (for view, edit, and settings), base classes to use for your module controls and your settings control, a manifest and NAnt build file to easily package your module, and the basic starting point (and sample code) for your business controller class and data provider.  It should really speed up how you start a new module, and free you from always copying your last module and then having to figure out what to delete and what to leave.

To use the template, put the downloaded zip file into the C# web templates folder for Visual Studio.  This is typically in My Documents/Visual Studio [2005|2008]/Templates/ProjectTemplates/Visual C#/Web (you might have to create the Web folder yourself).  This will make the new project type appear under the Web node for C#, in the My Templates section, when you create a new project.  You might also want to open up the zip file and alter the template manifest (C# Compiled Module.vstemplate) to include your company name (replace the values in the CustomParameters section where it says YourCompany).

Please check it out, we hope it helps you out.  Happy module building!

Permalink |  Trackback

Comments (11)   Add Comment
Re: C# Compiled DotNetNuke Module Template    By Erik van Ballegoij on 10/8/2008 8:30 AM
Brian, fyi, since DNN 4.9.0, there is also a C# Compiled Module Template as part of the starter kit

Re: C# Compiled DotNetNuke Module Template    By James on 10/8/2008 8:43 AM
Cannot get this to appear in my new project list. I've tried it in various locations but no luck. Anyone else had any luck?

Re: C# Compiled DotNetNuke Module Template    By dukesb11 on 10/8/2008 8:43 AM
Thanks for pointing that out, I hadn't realized that had been added. Looks good, though a few less features that this one (NAnt script, base classes). Good to know.

Re: C# Compiled DotNetNuke Module Template    By han on 10/14/2008 2:04 PM
Hey, Brian:<br><br>I can get the module template to show up under my templates when I'm creating a new C# web project. But this is a stand alone project. How do you get it plugged into a DNN website instance, like the one from the Starter kit download from dotnetnuke.com website? Thank you.

Re: C# Compiled DotNetNuke Module Template    By dukesb11 on 10/14/2008 2:05 PM
han, you can create the module in its own project, and then package it using NAnt and the provided build script. From there, you can install the module onto whatever site you want. You can also place the module in a website's DesktopModules folder while you're developing, if you'd like.

Re: C# Compiled DotNetNuke Module Template    By dukesb11 on 10/14/2008 2:08 PM
James, to find out where Visual Studio is looking for template go to the Tools menu, and choose Options. From there select Projects and Solutions and then choose General. There is a User project templates location text box. Once there, there'll be a Visual C# folder, and you can put the zip in there, or in a sub folder of that named Web. Hope that helps!

Re: C# Compiled DotNetNuke Module Template    By han on 10/15/2008 7:37 AM
Hey, Brian:<br><br>I'm a little confused. Are you saying that we can develop the module as its own project? If so, how do I run it? Could you elaborate on your previous post? Thanks a lot.

Re: C# Compiled DotNetNuke Module Template    By dukesb11 on 10/15/2008 8:55 AM
han, I don't think I can give you an adequate answer in the comments section here, look for a blog post on this later today.

Re: C# Compiled DotNetNuke Module Template    By han on 10/15/2008 9:07 AM
Alright. Thanks.

Re: C# Compiled DotNetNuke Module Template    By dukesb11 on 10/17/2008 1:08 PM
han, that post is at http://weblogs.asp.net/ianrobinson/archive/2008/10/15/creating-dotnetnuke-modules-using-a-web-application-project-wap.aspx

Re: C# Compiled DotNetNuke Module Template    By han on 10/17/2008 1:31 PM
Great. Thanks.


Your name:
Title:
Comment:
Add Comment   Cancel