Andrew Connell [MVP SharePoint]
1728 Posts |  46 Articles |  5281 Comments
.NET  |  MCMS  |  SharePoint  |  Office System
AC's Blog Quick Links
SharePoint Quick Links
Article Categories
Archives
February, 2012 (2)
January, 2012 (12)
December, 2011 (6)
November, 2011 (3)
October, 2011 (17)
September, 2011 (8)
August, 2011 (6)
July, 2011 (7)
June, 2011 (13)
May, 2011 (9)
April, 2011 (15)
March, 2011 (1)
February, 2011 (6)
January, 2011 (5)
December, 2010 (11)
November, 2010 (6)
October, 2010 (12)
September, 2010 (5)
August, 2010 (4)
July, 2010 (5)
June, 2010 (6)
May, 2010 (11)
April, 2010 (11)
March, 2010 (9)
February, 2010 (9)
January, 2010 (3)
December, 2009 (10)
November, 2009 (15)
October, 2009 (15)
September, 2009 (7)
August, 2009 (4)
July, 2009 (10)
June, 2009 (8)
May, 2009 (2)
April, 2009 (9)
March, 2009 (6)
February, 2009 (16)
January, 2009 (6)
December, 2008 (12)
November, 2008 (12)
October, 2008 (27)
September, 2008 (13)
August, 2008 (14)
July, 2008 (14)
June, 2008 (12)
May, 2008 (23)
April, 2008 (12)
March, 2008 (15)
February, 2008 (13)
January, 2008 (12)
December, 2007 (10)
November, 2007 (8)
October, 2007 (15)
September, 2007 (20)
August, 2007 (21)
July, 2007 (16)
June, 2007 (8)
May, 2007 (25)
April, 2007 (16)
March, 2007 (18)
February, 2007 (18)
January, 2007 (12)
December, 2006 (16)
November, 2006 (13)
October, 2006 (18)
September, 2006 (22)
August, 2006 (27)
July, 2006 (23)
June, 2006 (23)
May, 2006 (23)
April, 2006 (9)
March, 2006 (17)
February, 2006 (15)
January, 2006 (23)
December, 2005 (31)
November, 2005 (32)
October, 2005 (38)
September, 2005 (53)
August, 2005 (30)
July, 2005 (63)
June, 2005 (30)
May, 2005 (59)
April, 2005 (29)
March, 2005 (74)
February, 2005 (27)
January, 2005 (22)
December, 2004 (32)
November, 2004 (42)
October, 2004 (39)
September, 2004 (20)
August, 2004 (14)
July, 2004 (27)
June, 2004 (40)
May, 2004 (5)
April, 2004 (6)
March, 2004 (16)
February, 2004 (26)
January, 2004 (23)
December, 2003 (7)
November, 2003 (14)
October, 2003 (20)
September, 2003 (4)
Post Categories
Add to Technorati Favorites

Managed Windows Shared Hosting

This page serves as the portal for all information related to the productivity enhancements I've created for developers using Visual Studio 2005 / 2008 with DevExpress' CodeRush & Refactor! Pro.

Requirements

These tools have been tested with the latest releases of CodeRush & Refactor! Pro: v3.0.5 in both Visual Studio 2005 & 2008.

Download

This part of the page will be updated with the latest release of the components. How can you get news on when the latest are available? I'll post to my blog when there's a new update, so you can subscribe there to get updates as well as my other posts.

» Download the latest release - February, 2008 / v1.1.0

Here's a sample project you can use to play around with the tools without mucking up your project to get the feel for them.

Installation

Installation can be done in one of two ways (one day I'll get a WiX installer setup... but until then...):

Semi-automated

The provided install.bat file can do most of the work... but it can't import the templates.

  • Double-click the install.bat file included in the download. This will deploy the dynamic templates, plugins and refactorings.
  • If Visual Studio is open, you need to close and restart it to pickup the plugins and custom types.
  • Open Visual Studio and select DevExpress » Options.
  • In the Options dialog, navigate to the following section: Editor » Templates.
  • At the bottom of the dialog, set the Language to XML.
  • Right-click the Templates pane (white vertical box just to the right of the navigation tree) and select Import Templates. Select the XML file XML_SharePoint.xml to import the templates.
  • At the bottom of the dialog, set the Language to Plain Text.
  • Right-click the Templates pane (white vertical box just to the right of the navigation tree) and select Import Templates. Select the XML file PlainText_SharePoint.xml to import the templates. 

Manual

You will copy a handful of files to your profile, assemblies to the plugins directory and import the templates. The easiest way to get to the plugins and settings directories is to use the DevExpress About menu. Open Visual Studio and select DevExpress » About. Click the Settings... or Plugins... button to open the desired folder in Windows Explorer.

  • Copy the assemblies (3 DLL's) to the Plugins directory: C:\Program Files\Developer Express Inc\DXCore for Visual Studio .NET\2.0\Bin\Plugins
  • If Visual Studio is open, you need to close and restart it to pickup the plugins and custom types.
  • Open Visual Studio and select DevExpress » Options.
  • In the Options dialog, navigate to the following section: Editor » Templates.
  • At the bottom of the dialog, set the Language to XML.
  • Right-click the Templates pane (white vertical box just to the right of the navigation tree) and select Import Templates. Select the XML file XML_SharePoint.xml to import the templates.
  • At the bottom of the dialog, set the Language to Plain Text.
  • Right-click the Templates pane (white vertical box just to the right of the navigation tree) and select Import Templates. Select the XML file PlainText_SharePoint.xml to import the templates. 

Custom Types

CodeRush has a ton of features that allow you to create new fields or methods returning types using specific types. For example, typing fs[space] will create a new field based on the language you're in so if it was C#, it would create private string varName;. Thankfully you have the ability to create your own types that aren't already registered. For more info on custom types, check out Mark's post or this feature page on the DevExpress site.

The custom types included in the download contain four of the most popular SharePoint types: SPSite, SPWeb, SPList & SPListItem. Best part is that if the namespace Microsoft.SharePoint hasn't already been imported, it's automatically added. Check the screencasts to see a demonstration of this.

The four types included in the download are the following:

Template Description
spct Microsoft.SharePoint.SPContentType
spcs Microsoft.SharePoint.SPContext.Current.Site
spcw Microsoft.SharePoint.SPContext.Current.Web
spf Microsoft.SharePoint.SPField
sps Microsoft.SharePoint.SPSite
spw Microsoft.SharePoint.SPWeb
spl Microsoft.SharePoint.SPList
spli Microsoft.SharePoint.SPListItem

Note added for v1.1: You don't need to install these... in fact they were removed starting with the v1.1 download. DevExpress is now including these templates in the default CodeRush install starting with v3.0.

Refactorings

  • Create Web Part Definition (*.webpart)
    When the cursor is on a class that inherits from System.Web.UI.WebControls.WebParts.WebPart, this refactoring will automatically create a *.webpart file and add it to the project that already contains the Web Part class. In addition, the *.webpart file will be prefilled with the full type name (5-part name) and Web Part name.

XML Templates

The following tables document the various XML templates included in the download. For a demonstration, check the screencasts listed at the end of this page. Each of the screencasts demonstrating a template contains a table of contents with the name of the template for easily jumping to a specific demonstration in longer screencasts.

While the templates may seem complicated or hard to remember, notice they are written as mnemonics. For example, when you want to create a new <FieldRef> within a <ContentType> element, you are creating a element content type field reference... or ectfr.

General / Misc. Templates

Template Description
assemblyfullname Full name of an assembly, 4-part name.
ftd Field type definition.
newguid Generate a new GUID.
webpartxml Generate contents of a *.webpart file, automatically filling in the Web Part's type (5-part name) if it finds one within the current project.

Feature Definition Schema Templates

Template Description
fxml Feature definition file contents.
frxml Feature definition file for Feature receiver. If type inheriting Microsoft.SharePoint.SPFeature is found in the class, both the type and assembly full name are automatically filled.
fwxml Feature definition file for Feature containing custom workflow that utilizes InfoPath forms.

Feature Element Manifest (Site Element) Schema Templates

Template Description
exml Element XML file.
eca Element custom action.
ecag Element custom action group.
ect Element content type.
Note: If a content type ID is on the clipboard, such as copied from another content type, it is added in the ID attribute automatically.
ectb Element content type binding.
Note: If a content type ID is on the clipboard, such as copied from another content type, it is added in the ID attribute automatically.
ectfr Element content type field reference.
Note: If a GUID is on the clipboard, such as copied from a site column / field definition, it is added in the ID attribute automatically.
educ / edc Element delegate control (as a user control).
edsc Element delegate control (as a server control).
eer Element event receivers collection.
eerr Element event receiver.
efsta Element feature site template association (stapling Feature).
Note: If a GUID is on the clipboard, such as copied from a Feature definition, it is added in the ID attribute automatically.
ehca Element hide custom action.
New in v1.1.
eli Element list instance.
elt Element list template.
Updated in v1.1.
em Element module.
emf Element module file.
Updated in v1.1.
emfp Element module file property.
emwp Element module file for provisioning Web Parts into the Web Part Gallery.
esc Element site column (field).
Updated in v1.1.
ew Element workflow.
ewif Element workflow using InfoPath forms.
ewp Element workflow using ASP.NET 2.0 pages as forms.

Feature Element Manifest Schema Templates for Publishing Sites

Template Description
ectpp Element content type inheriting from Page content type.
emmp Element module provisioning master page file set.
emmpf Element module master page file.
Updated in v1.1.
empl Element module provisioning page layout file set.
emplf Element module page layout file.
Note: If a content type ID is on the clipboard, it is automatically added to the PublishingAssociatedContentType attribute.
empi Element module preview image.
emsl Element module for items in the Style Library.
eschtml Element site column using the Publishing HTML field type.

Solution Schema Templates

Template Description
sxml Solution node (within manifest.xml).
sa Solution assemblies node.
sasc Solution assembly safe control.
sacr Solution assembly class resources.
sfm Solution Feature manifest.
swp / sdwp Solution Web Part / DWP file provisioning to wpcatalog.
sr Solution resources.
srr Solution resources.
New in v1.1.
stf Solution template files.
stff Solution template file.
New in v1.1.
srf Solution root files.
srff Solution root file.
New in v1.1.

Bugs and Feature Requests

I've created a SharePoint list to submit bugs and Feature Requests. The list is setup to be anonymous so anyone can post stuff to it. Please use this list, and not the comments in this article, to submit bugs and feature requests:
http://andrewconnell.sharepointservers.com/BlogResources/Lists/CR_SharePointTools

Where To Get More Information?

Where can you get additional information? Below you'll find a handful of blog posts and screencasts. I think the screencasts are the best way to demonstrate exactly what these things can do.

Blog Posts

Change Log & Updates

  • AC's CR/R tools for SPDevs Updated: v1.1

Screencasts (demos)

Note: I'm aware the videos sometimes appear horizontally scrunched up... usually a few hard refreshes fixes it, but I'm still trying to figure out the root cause to resolve it. Regardless, they are still viewable and you should be able to see what is being presented just fine. If not, please let me know.

Note: all videos are for v1.0 and have not been updated for v1.1.

  • Overview (9 minutes) - updated August 22, 2007
    Get a quick overview of what is included.
  • Installation (4 minutes) - updated August 22, 2007
    Covers both the manual and semi-automated installation process.
  • Templates and Custom Types (9 minutes) - updated August 22, 2007
    Demos of some of a few templates not included in the Feature & solution schemas and the custom types.
  • Feature Schema (22 minutes) - updated August 22, 2007
    Detailed demos of all Feature schema templates. Notice the table-of-contents allowing you to quickly jump to a specific template.
  • Solution Schema (4 minutes) - updated August 22, 2007
    Detailed demos of all solution schema templates. Notice the table-of-contents allowing you to quickly jump to a specific template.
  • Templates specific to Publishing sites (12 minutes) - updated August 22, 2007
    Detailed demos of all templates useful for developers creating Publishing sites. Notice the table-of-contents allowing you to quickly jump to a specific template.
  • Refactorings (2 minutes) - updated August 22, 2007
    Detailed demos all refactorings.

DevExpress' CodeRush & Refactor! Pro

I wrote a post a while back giving my perspective on what these tools were all about. I think it's a pretty good and quick read:

The next best place to go is to check the product pages for these two products on the DevExpress Web site:

I'll admit, it's hard to really get a grasp of these tools by simply reading some pages on a Web site. DevExpress saw this and added a bunch of screencasts to their site. Even after using these products on a daily basis, I pick up stuff every single time I watch these!

Looking for a cheat sheet? Here's one done by Waldek.

posted on Tuesday, August 21, 2007 4:43 PM

Feedback

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 10/29/2007 7:51 AM Doron Goldberg
Gravatar Hello Andrew,

After finishing the manual installation & the installation of refactor pro & coderush I'm still unable to use some of the shortcuts.

While ect works fine, xfml or frxml doesn't work. The first 2-3 times I see the big red arrow but no text appears on the page. After those 2-3 times I don't even get the arrow - the 'fxml' or 'frxml' string is simply deleted from the page.

Is there anything else I need to do in order to get it to work?

Thank you very much,

Doron G.

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 10/29/2007 8:49 AM AC [MVP MOSS]
Gravatar Doron-
Sounds like the string providers didn't get installed. That is what is in the DLL's that need to be copied over. Did you shut down and restart Visual Studio? The plugins are only loaded when VS loads up (all instances must be closed). If you did, then it's likely the directory of your plugins is not the default one. Open Visual Studio and select the DevExpress -> About menu. Then click the Plugins button. That directory is where all the DLL's in the zip should be placed.

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 10/29/2007 9:07 AM Doron Goldberg
Gravatar Thank you for the quick reply!

The dll's are at:

C:\Program Files\Developer Express Inc\DXCore for Visual Studio .NET\2.0\Bin\Plugins

Which is the folder I'm getting from the "plugins" button of the about window...

I did close and reopen VS again (and again) including a restart of the computer - still no results.

Note: our "My documents" folder is not local. I'm bringing this up because it came up as a problem for some vs add-ins. (I'm not sure it's related this time thought)

The weird part is that some shortcuts work and some don't...

Doron.



# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 10/29/2007 9:14 AM AC [MVP MOSS]
Gravatar Doron-
The MyDocs location doesn't matter. The reason why some work and others don't is because if one contains a string provider (such as typing 'newguid[space]'), it won't be processed. So those without string providers aren't running, while those that don't have them are working.

Not sure what's going on here... make sure the four DLL's are in the same directory as all the other "CR_*.dll" files that CodeRush uses.

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 10/29/2007 9:39 AM Doron Goldberg
Gravatar The files are where the rest of the CR_*.dll's are located.

I just saw that my version of coderush & refctor is 2.5.8... can that be the problem? (I'm using the trial version)


Doron.

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 10/29/2007 9:45 AM AC [MVP MOSS]
Gravatar Doron-
I too am running the latest release (2.5.8)... maybe they block 3rd party plugins in the trial version... not sure. Try this... in VS, select DevExpress -> User Guide. Then select Reverence \ String Providers. Do you see "SPNewGuid" ? If not, then you are certainly not loading my providers.

One last thing: Are you using VS 2005? I have not tested these in VS 2008 yet.

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 12/4/2007 9:49 AM Michael Mukalian
Gravatar Hey Andrew, I briefly met you at the Philly SharePoint User Group talk last week and it was an excellent talk. After this I went out and purchased Code Rush, but I'm having an issue much like what's been stated above. When I enter the relevant command (say for example "fxml" then hit <Space>) nothing appears. All of my .DLLs and files are in the correct places. Here's the only difference tho'...I installed Code Rush on my SP development box which is running Windows 2003 Server. I've not been able to find any information about this tool not running on Win2K3 Server. Do you know of any issues? Is Win2K3 the issue? Help!

Thanks! - M

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 12/4/2007 10:02 AM AC [MVP MOSS]
Gravatar Michael-
It definately works on Win2003 as that's what I use. If nothing happens that means the string providers aren't working... specifically the one used in the fxml template is "newguid". Make sure the DLL's are in the proper place on your machine (as mentioned in a previous reply on to a comment on this post). Then, make sure you've restarted Visual Studio since copying them (as the DXCore engine loads all plugins only on on VS startup). Then, make sure you've imported the templates (you should see a NEWGUID template in the XML section of your templates). Now, create an XML file and type "newguid[space]" and see if that replaces the string NEWGUID with a new GUID (as shown here: http://farm2.static.flickr.com/1280/1198852843_49e7e9e5dd_o.gif). If so, then you're working... let me know if that doesn't work. NOTE: All the stuff I mention here MUST be done as I say it or they won't work (DLL's in proper directory, VS restarted after deployment, templates imported).

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 12/4/2007 4:03 PM Michael Mukalian
Gravatar Hey Andrew, figured it out. Apparently my install of CodeRush didn't go as it should. After repeated attempts I found that the issue was during the startup of the IDE (CR's install forces itself to be turned on at startup of the IDE and there seemed to be an exception during this process). I unchecked "Startup", shut down the IDE, brought it back up, then manually started CodeRush. I was then able to do the steps as you suggessted and all now works. It's weird that it worked that way, but now all is well.

Thank you for your quick response! - M

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 2/19/2008 5:03 PM Lester Henderson
Gravatar Thanks for the CR templates. Where did you get the keyboard plugin that shows what you are doing while demonstrating in your videos?

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 2/20/2008 8:34 AM AC [MVP MOSS]
Gravatar Lester-
Ask for it in the CR/R plugin or CR forum on the DevExpress site. It's what Mark Miller uses when he's demo'ing the product at conferences.

# re: AC's VS CodeRush/Refactor Tools for SharePoint Developers 5/26/2009 8:21 PM Chris
Gravatar Andrew - great little set of tools.

I found a post by yourself whilst searching devexpress forum on how to create a new GUID in a template. Recognising your name I clicked through to here, low and behold you had already done what I was trying to do.

I have installed and am a very happy chappy, I have to create heaps of site columns and the thoughts of doing each one using the create guid tool seemed just too painful.

I am however having a problem, if I put a guid in the clipboard then create something like a field ref (ectfr), the guid is not used. When I look into the template explorer, I can see that none of the alternate templates seem to exist. Any Ideas?

Post Feedback

Title:
Name:
Email:
(email will not be displayed)
Url:
Comments: 
Please add 6 and 7 and type the answer here:    
All Comments Are Filtered & Moderated
Unfortunately comment spammers are just too effecient and are constantly dirtying up blogs with irrelevant 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 - 2012 Andrew Connell
Creative Commons License 
This work is licensed under a Creative Commons License
Site design by Heather Solomon.

 
 
SharePoint 2010 Training
Looking for SharePoint 2010 training for developers, administrators, SharePoint Designer 2010 and end users? Look no further! My company, Critical Path Training offers the best SharePoint training around!