Tuesday, February 27, 2007

SharePoint Development Tip: Watir + WatirRecorder++ == Goodness

Much of SharePoint development is sheer drudgery.  Watir and WatirRecorder++ to the rescue!

Need to remove and re-add a workflow to a document library or list?  That’s a lot of PITA keystrokes and clicks, and a lot of awful screens of “View Source”.  Use WaterRecorder and drive your IE session around the actions you need to repeat.

Tired of recreating steps in a workflow to get to one step where you can begin debugging?  See above.

Watir and WatirRecorder have been a nice breath of fresh air in an otherwise miserable several weeks of MOSS development.

Next up: Trying PowerShell to see if I can get any speed improvements!

Sunday, February 25, 2007

SharePoint Workflow Project Template Problems

If you’re using the SharePoint Workflow templates you may want to make one change to the PostBuildActions.bat file.  Currently the batch file deletes the old feature, copies over the new bits, and then deactivates and uninstalls the feature.  This can leave you with orphaned bits and pieces around if you’ve been doing things like renaming or removing content types, InfoPath forms, etc.  You’re hosed because the batch file, as is, doesn’t get rid of the old bits on SharePoint before killing things off the file system.  Not good.

Here’s a suggestion (which it should be noted I’ve not actually tested yet…):  Alter the PostBuildActions.bat file in the project template files, located normally in C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\ProjectTemplates\CSharp\SharePoint.  Open up the seqcs.zip and smcs.zip files therein, extract and edit the aforementioned batch file, then add it back to the template zip files.

You’ll need to grab the lines

ECHO.
ECHO Deactiviating and uninstalling the feature...
ECHO.

%STSADM% -o deactivatefeature -filename %PROJECTNAME%\feature.xml -url http://localhost
%STSADM% -o uninstallfeature  -filename %PROJECTNAME%\feature.xml

and move them up above the lines in the section “Deploying the feature:“.

Regional .NET Conference 28 April

Save 28 April, 2007 on your calendar if you’re in the Ohio/MI/PA/IL area.  The second-annual Day of .NET in Ann Arbor, MI, is on its way!

Last year’s event was terrific and I’m sure this year’s will surpass last year’s!

(Plus you’re able to hit Zingerman’s Deli while you’re in town…)

Saturday, February 24, 2007

Book Review: The Old New Thing

The Old New Thing: Practical Development Throughout the Evolution of Windowsby Raymond Chen, ISBN: 0321440307

This book is full of highly-entertaining articles on everything from why you can’t install Windows via XCOPY to the evolution of Win32 dialog templates.  OK, maybe I don’t find the bits about dialog templates so interesting, but the rest of the book is full of very interesting topics on how Windows has come to be what it is.

Chen has been in the Win32 world at Microsoft for a very long and really, really knows his stuff.  He’s very skilled at what he does and is very forthright about what he doesn’t know. His show on DotNetRocks was much along the same lines as this book: lots of very deep dives into areas of his expertise with clear disclaimers “That’s out of my realm.”

So what use will this book be for folks who are outside the Win32 arena?  First, it’s a nice background on some basic Windows behaviors like why the Shutdown option is under the Start menu, what overlay icons do, why registry files are called hives, and odds and ends about internationalization.  There’s also a lot of content which is applicable to folks in any domain: taking appropriate care with world-writable files, the impacts of server paging, or general bits about developing sort routines.

Secondly, the book is just plain entertaining.  Chen writes in a light, humorous fashion and manages to make most of his articles very interesting.  (It’s impossible to make a couple pages of example machine code immensely exciting, but Chen comes close.)

Overall the book’s a good skim for folks like myself.  I’d say it’s extremely important if you’re involved with Win32 development — and that means .NET folks who are doing a large bit of Interop programming.

His blog, the Old New Thing, is a good read as well and gets a lot of great discussion in his comment threads.

(As always, see my standard book review disclaimer.)

Tuesday, February 20, 2007

A Few Quick Thoughts on SharePoint Development

My colleagues (Rus and Ana [no blog, yet]) and I have been working hard at trying to be productive in the MOSS/InfoPath/Workflow space these days.  It’s a very powerful envrionment with some great capabilities, but it’s also a very difficult environment to work in.

Test Driven Development?  Forget about it.  Clear logs with easily understandable error messages?  MOSS scoffs at thee.  Looking to avoid lots of tedious, error-prone hand coding of text fields which get no checking during compilation?  I think not.

We’re having to focus on breaking every task down to tiny pieces, lock those down, and move on to the next bit.  I lost a scad of hours trying to chase down why my task InfoPath forms weren’t reading in workflow data — it turns out I’d had a simple casing error in the ItemMetadata.xml file used to define the structure for the secondary data connection to the IP form.  No errors anywhere to be found, and no indication in IP or even traffic across the wire.  (Yay for Fiddler!)

Despite all this frustration, we’re getting some good work done and we’re starting to get a good handle on the right way to approach things.  Some seemingly simple fundamentals really pay off:

  • Naming matters.  Use clear names for your activities, tokens, properties, and fields.  “Task1Token” isn’t anywhere near as sensible as “ContractSubmissionTaskToken,” nor is “OnTask2Changed” as clear as “OnAdditionalReviewerChanged.”
  • Keep solid software practices in mind, despite what you might see in example code.  The samples in the SDK seem to like using public fields to expose data.  Huh?  Forget that, Vern.  Go read Wagner, McConnell, or just about any good book on development.
  • Source control is your friend.  Nail down one bit of functionality.  Check in your changes.  Move to the next bit.
  • Tools are your friend.  XMLDiff, WinMerge, Fiddler, Cygwin, and a few other pals have made their worth well-known to me in the last month.  Logparser is something I’m quickly heading off to check in the hopes it can help me tame the copious logfiles MOSS produces.
  • Lock down a process and automate it.  Developing on MOSS is an exercise in numbing repetition.  Build a solution.  Copy files to a folder.  Run stsadm to install a feature.  Activate the feature.  Restart IIS.  Remove old workflow from library.  Associate new workflow.  You really want to do all that by hand eight billion times?  I think not.  Make use of the power of batch files, NAnt, and PowerShell scripts — or likely some combination of all of those.  We’re only at the start of this part, but we’ve got some good ideas on how to press on.

There’s been plenty of pain on this journey so far, but I think we’re seeing the light at the end of the tunnel now.  Hopefully it’s not a train.

Oh, yeah.  The most important thing that’s paid off for me: The folks who are working with me are a lot sharper than I am.  That’s always a great help!

Monday, February 19, 2007

Dev Books for Non-Dev Managers?

OK, so you’ve seen me review thousands of development-related books (ok, maybe 20) but I’ve been posed a very interesting question by a manager who’s not a developer: What are good books for a technical manager who’s not currently in the development arena but will be overseeing a staff of developers? 

Some context: This fellow is a sharp guy in the infrastructure arena (think serious skill in the Exchange, SMS, MOM, servers, etc. domain) and is a fast learner.  He also gives a rat’s ass about getting things done right and wants to know what makes developers tick, a bit about the technology (we’re a .NET shop), and something about how developers go about doing their work.

My recommendations so far are David Chappell’s Understanding .NET: A Tutorial and Analysis and Andy Hunt/Venkat Subramaniam’s Practices of an Agile Developer.  I like the former because it’s very short and hits things from the CLR/CLI to languages to web services.  The second is my bias to Agile things and how I’d like my work environment to be set up.  Come to think of it, I should toss in Peopleware because that’s such a killer piece on environment in general.

What books would you recommend to expose someone to the basics needed to effectively lead a group of developers, both from a high-level understanding of the technology as well as understanding what/how/why developers work? 

(Let’s not go off the deep end with Effective C#, Code Complete, or the Gang of Four book, OK?)

An Evening on Windows Developer Power Tools

Interested in finding out how you can increase your development productivity and boost your software’s quality?  If you’re in the Dayton/Cincinnati/Columbus area (or are willing to drive here), then come to Max Training in Mason, Ohio, on Wednesday, 14 March, for an hour-long discussion of open source and freeware software development tools.

I’ll be talking about a few of my favorite tools from Windows Developer Power Tools, plus I’ll be giving away a few copies of the book after the talk’s done.  The event’s co-hosted by the nice folks I work for at NuSoft Solutions and the great folks at Max Training.

Register for the event here.  Pizza and sodas provided after the event, which means you have to sit through my spiel before you eat.  Snore quietly, at least, please.

Friday, February 16, 2007

Thursday, February 15, 2007

Book Review: Windows Vista -- the Missing Manual

Windows Vista: the Missing Manual, David Pogue.  ISBN 0596528272

This is the second book in the Missing Manual series I’ve gotten my mitts on (the iPod one being the first) and I’m extremely impressed with the series so far.

This book does a great job of covering topics that everyone from novice through experienced mid-level folks can use. The format, writing style, and layout make the book easy to browse through, and the great table of contents and nicely done index make it fine as a reference.

The content ranges from basics such as how to tweak your system’s appearance to more technical topics like delving in to the search infrastructure in Vista.  There’s also an entire section of five chapters guiding you on details surrounding networking in Vista, plus there’s a separate appendix dedicated to details on installing Vista.  If you’re feeling very frisky there’s yet another appendix on “Fun with the Registry.”  The section on Vista’s multi-media capabilities is particularly well done and has given me some very interesting ideas for ways to better use my Vista-based home systems.

I think the book does a great job of filling in gaps for newbies to mid-level users.  Advanced users probably won’t get much out of the book, but the depth of content is sufficient enough to keep everyone else happy.

Put another way: I’ve got access to scads of Vista-related material through Microsoft courtesy of my MVP status and my company’s Gold Partner relationship.  I’m keeping the book around as a handy guide.  It’s that useful!

If You're Not Reading, You're Not Reading

The vast majority of candidates I speak to answer my question of “What good development-related books have you read lately?” with something along the lines of “I haven’t read much lately” followed by any number of rationalizations for their lack of drive for self-improvement.

Reading is important, folks.  Not just blog reading, but diving into good books written by good authors.  I’m working on updating my list of what I consider to be essential books for developers at different levels to glom on to.  My list is based heavily off of the Contrux Reading Ladder.  I figure Steve McConnell probably knows a thing or two about what to read — although that list is old and includes nothing on agile methodologies, so I’m adding in some of what I think are critical works from that area. 

I’m also including a few things from Sam Gentile’s .NET list. Sam’s list has a bunch of terrific content on it, but is very different from McConnell’s list.  McConnell’s list is all about the broad fundamentals of development.  Sam’s is all about the nitty-gritty of .NET specifics.

I’ve come around to the idea of two categories of books: general development and technology specific things.  I think books from the latter list tend to last a shorter timespan than those from the first, perhaps as little as a year or two.  Hiller’s Advanced SharePoint Services Solutions book is a critical read for someone working in SharePoint 2003, but we’re now past that and on to SharePoint 2007 (MOSS, or my loving nickname “PITA”.) 

You need those technology-specific books to get over short-term hurdles: getting up to speed on a technology, figuring out how to solve particular problems for a project or two. The general fundamentals are just as critical, perhaps even more so. 

Grokking out Wagner’s Effective C# ensures you’ll be doing your C# development properly and avoiding some subtle pitfalls.  Whacking the contents of Agile Principles, Patterns, and Practices in C# into your head means you’ll be approaching your design from the right angle.  Sleeping on Code Complete until it melds into your subconcious ensures you’ll think about construction as you’re doing your coding.  Devouring some classics like Programming Pearls, The Practice of Programming, or Conceptual Blockbusting helps guarantee that you’re looking carefully at how you approach your software.  Then go read Peopleware and figure out how to improve the envrionment you’re working in.

Not reading?  Get to it.  No excuses.  If you’re not reading, then you’re not, uh, reading.

Tuesday, February 13, 2007

Book Review: Debugging

Debugging, by David J. Agans. AMACOM, ISBN 0814474578

This book is absolutely indispensable for anyone working in any job where things occasionally work in an unexpected manner.  It’s concise, funny, well-written, and full of immensely useful tips on how to go about debugging problems. 

One of the great things about this book is that it’s generalistic in nature, not specific.  Agans’s decades of troubleshooting experience has given him great insight on how to go about debugging in all sorts of environments, so he lays out nine rules for approaching any problem:

  1. Understand the System
  2. Make it Fail
  3. Quit Thinking and Look
  4. Divide and Conquer
  5. Change One Thing at a Time
  6. Keep an Audit Trail
  7. Check the Plug
  8. Get a Fresh View
  9. If You Didn’t Fix It, It Ain’t Fixed

You can get a poster of the rules online at Agans’s site, too, but if you get just that you’ll be missing out on the great insight for working with those rules.  Agans backs up each point with humorous examples and war stories, plus some very good logic about how to move forth in each step.

Debugging isn’t an art performed only by folks with some odd genetic disposition, it’s a critical craft which can and must be learned.  I was fortunate to have some good troubleshooters as mentors during my days working radar inflight, but I’ve fallen out of many of the good practices those folks beat^H^H^H^Hinstilled in me.  Agans’s book is helping me pull out of the thrash and churn mode of debugging.

This book’s only 175 or so pages long and is well-worth adding to your library.  Actually, substitute “a critical addition” for “well worth adding”.  I’m also going to make sure this book gets added to the professional development reading list I’m working on creating. 

Sunday, February 11, 2007

Another Podcast Show

James and I had another interview about Windows Developer Power Tools, this time from Michael Lehman and Bob Walsh of Channel 9’s MicroISV show.

Holy smokes, making it on to Channel 9 is a bit like making the cover of the Rolling Stone!  (OK, so now that song is stuck in my head…)

Friday, February 09, 2007

SlickRun Losing Its Mind

SlickRun rulz.  I luvs it something fierce, but today the version I have running in my development VPC lost its entire list of Magic Words, something that vexed me to no end.

I popped open the file holding the Magic Words (SlickRun.srl in your home directory under Application Data\SlickRun) and found this bit of oddness at the head of the file:

[]
Filename=""
Path=""
Params=""
Notes=""
GUID={6CCD4780-D4E5-4F8F-BEE8-D3777722DBC5}
StartMode=5

I got rid of it and Voila! everything is back shiny and happy.

Wednesday, February 07, 2007

Book Review: Mastering Regular Expressions, 3rd Edition

Mastering Regular Expressions,3rd. ed. by Jeffrey Friedl, ISBN 0596528124

I was a proud owner of the first edition of Jeffrey Friedl’s great book on regular expressions and like so many other readers I found it to be a very profound work which drastically changed how I approached all manners of text-related tasks.  Regular expressions are a vital piece of being able to do amazing work with blocks of text.  Need to transform CSV tables from one format to another?  Easy.  Need to parse out content from logfiles?  Easy.  Need to prototype an SGML to XML converter?  Not so easy, but doable.  (I know, because I did that some time ago…)

Friedl’s book is very conversational in tone, and he’s great at explaining all the minutia in regular expressions which can positively bite one in the keester.  Friedl’s adamant that the book isn’t a reference, it’s a tome for mastering regular expressions.  That’s emphasized repeatedly throughout the book, almost becoming annoying at times.  You really do need to start at the beginning and work your way through the book in order to get the best out of it.

What I find particularly interesting and helpful are the very clear explanations of the differences between the various regex implementations.  I cut my regex teeth in the *nix world via sed, grep, and a bunch of other similar fun tools.  Then I moved into the .NET world and completely lost my mojo where regexes were concerned.  Friedl’s clear explanations of how regexes work in .NET are making my regex mojo feel much better these days. (But I still happily fire up GVim to get powerful regex work done.)

Mastering Regular Expressions really is a vital addition to one’s bookshelf.

(Standard book review disclaimer.)

Tuesday, February 06, 2007

Book Review: Essential C# 2.0

Essential C# 2.0, Mark Michaelis

Addison Wesley, ISBN 0321150775

Essential C# 2.0 is somewhat introductory in nature, but there’s enough coverage of more advanced topics to make it useful for experienced .NET developers as well.  What’s really different about this book is its tremendous visual impact.  This book has perhaps the best visual layout of any I’ve seen, and it’s so well done that it really helps the book get across the points Michaelis is making in this book. 

Each chapter starts out with a mind map, one of my favorite tools for getting across highlights of a topic:

There’s a very nice deliniation of topic levels within chapters as well, with beginner and advanced topics being clearly separated out:

The code examples get some great markup, too, with bits inside code being clearly marked so you quickly see what the author’s focusing on — and the font for console output is way cool, too:

OK, so that’s all the visual stuff which would be simply eye candy bling and rather useless if the content of the book didn’t back it up.  It’s nice that the content does back it up.  There’s solid coverage of all the important topics: value vs. reference types, how the CLR/CLI works, basic object-oriented programming aspects of C#, and nice bits on delegates and events.  C# 2.0 features get good coverage, and there are two nicely done chapters on threading.  There’s also a chapter covering interoperability via P/Invoke and unsafe code (pointers), a topic I’ve not seen covered in any other book.

Michaelis’s writing style is clear, and he’s nicely concise in the book. I appreciate that he kept the focus on C# and didn’t try to span out into ASP.NET, web services, and a raft of various other topics that always seem to get lumped in with language books.

Overall I think this is a terriffic book and I’m happy to have it on my shelf!

(See my standard book review disclaimer.)

Sunday, February 04, 2007

SharePoint Workflow Project Errors

Here’s a tip if you’re getting errors akin to "the project type is not supported by this installation" when you try and create new SharePoint Workflow projects: Install the Visual Studio 2005 Extensions for Windows Workflow Foundation.  SharePoint workflow relies on Windows Workflow, so maybe you should get that installed first, eh?

Not that I’ve made that error myself, mind you.  I just heard about someone who did…

Podcast Interview on The Book Posted!

Michael Kimsal at WebDevRadio has just posted his podcast interview with James and me.  The interview was my first ever and was a lot of fun.  Michael’s a very easy-going fellow and did a great job of marshalling James and me through the show.

Check out the ‘cast and let me know what you think.  (Aside from the part about me being a ranting maniac, that is…)

VPC Woes

I’m rapidly becoming less and less enamored with Virtual PC.  I used VMWare Workstation for a number of years both on Linux as well as Windows and loved its speed and stability.  VPC?  Not so much.

At least three times in the last couple years I’ve completely lost VPC systems after bogus error messages like "an error occurred while processing the command line options."  I always back up data and projects to locations outside the VPCs, so I’ve not lost data or projects (or much), but the real pain has been having to spend chunks of time reinstalling and configuring the VPC again.

I never had these sorts of issues with VMWare; however, the VPC price (free via my MSDN subscription) has always been attractive.  That attractiveness is now gone, as I’m going to lose a chunk of my family time today reconstructing my environment to get back working again.  Argh.

Friday, February 02, 2007

Upcoming Speaking Engagements

I didn’t realize how busy I am this next month or so with presentations!  Here’s a list of the events I’ll be at through March.

(At least I hope I’ll be talking at the Dayton-Cincinnati Code Camp.  James and Mike are the other two folks on the content selection committee, so my sessions may get voted off the island.)

Subscribe (RSS)

The Leadership Journey