Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Speeding up ASP.NET development

We're developing web applications using DotNetNuke as a framework and our custom modules for required functionality. The problem is, that it takes a long time for the website to load when you do any changes to code. I'm looking at up to 1 minute for each restart, which really is painfully slow. This leads to very slow develop-rebuild-test cycle.

We're using both console projects and winforms projects as testing ground for new functionality for faster development, but still there is lots of UI functionality that has to be done with a browser.

Does anyone have any tips on how to speed up/prevent the appdomain restart that occurs when something changes in the bin folder of a web app?

like image 690
Morri Avatar asked Nov 06 '22 21:11

Morri


2 Answers

DNN does a compile on demand when you add/change pages, if you pre-compile them your turn around time should be much faster.

like image 142
MrTelly Avatar answered Nov 15 '22 17:11

MrTelly


You're bumping up against a drawback of ASP.NET, when used with large web apps.

DotNetNuke has many significant DLLs and VB files that will all have to be reprocessed if all you do is change one single DLL. If you have 50 Module DLL's in your bin, all 50 Module DLL's will be reprocessed by ASP.Net upon your next application request.

Here is my suggestion:

Hook up the following folders to your source control (not your entire DNN folder):

  • bin (I suggest ignoring all DNN DLL's, so upgrades go smoother)
  • Portals_default\Skins
  • Portals_default\Containers
  • js
  • DesktopModules (ignore Admin or any built in modules)
  • images (ignore the core DNN images if you wish, or any of your own clunky images folders like thousands of customer photos)
  • (optional) CompanyName\ (where you might wish to keep other .NET Projects that need relative access to DLL's in the bin folder)

When one of your developers requires repetitive compiles / page loads, he will benefit most by eliminating as many DLL's in the bin folder as possible. It will also help to use a barebones skin for testing, if you can (They are very easy to make).

The barebones skin (which should utilize 1 or 2 skin objects, at most) and an absolute minimum of DLL's (DNN Core + the bare minimum of your own) will get you the best speed for development.

When your developer is done with the focused development of the one module, he can update those folders which he deleted items from source control (svn here), finish testing his code in the context of the full DLL/Skin set, and he'll be set.

Sometimes it is worth the trouble. I can't get you down to a few seconds of ASP.NET reprocessing, but I can get you down to 10-15 seconds. (assuming you're running on an SSD)

As far as production restarts, make sure your APP Pool recycles during off-hours.

I've looked into whether multi-core setups can somehow decrease this reprocessing time, but haven't had any luck (I have an open question on serverfault)

like image 43
Brian Webster Avatar answered Nov 15 '22 16:11

Brian Webster