Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDebugging a compiled moduleDebugging a compiled module
Previous
 
Next
New Post
3/27/2012 12:15 PM
 

Hello all

Can somebody help clarify something to do with debugging for me? I have written a compiled DLL module, that installs OK by choosing the zip package, and which I can add to the page OK, but I am unsure about the implications of installing a module as a compiled DLL when there still remains the need to carry out debugging. 

Is the idea of installing a compiled module DLL purely something geared towards distribution of the final completed module? At the moment, I am coming to the conclusion that installing a module in the form of a compiled DLL is only suitable for a module that is already finished and debugged completely. I say this because there does not seem to be a way to quickly test changes to the code in such a module after a debugging run. In other words, even though I can successfully investigate the original code by going through it with an attached debugger, in the module's solution, there does not seem to be a way to test new changes to the code without first uninstalling the module, rebuilding the zip package (and therefore the compiled DLL for the module included in the package) , and reinstalling the package. In an attempt to avoid the uninstall/reinstall procedure I have tried manually replacing the newly-built module DLL, by copying it to DNN's bin folder, but this not unexpectedly creates an error on the page with the module added, presumably because the replacement DLL found in bin no longer matches that registered during the original module install.

So possibly my query can really be answered with a Yes or No to these questions:

1. Is there any way to replace a module DLL with an updated build without having to go through the whole uninstall, build, reinstall procedure each time I need to make a change to the code.

And if not ...

2. Should I instead just install the module extensions directly, by using the Create New Module options to get the module controls into DNN, at least until the module development is completed, as this would mean that the code behind for each user control in the module would be recompiled each time it had changed.

I'm expecting the answers to be No, then Yes, but I would like to know if I have worked this out correctly, and that I have not missed a more elegant technique, or a way of corner-cutting way, that would allow me to debug and then straight away update the code for a compiled DLL module.

Thanks if I could get any clarifications about this.

Regards

 
New Post
3/27/2012 1:13 PM
 

Paul,

I assume that you are developing compiled modules within a child folder of DesktopModules and that following each build of the module project the compiled assembly is placed into the website's /bin folder. Unless you need to register additional module definitions or module controls there is no need to edit the module's configuraration (in Host --> Extensions) and certainly no need to uninstall then reinstall a new zip package each time you make a code change. The very act of replacing the module's assembly (dll file) in the /bin folder will force an application restart so the next time that you refresh or re-open the site's test page you should see the effects of the code changes you made. I also presume that any changes in SQL tables or stored procedures that you are making are also done in the test website's database.

I don't normally even register the module's package, definition and controls in Host --> Extensions (Create New Extension) until I reach the point of beginning the test-debug-modify-rebuild cycle. Likewise I don't create the SqlDataProvider script file or files until nearly the end of the process when I'm ready to package the module. Finally, following that packaging I will do multiple installs, uninstalls, and if appropriate upgrades against various versions of DNN and make any final code and packaging changes before release.

If you are not already using one of the compiled module templates check them out as you'll find that they greatly simplify the development cycle and include various levels of support for automated packaging using MSBuild or NANT scripts.

My development environment is a bit different than most in that I prefer to develop my modules completely outside of the DesktopModules folders of a particular DNN website installation. Each time I rebuild my module project an MSBuild script "deploys" the module's assemblies into a selected test site's /bin folder and the modules's ascx controls, localization resource files, javascript files, css files, images, etc. (the non-compiled content files) into the selected test site's /DesktopModules/MyModule folder. I am still able to debug by attaching the VS debugger to the ASP.Net worker process under which the particular test site is running.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
3/27/2012 1:43 PM
 

Hello, and thanks for the quick response.

Hmmm, this information is quite interesting, and although it is better news than I was expecting, it does throw up a couple of questions.

Yes, the first assumption you state is true, the module solution is actually based inside the DesktopModules folder structure, to be honest I thought that was a requirement. 

When it comes to the second assumption you give -  at the moment, the build process just packages up the compiled module into the zip package, and it does not copy it directly into DNN bin folder - I thought this DLL copy was something that could only be done by the module registration process in DNN, so presumably this is another misconception of mine.

My MSBuild code is indeed based on material originally gleaned from the starter kit template, but that was long ago with lots of changes since, so I can't really justify starting all over again with a new MSBuild project, I need to get this current one to behave - presumably I have 'customized' something along the way that I shouldn't have! That's OK though, I'm relatively comfortable with MSBuild, I just need to clarify what it should definitely do.

Presumably then, it would be acceptable for my build process to still be packaging up the DLL inside the ZIP package for the initial install as it currently does, but also for the build process to provide the short-cut around the reinstallation process that I seek, by copying the DLL into DNN's bin folder aswell. 

I reckon that in effect this is what I have been doing, by manually copying the DLL, but as long as you could clarify that automating the DLL update with MSBuild is a valid approach, I can eliminate this as a source of the problem, and move onto looking at why the changes I made caused the module load exceptions in the first place.

To summarize, I am going to try to experiment with getting MSBuild to: create the new DLL in the solution's bin folder; then package it up into the zip; and finally to copy the DLL into DNN's bin folder at the website root. When in debug mode this would result in the PDB file getting copied into these locations too, I suppose. If I ensure I have the same version of the DLL in all 3 places, presumably that will eliminate any possibility of pdb file mismatches etc that might be interfering with the debugging process. 

Hopefully that makes sense! If you could just assure me I am on the right lines, that would be very helpful indeed.

Regards

 

 
New Post
3/27/2012 1:48 PM
 
Paul,
You may find this to be a good place to start looking at the MSBuild process:

http://christoctemplate.codeplex.com/

I've been using Chris' template for my last ten or so modules....it does what you need out of the box. While it might be too late to port your code...it should help get you closer to an automated build process within the framework.


Steven Webster
Manager, Community Platform
F5 Networks, DevCentral
 
New Post
3/27/2012 2:01 PM
 

Hi there

Thanks, but that is what I meant, I already used the template, and I have a good automated MSBuild project already that builds a ZIP package successfully - it's just that I need to clarify how far I can go with the automation: can I just send the DLL file to the DNN folder without a reinstall, I think that is what Mr Severance is suggesting.

Regards

 

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesDebugging a compiled moduleDebugging a compiled module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out