If you can only follow a single SharePoint developer blog, it should probably be Andrew Connell (even if hitting Enter in his Search box still doesn’t work in Firefox). If for some reason you haven’t already, make sure you’ve read his excellent SharePoint developer tips and tricks and SharePoint Debugging and Logging Tips and Tricks. Here are a few additional tips from comments there and elsewhere:
AC suggests System.Diagnostics.Trace.Assert(false) to force the debugger; System.Diagnostics.Debugger.Launch() is a more explicit alternative (featured on Corey’s .NET Tip of the Day).
Debugging GAC’d Assemblies
AC says “you’ll need to put the debugging symbols in the same location as the assembly.” While a few of the comments hint that for them it “just works” without that step, that’s probably due to a setting in their environment: Just My Code debugging is likely off. Vincent Rothwell’s Debugging Tips for SharePoint mentions this setting in passing and it has since been highlighted here and here as well.
Attaching to w3wp
Debugging doesn’t work if you aren’t attached to the right IIS worker process. One option is to use the Debugger Feature from the CodePlex Features project, which adds a new menu item to the Site Actions menu that attaches the debugger. If you would rather not install a feature, Doug Perkes suggests adding a VS External Tool to list the PIDs:
- Title: Get IIS PIDs
- Command: cscript.exe
- Arguments: %systemroot%\system32\iisapp.vbs
- Check “Use Output Window”
More External Tools
Speaking of which, Scot Hillier has put together a CodePlex project to support his development process. The installation includes several useful External Tools and more than a dozen developer-focused STSADM extensions. My favorites are enumpools and recyclepool; much more SharePointy than iisapp.vbs /r /a. Or for a GUI try Spence Harbar‘s Application Pool Recycle Utility for SharePoint Developers. For even more STSADM extensions (and some great SP object model code in general), check out Gary Lapointe’s blog.
Some developers prefer to make a copy of their WSPs with a .CAB extension as part of their development process, but if you don’t mind modifying the registry Waldek Mastykarz has a nice post on browsing .wsp files using Windows Explorer. Or if WinRAR is your tool of choice, a .reg with the following will do the trick:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\.wsp] @="WinRAR"
Easy Access to 12 and VirtualDirectories
Waldek also posted about getting quickly to the VirtualDirectories folder in Explorer View. Many developers use a 12 Hive Toolbar; I use the same technique for VirtualDirectories. As for opening in Explorer View, why not make that the default Folder action? Here’s another .reg that does just that:
Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Folder\shell] @="explore"
- WSS v3 CAML on MSDN
- Other CAML Schemas seems an afterthought, but it has some important developer schemas including Solutions and Features
- Adding Intellisense When Editing XML Files in WSS v3 / MOSS 2007
- Two approaches to building CAML from code:
- John Holliday‘s CAML.NET uses static methods to manipulate strings of XML (on CodePlex)
- Nadeem Mitha‘s CamlQueryBuilder is less complete but more elegant, using operation overloads to manipulate a class that inherits from XmlElement
- U2U CAML Query Builder: available for Windows and as a WSS Feature, part of a larger Features Package
If I don’t stop myself now I’ll end up with a comprehensive list of every cool SharePoint thing I’ve seen in the last year. So I’ll leave you with Katrien’s list instead.
Update 7/12/2008: Added U2U CAML Query Builder.
July 12, 2008 at 10:20 am
U2u calm query tool.. Infact U2u hass good blogs for developers. But you pretty much covered everything I use
July 12, 2008 at 2:07 pm
I was debating if I should include the U2U tool since it’s already on Katrien’s list. I guess I’ll err on the side of redundancy, since their tools (and blogs) are definitely worth a look.
July 13, 2008 at 6:44 pm
[…] Another SharePoint Developer/Debugging Tips List […]