Debugging Initialize Pipeline

One of the most frustrating things I’ve run into is when something’s going wrong with a custom initialize pipeline or data provider.  Once Sitecore starts up you can’t go back and re-run the startup code.  Likewise with a data provider, once an error happens resulting in no data, you can’t re-run it while debugging.  However there is a reasonably elegant solution.

  1. Notice there’s a problem with startup code or something that’s held by Sitecore some how.
  2. Pound fist against desk decisively (very important)
  3. Attach a debugger to your app pool task
  4. make a white space change to any .config file, i like to just push [space] then [backspace]
  5. save the config file
  6. your debugger will stay attached and the initialize code will run
  7. debug away!