Wednesday, August 16, 2006
by Nik Kalyani
Wednesday, August 16, 2006 6:02:24 AM (Pacific Standard Time, UTC-08:00)

On the DotNetNuke forums today, jstemper posed a question about how to speed up DNN development, specifically, the delay caused by app re-start when a module is recompiled.

I have invested a considerable amount of time researching the intricacies of Fusion probing to faciliate the co-existence of third-party assemblies with different versions in the same bin folder. In an earlier post on Managing assembly versions in ASP.Net I had provided tips on doing this. Reading this post got me thinking about applying the same technique for DNN development. I did a quick test and everything seems to work. Here is how you can speed-up DNN module development by skipping the app restart that occurs when assemblies in the "bin" folder are updated.

1) Create a "bin" folder under ~/DesktopModules (i.e. ~/DesktopModules/bin)

2) Modify your DNN web.config as follows:

            <runtime>
              <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
                   <probing privatePath="bin;DesktopModules\bin" />
              </assemblyBinding>  
           </runtime>

If you have a <runtime><assemblyBinding> section already present, just add the <probing ... > element, otherwise, you can just add this whole block right before </configuration>.

The "privatePath" attribute tells Fusion where to search for assemblies referenced by an application.

3) Change your module's script (ascx) file so the "Inherits" attribute includes the assembly name like this:

Inherits="Speerio.DNN.Modules.SkinStudio.Editor, Speerio.DNN.Modules.SkinStudio"

This corresponds to a typename of "Speerio.DNN.Modules.SkinStudio.Editor" and an assembly file "Speerio.DNN.Modules.SkinStudio.dll" (note: the extension should not be included in the "Inherits" attribute value).

4) Change your module’s VS.Net project build folder to ~/DesktopModules/bin

That's it. Now, when you recompile your module, there will be no application restart and the only assemblies that are converted from bytecode to native code are your module assemblies.

Please post a comment if you encounter any problems so I can modify the procedure if necessary.

#    Comments [4] - Trackback    

Monday, August 21, 2006 3:26:41 PM (Pacific Standard Time, UTC-08:00)
Hi,

Good move, though, I think it is too good to be ture. I started developing with that approach and *sometimes* the DLLs got locked out with the aspnet process, are we back to the days of Builder.Support !!!

If anyone could help out in how *sometimes* this happens that would be great approach for snap development.

Regards,
Nader Soliman
Sunday, September 03, 2006 4:34:48 PM (Pacific Standard Time, UTC-08:00)
Hi Nader,

Some insights on the problem here:
http://www.devtao.com/2006/09/04/Locked+Assemblies+When+Using+Ltprobing+PrivatePathquotquotgt.aspx

Nik
Nik Kalyani
Tuesday, September 05, 2006 6:24:24 PM (Pacific Standard Time, UTC-08:00)
Are you certain this works with ASP.NET 2.0? .NET 1.x monitored specific files and folders but .NET 2.0 monitors every folder for app related files.
Dwayne J. Baldwin
Tuesday, September 05, 2006 7:19:03 PM (Pacific Standard Time, UTC-08:00)
Hi Dwayne,

ASP.Net 2 monitors for and compiles script files, themes etc. Since assemblies are already compiled, the ASP.Net engine has no additional work to do other than shadow-copying the assembly to a temp folder. The standard location for assemblies is in the application's "bin" folder. The "probing" element simply tells ASP.net to look for assemblies in other app sub-folders and works the same in ASP.Net 2 and 1.1. The "probing" reference for ASP.Net 2 is here:

http://msdn2.microsoft.com/en-us/library/823z9h8w.aspx

Nik
Nik Kalyani
Name
E-mail
(will show your gravatar icon)
Home page

Comment (Some html is allowed: a@href@title, b, i, u) where the @ means "attribute." For example, you can use <a href="" title=""> or <blockquote cite="Scott">.  

Enter the code shown (prevents robots):

Live Comment Preview
RSS feed
Search and Links
Bling

View Nik Kalyani's profile on LinkedIn

Contact me: nik*kalyani.com (replace "*")

TechBubble
www.flickr.com
This is a Flickr badge showing public photos from techbubble. Make your own badge here.
Statistics
Total Posts: 213
This Year: 31
This Month: 8
This Week: 0
Comments: 235
About the author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008
Nik Kalyani
Sign In
All Content © 2008, Nik Kalyani