Tuesday, November 11, 2008

Map a drive letter to a SharePoint document library

This is a cool trick that I hadn't thought of...

Friday, November 7, 2008

Debugging features with STSDEV

I've been banging my head for a few days trying to debug a feature receiver that I built and deployed using STSDEV. After scouring the web I found lots and lots of questions, and typically the same, incomplete, answer. To get things to work, this is what I had to do:
  1. In VS2008, click on Project->Settings->Debug. When you get to the debug settings for your project, you'll notice each of your build targets in a dropdown at the top of the page. Select a target and then scroll and click the 'Advanced' button. By default, STSDEV doesnt generate a PDB for most of its build targets, so you'll want to change the "Debug Info" drop-down selection to "full". Repeat for each build target that you need debug info to be generated for (at least DebugDeploy and DebugRedeploy).
  2. Build and deploy your solution using one of the targets you changed above.
  3. Map a drive to \\machinename\c$\windows\assembly. This allows you to see the file structure of the GAC without the shell getting in the way.
  4. Copy your just-generated PDB file from the project directory to the GAC_MSIL folder in your new mapped-drive directory. You'll need to do this each time you build. *some people say this isnt necessary, however.
  5. Attach your VS debugger to the w3wp.exe process. If there is more than one instance of w3wp running, use 'iisapp' from the command line to get a description for each one. This will help you pick.
  6. Set your breakpoints. At this point the symbols for your assembly might not be loaded (you'll get the dreaded empty-circle breakpoint). Don't worry - VS will find them.
  7. Browse to your feature-activation system page and activate your feature.

Good luck!