Iv just started developing my first module in DNN. My assignement is to develop a module, which in turn using web references, communicates with a webservice to submit and retrieve data. The module needs to be complied, and put in a package for distribution. No source code.
Ofcourse, I get the latest version, 4.0, and follow the instructions. And later, I notice that the pdf documentation was for version 3 ofcourse, but hey, I did learn something on how it used to be done! I then find the http://forums.asp.net/1114393/ShowPost.aspx post explaining about starter kits etc, and how it should be done in DNN 4.0. How nice =)
Ok, so I follow this instruction about how to develop modules in DNN4 and VS 2005.
First thing im having problems with is the structure in which my module is developed. First, I have a folder in the App_Code folder, with my providers. Then I have another one within the DesktopModules folder with my controls and other stuff. Ok, 2 folders with files for my module. Then, I need my web reference, so I add one, and now I have code in the App_WebReferences aswell. So, now I have 3 folders with code relating to my module. Adding another module, and that too with a web reference.. Now, I basically think I have what I think is a start of a really good mess of code... So, im thinking, the idea how they did it in DDN3 just looks better. Basically, having a module project for ur module code, compiled into a nice module dll...
But anyway, I wont give up that easy, Ill really try to do as the DNN4 starter kit intructions tell me. So, I "publish" my DNN solution, to compile it. I select the "Use fixed naming and single page assemblies" option. Now, my controls each get their own compiled dll (which to begin with, is not what I want), but the big problem here is, my 2 web references get compiled into 1 App_WebReferences.dll! Hmm.. do I need a seperate DNN solution for each module I develop? That cant be right. Also, there may be a problem with 2 modules having the same name for their web references etc.. So, Im again thinking the DNN3 way seems better. So, ill try that.
So, ok, I try the "old fashioned way" iv learned through reading the DNN documentation. Now, what project type should I use for my DNN module project? I need something which can compile Web User Controls etc, so I try something called "Visual Studio 2005 Web Application Projects" (http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx), which basically works like the old VS 2003 web application project. Now, I have a project which can compile into a nice dll, and that I can add Web User Controls to etc.. I also can add my web references, and they are also compiled nicely into my project .dll. That is my idea anyway. However, before I even start to compile my new module project, I get alot of errors in my controls. This is because my module controls references controls in the DotNetNuke site like this: <%@ Register TagPrefix="dnn" TagName="Audit" Src="~/controls/LabelControl.ascx" %> So im trying everything I can think of to reference that control. Changing the Src to "../../controls/LabelControl.ascx" etc etc, but I simply cant get it to work. Seems like it isnt possible to register controls that isnt part of the project. So, if I have a standalone module project, I cant use DotNetNuke's controls?
Seems like however I try to do it, there's a problem around the corner. Trying to use the DNN4 starter kit, I cant compile the project the way I need to. Trying to use a module project, and I cant compile the project because the controls reference DNN controls.
Basically, what im tryin to figure out, what is the best practice here? How should a module development and compilation/packaging environment like this be set up? Please help me out!
|