Andrew Connell [MVP MOSS]
1350 Posts |  39 Articles |  3385 Comments
.NET  |  MCMS  |  SharePoint  |  Office System
PDCBling
SharePoint Quick Links
Article Categories
Archives
Post Categories

View Andrew Connell's profile on LinkedIn

Add to Technorati Favorites

I finally got sick of writing feature.xml after feature.xml and creating new GUIDs. These repetitive things as well as those that make me take my hands off the keyboard slow me down... and that drives me nuts. Over the last few months I've been polishing and tweaking some stuff I've been working on that I use on a day-to-day basis as a SharePoint developer that speed up my development. Finally, they are at a point where I want to share them for others to benefit from them as I have (and a few folks who've been kind enough to test and provide feedback).

Before I dive in, let me answer four questions I'm sure you're wondering:

What is it?
Additions for CodeRush & Refactor! Pro Visual Studio productivity add-ins. These include a dynamic list for SharePoint types, XML templates addressing the various XML files we use in SharePoint (eg: Feature schema, solution schema, field type definitions, *.webpart files, etc) as well as some refactorings. What in the heck does all this mean? No worries, I'll get to it :).

How do I get it?
Go to this page to get the latest releases... I'll keep adding stuff over time. Got ideas for more stuff? Let me know!

Who is it for?
Those developers who use DevExpress' CodeRush & Refactor! Pro Visual Studio productivity add-ins. No, they (CodeRush & Refactor! Pro) aren't free utilities (what I'm giving you is free), but frankly, for only $250 (you get both CodeRush & Refactor! Pro), it is well worth it in the time you'll save when you look at the big picture. Heck, Refactor already contains over 100 refactorings (VB.NET & ASP.NET developers have been used to getting a free, slimmed down version of Refactor for Visual Studio for a while).

Why do I have to buy something to use this?
It's just the direction I took. I love CodeRush & Refactor! Pro and I've said it numerous times. Don't know what CodeRush or Refactor! Pro are? Use the above links, read my post, or sit back and watch it in action (at least this quick "big picture" screencast).

OK, so what is this all about? As I said above, I got sick of doing the same thing over and over... creating new GUIDS, writing yet another Feature definition file. I mean, come on, how many can you really build before you flip on auto pilot. Even Feature receivers... the ReceiverAssembly & ReceiverClass attributes just slow you down, eh? Better yet, why should I be doing that stuff? I'm serious... I know how to do it (I = you too). Can't a machine do this stuff? Can't I spend my time on more complicated and creative stuff?

The answer is yes... no... the answer is HELL YES, and that was my motivation when I started building these things (and continues to be). Visual examples will prove this better than I can type it up... so here you go:

Creating new GUIDS:
If I have to take my hand off the keyboard one more time and select Tools » Create GUID (don't forget about deleting the {} brackets... arg!) I'm going to chop it off! Why can't I just do something like this (notice the Keys window at the bottom of the animation showing what I'm typing... specifically, notice what happens when I type newguid[space]):

newguid

It is such a simple demo, but my goodness, can't you see the benefit? And it is so simple!

Creating new Feature definitions (feature.xml):
Even if you have enabled CAML IntelliSense in Visual Studio, building Feature definitions is tedious. What does every one need? An ID, title, scope, and some element manifests right? So... why not let the machine do the work for us? In this example, I'm just typing fxml[space] and then hitting [enter] to jump between the fields:

fxml

Notice the automatically created GUID?

But wait, aren't you saying "uh, AC... you can do a LOT of this using Visual Studio snippets." True, there is a striking similarity (so far)... but snippets can't contain logic parsed at implementation time huh? Just keep reading :)

Creating new Feature definitions containing Feature receivers (feature.xml):
Is it hard to add in those ReceiverAssembly and ReceiverClass attributes? Nah... you can even cheat by building the project containing the receiver class and opening the assembly in Lutz's Reflector to get the assembly's full name (aka: 4-part name). But... if you've already created the Feature receiver class in your project, why can't the machine figure that stuff out for you? Oh... but it can:

frxml

Uh huh... that's right. It reflected the assembly, obtained the full name, and also walked through the project looking for the first type that inherited from Microsoft.SharePoint.SPFeatureReceiver, got the type's full name ([namespace].[type_name]) and added both of these to the necessary attributes.

Adding new types:
What's one of the most annoying things for you (well, at least for me) when writing SharePoint code... or any code for that matter? For me, it's either having to put the namespace in the using statements to use a type or type the whole namespace+typename in my code which looks nasty. While Refactor! Pro has a nice refactoring to clean up the long name to breaking it up to use on tly the type and put the namespace in the using statement, CR has a slick capability called dynamic types. I've created a few types in this set for SharePoint objects. For example, the type sps = Microsoft.SharePoint.SPSite. When you type a template that uses a type, such as vsps (for a new variable of the type sps, or Microsoft.SharePoint.SPSite), CR will add the namespace for you automatically if it isn't already present, like the following demo shows:

vsps

So how much does it help?
Nothing beats tangible results. One of the people who volunteered to test this had his dev team take their most complex Feature and re-code it again from scratch without these tools. It took on average 25 minutes. Using these tools, with only 30 minutes of getting familiar with the tools, they cut dev time down to 10 minutes!!!

OK... enough teasers. To get more info, check out the page I've created for these tools where you'll find more information such as how to download and install and what's included. Also, there are a few screencasts posted as well to help you see everything this stuff does (so much easier to see than it is to read another post). There is one very brief overview screencast, Overview of AC's VS CodeRush/Refactor Tools for SharePoint Devs, for those who just want a teaser to see if this is this.

» AC's VS CodeRush/Refactor Tools for SharePoint Developers

Let me know what you think! Oh... and I didn't name this post "part 1 of 5" for some random reason. Over the next four days, I'll add another post related to these productivity enhancements.  :)

posted on Tuesday, August 21, 2007 11:25 PM

Feedback

# re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/22/2007 12:32 AM Sezai Komur
Gravatar AWESOME !

I'm always looking for better ways to make custom development in MOSS 2007 WCM easier.


When I started learning MOSS 2007 custom development I couldn't believe how fiddly, pedantic, complicated and time consuming the whole process can be, so its important to innovate and find better ways to develop.

Why not make our lives easier, and save time?

http://www.sharepointblogs.com/sezai/archive/2007/08/22/manage-solution-development-easier-and-faster.aspx

# re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/22/2007 3:22 AM Philippe Sentenac
Gravatar It seems great !! i can't wait to see the next posts.

 re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/22/2007 4:35 AM Gillian
Wow, that all looks amazing! Looking forward to parts 2-5 :-)

 re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/22/2007 9:34 AM Peter {faa780ce-0f0a-4c28-81d2-3
Gravatar This all sounds awesome--I think we're all interested in making life a little easier.

# re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/22/2007 11:24 AM Sahil Malik
Andrew - I am impressed. These are incredible!

 re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/22/2007 1:38 PM Jason Dossett
Gravatar The requirements say both tools, what if you have one or the other? I have Refactor Pro! but not CodeRush, will I be able to use the refactorings you create?

Very cool. Now we just need refactorings for Windows Workflow. 'Create Custom Activity From Code Activity' anyone? :)

# re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/22/2007 2:45 PM AC [MVP MOSS]
Gravatar Jason-
Everything requires CodeRush, even the Refactoring just as the requirements state. The Refactoring uses a StringProvider which is part of the CR engine (I believe).

# re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/23/2007 1:07 AM Mark Miller
StringProviders are part of the DXCore, so the Refactoring should still work if you have Refactor! Pro installed even if CodeRush is not installed. However the templates require the text expansion engine that only ships with CodeRush.

# re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/23/2007 6:40 AM AC [MVP MOSS]
Gravatar Ah... wasn't aware of that... thanks for the clarification Mark!

 re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/23/2007 2:37 PM craig
Gravatar When I first heard about CodeRush a number of months ago, it was introduced to me by a colleague as "sort of an extension of VS code snippets". I now wish I had investigated for myself to see that it's much more than that. Your post peaked my interest and I downloaded the evals for CR and R!P last night, as well as your extensions for SharePoint. I'm hooked! I'll be placing my order with DevExpress next week.

Speaking of ordering, I just picked up Real World SP 07 and can't wait to dig into it.

What other tools are you currently using for feature development and solution packaging? I'm getting a little discouraged with the amount of work that's required for solutions deployment and I'm looking for anything that can speed that process up.

Keep up the amazing work!

# re: Announcing AC's VS CodeRush/Refactor Tools for SharePoint Devs (Part 1 of 5) 8/23/2007 2:45 PM AC [MVP MOSS]
Gravatar Craig-
Good to hear! Make sure you carve out time to watch the CodeRush/Refactor training vidoes on DevExpress.com... you'll learn more about the product that way than any other.

As for what other tools do I use... MSBuild is a big one as I outline here [http://andrewconnell.com/blog/articles/UsingVisualStudioAndMsBuildToCreateWssSolutions.aspx] to automate the creation of WSP's every time I build. I still create DDF and manifest.xml files by hand... but I'm working on that too. Stay tuned...

Post Feedback

Title:
Name:
Email:
(email will not be displayed)
Url:
Comments: 
Please add 3 and 1 and type the answer here:    
All Comments Are Filtered & Moderated
Unfortunately comment spammers are just too effecient and are constantly dirtying up blogs with irrelivant and unwanted comments trying to improve their standing on search engines. All comments on this blog are moderated. I do not censor comments, but I don't approve comments with vulger language or those soliciting products. Most of the time comments are approved within a few hours of being submitted with the only exception when I'm traveling.

Why are you asking for my email address?
The only reason I'm asking for your email address, which isn't required to submit a comment, is to provide a gravatar if you've created an account for yourself and associated your email address with a small image. If you have a gravatar created for the email address you submit, it will appear next to your comment. Otherwise nothing will appear.

What is a gravatar?
A gravatar is a "globally recognized avatar." You can get more information about gravatars, as well as create your own for free, at www.gravatar.com. You can also view my gravatar here.


Copyright © 2003 - 2008 Andrew Connell
Creative Commons License 
This work is licensed under a Creative Commons License
Site design by Heather Solomon.

 
 
MOSS WCM Training
Looking for MOSS 2007 WCM developer training? Look no further! I teach my 4-day hands-on and 5-day online WCM classes for developers I offer through the Ted Pattison Group.

Get more information on the WCM courses!


Upcoming Classes
 Hands-on WCM:
 » Atlanta, GA
   Sept 22-25, 2008
 Online WCM:
 » July 21-25, 2008
 » December 8-12, 2008


» Register today!

JAX Office Geeks
Jacksonville Office Geeks (JOG)
JOG is a special interest group in Jacksonville, FL dedicated to bringing the local SharePoint commnity together to share tips, tricks, ideas and best practices for developing solutions on the SharePoint platform.

Next meeting details...
When:
Thur. Sept 18th, 2008
  6-8p EDT
Topic:
Enterprise Content Management - Document Retention

Speaker:
John Holliday, MVP MOSS

RSVP Today!


» Subscribe to the JOG newsletter