Quick pro tip - Open File in Sublime from Visual Studio
Tuesday, April 17, 2012 4:58:45 PM (GMT Daylight Time, UTC+01:00)
This is one of those really simple little gems that helps productivity ten-fold. Firstly, regardless of whether you're running a PC, Mac or Linux, if you've not already come across Sublime Text 2 you should go download it right now.
There are a ton of amazing features in Sublime (enough to warrant an talk by Dan Kendall no less), some of them are available in Visual Studio but none are quite as rich. Things like the multi-selection/multi-cursor feature are just awesome for quickly making the same changes in multiple places, not to mention the "select this word throughout the document" shortcut which has saved me hours already.
So what's my quick tip?
Rather than copying/pasting the path in the open dialog each time you want to edit the file, Dan pointed out to me the other day that you can easily wire it up as an external tool and then add a shortcut so you can open the current file in a flash.
Here's a step-by-step guide:


Optional Additional Enhancement
You can wire up a keyboard shortcut for extra speed, again under the "Tools" menu, go to "Options" and then "Keyboard" (under "Environment"):



Thanks Dan for the heads up on this one.
Fix Visual Studio’s crappy HTML formatting and automatic addition of id when pasting
Tuesday, April 19, 2011 5:56:59 PM (GMT Daylight Time, UTC+01:00)
Today I discovered two settings in Visual Studio that are about to transform my life (yes I realise that by just writing that I need to get out more.).
Anyway, the first stops Visual Studio formatting you code like this:
![ScreenClip [4] ScreenClip [4]](http://blogs.thesitedoctor.co.uk/tim/images/Fix-Visual-Studios-crappy-HTML-formattin_FB09/ScreenClip-4.png)
And transforms it into this:
![ScreenClip [5] ScreenClip [5]](http://blogs.thesitedoctor.co.uk/tim/images/Fix-Visual-Studios-crappy-HTML-formattin_FB09/ScreenClip-5.png)
To sort: Open Visual Studio, go to "Tools" -> "Options" -> "Text Editor" -> HTML -> "Formatting" and look for the button "Tag Specific Options" (in the bottom right). Click this button and you should get a window that looks like this:
![ScreenClip [2] ScreenClip [2]](http://blogs.thesitedoctor.co.uk/tim/images/Fix-Visual-Studios-crappy-HTML-formattin_FB09/ScreenClip-2.png)
Expand out "Default Settings" and then click "Client tag supports contents" and change "Line breaks" from "Before, after opening and after closing" to "Before and after" on "Client tag supports contents" and "Server tag supports contents".
This second one is another of those annoying bug bears of mine which is where Visual Studio insists on adding an id to every control you paste in -not something I really want in most cases. Anyway, sticking in the "Text Editor" -> "HTML" settings area, go to "Miscellaneous" and you'll see one there "Auto ID elements on paste in Source view" -uncheck that and click "OK" to save and apply your settings.

Looks like Visual Studio will become a decent HTML editor after all.
Error 11: An error occurred when merging assemblies: ILMerge.Merge: ERROR!!: Duplicate type 'xyz' found in assembly 'App_Web_rh2sxhkc'. aspnet_merge
Sunday, April 18, 2010 12:47:20 PM (GMT Daylight Time, UTC+01:00)
You may have come across this error once or twice while deploying your project if you develop using Web Deployment Projects. It's usually caused when you copy and paste a page and forget to update both the page declaration and code behind file.
But the website builds!?!
You don't usually get the ILMerge error until you build the web deployment project because when you build a website directly, it doesn't compile all the code into a single assembly so the class names are seen as different. Part of the web deployment process is to compile all the websites code into a single assembly hence the duplicate references.
What's the solution?
It's surprisingly simple, all you need to do is open up the offending aspx and aspx.cs files and update two lines:
1. In the code behind file, rename the partial class. By default Visual Studio will name the class FolderName_Pagename which should result in a unique name
2. The page declaration (first line of the page) in the aspx file. You have to make sure that both the Inherits attribute and CodeBehind reference are correct.
Tip: To avoid confusing yourself, open the files independently using the solution browser because if you open the aspx and press F7 to switch to the code behind file before updating the page declaration, you'll end up editing the page you copied rather than the copy.
Collapse all Solution Explorer items in Visual Studio 2010
Saturday, February 27, 2010 12:22:48 PM (GMT Standard Time, UTC+00:00)
Ever wanted to be able to collapse all items within Visual Studio's solution window? This is a nifty little Visual Studio macro that I came across a few years ago and have been using successfully in Visual Studio 2005, Visual Studio 2008 and now in the Visual Studio 2010 RC.
I'll overview how to install it below in case you're unsure how to do it but I have this bound to the key combination Ctrl+Shift+` as ReSharper now uses my previous key combination of Ctrl+` for it's new bookmark explorer.
Anyway, here's the Visual Studio Solution Explorer item Collapse All macro:
Imports System
Imports EnvDTE
Imports EnvDTE80
Imports EnvDTE90
Imports System.Diagnostics
'-----------------------------------------------------------
' CollapseAll Module
'-----------------------------------------------------------
' Simple macro that fully collapses all items in the
' Solution Explorer rather than just the top level node
'
' To make live easier, bind it to a keyboard setting such
' as Ctrl+Shift+` which by default has no bindings (Ctrl+` is
' now used by Resharper
'
' Tested and works with:
' Visual Studio 2005
' Visual Studio 2008
' Visual Studio 2010
'
' Originally from: http://bit.ly/bmRu3W
'-----------------------------------------------------------
Public Module CollapseAll
Sub CollapseTree()
' Get the the Solution Explorer tree
Dim solutionExplorer As UIHierarchy
solutionExplorer = DTE.Windows.Item(Constants.vsext_wk_SProjectWindow).Object()
' Check if there is any open solution
If (solutionExplorer.UIHierarchyItems.Count = 0) Then
Return
End If
' Get the top node (the name of the solution)
Dim rootNode As UIHierarchyItem = solutionExplorer.UIHierarchyItems.Item(1)
rootNode.DTE.SuppressUI = True
' Collapse each project node
Collapse(rootNode, solutionExplorer)
' Select the solution node, or else when you click
' on the solution window
' scrollbar, it will synchronize the open document
' with the tree and pop
' out the corresponding node which is probably not what you want.
rootNode.Select(vsUISelectionType.vsUISelectionTypeSelect)
rootNode.DTE.SuppressUI = False
End Sub
Private Sub Collapse(ByVal item As UIHierarchyItem, ByRef solutionExplorer As UIHierarchy)
For Each innerItem As UIHierarchyItem In item.UIHierarchyItems
If innerItem.UIHierarchyItems.Count > 0 Then
' Re-cursive call
Collapse(innerItem, solutionExplorer)
' Collapse
If innerItem.UIHierarchyItems.Expanded Then
innerItem.UIHierarchyItems.Expanded = False
If innerItem.UIHierarchyItems.Expanded = True Then
' Bug in VS 2005
innerItem.Select(vsUISelectionType.vsUISelectionTypeSelect)
solutionExplorer.DoDefaultAction()
End If
End If
End If
Next
End Sub
End Module
In case you've never installed a Visual Studio macro before, here's a couple of instructions:
- In Visual Studio, press Alt+F11 to load up the Visual Studio Macro editor (or View > Other Windows > Macro Explorer > Double Click on "Module1" in "My Macros")
- Either create a new module of it it's not in use, you can edit Module1 and past in the code above
- Save and close the Visual Studio Macro editor
- You should be back in Visual Studio so click "Tools > Options > Environment > Keyboard"
- In the "Show commands containing" text box, enter "CollapseTree" and the macro you just created should be shown.
- Make sure "Global" is selected in the "Use new shortcut in:" drop down list
- Press Ctrl+Shift+` in the "Press shortcut keys:" text box
- Click Assign
- Click OK
You're done :)
Update via Graeme: Make sure your module name (in the above it's Module1) is the same as your file name otherwise Step 5 minght not work.
Store common AppSettings in the web.config and an external file (configSource vs. file)
Saturday, June 27, 2009 8:19:19 AM (GMT Daylight Time, UTC+01:00)
I've started using Rick Strahl's wwAppConfiguration to allow easier access to application constants and one thing that's been bugging me is that it doesn't play nice with configSource -which we update with web deployment projects to specify Development/Staging/Live settings.
The issue is that when you set configSource on the appSettigns node, wwAppConfiguration doesn't correctly set the file's path and instead (when using the default settings) writes the new values within the <appSettings> node. The problem is then that ASP.Net complains that you cannot specify configSource and settings inside the <appSettings> node.
After a little digging, it turns out that you can use "file" in place of "configSource" for the appSettings node (and sadly only the appSettings node) and it allows you to define values within the <appsettings> node and then override them with your external file. This is fantastic because you can store your "default" values in the web.config and then override some or all of them for your various environments.
The next issue you may run into is if you use web deployment projects, in which case you may get the following error:
web.config(2): error WDP00001: section appSettings in "web.config" has 7 elements but "config\STAGING-appSettings.config" has 19 elements.
To work around this, you just need to untick the "Enforce matching section replacements" checkbox within the properties section and you're good to go!

I hope that helps someone!
Visual Studio Tip of the day: Open files/folders in Windows Explorer
Monday, March 02, 2009 11:09:25 AM (GMT Standard Time, UTC+00:00)
A little irritation/time consuming process when you're working with multiple projects on multiple drives/SVN repos/directories is to open the current file's location within Windows Explorer. If you weren't already aware, you can do this from most projects/files by right clicking on the project in the solution browser:
Problem for me (and my mate Chris) is that not only is it just for the Project Item but more importantly it means using the mouse -which is something I'm trying to avoid as much as possible. Then I stumbled across a couple of posts which suggested opening Windows Explorer with Visual Studio's External Tools dialog.
They're both great ideas but you still need to use the mouse so I thought I'd take the final step and wire up some keyboard shortcuts. I'll recap the process here as I've added/grouped a few of their settings.
Creating the "External Tools"
There's a little productivity tip here for setting the folder in question the root of Windows Explorer, this encourages you to focus on just the work in question (though it can be a little irritating sometimes so I may "undo" this change later.
Custom #1: Open the current solution item in Windows Explorer
Title: Windows Explorer - Item
Command: explorer.exe
Arguments: /select,"$(ItemPath)"
Custom #2: Open the current Visual Studio project in Windows Explorer
Title: Windows Explorer - Project Directory
Command: explorer.exe
Arguments: /root,"$(ProjectDir)"
Custom #3: Open the current Visual Studio solution in Windows Explorer
We've got a number of projects that have useful files/folders stored in the same folder as the solution file so this one's useful to get quick access to them, I think I'll use this one a lot when dealing with SVN.
Title: Windows Explorer - Solution Directory
Command: explorer.exe
Arguments: /root,"$(SolutionDir)"
Custom #4: Open the current solution's binary (bin) directory in Windows Explorer
Useful when you want to get access to the dll i.e. to copy to another folder/upload just the dll to a website.
Title: Windows Explorer - Binary Directory
Command: explorer.exe
Arguments: "$(TargetDir)"
Custom #5: Open the current solution's target build directory in Windows Explorer
This is useful when you have a project that builds to another directory (i.e. a common DLL directory, I'm not sure how many people do this but I've got a couple of projects that do this so I thought I'd share it).
Title: Windows Explorer - Target Directory
Command: explorer.exe
Arguments: "$(BinDir)"
In all instances you can leave the Initial Directory field empty.
Note: On a couple of the directory related commands I've set the "/root" argument, this is a useful little productivity tip I learn a while ago to stop you navigating away from your work. Irritatingly I've not found a way of using the /select and /root commands together. It would also be nice to say "Open the bin folder and set the root to the project folder" but again I've not found a way.
If you're interested in the arguments I'm using there, check out the Microsoft Support article about How To Customize the Windows Explorer Views in Windows XP (these also work in Vista). Alternatively you can read more about the Visual Studio macros for build commands here (some of which are global I believe). I'm interested to see the use of $(TargetDir) as although it'll be useful for non-web projects, however using Web Deployment Projects might make it irrelevant for you.
You should now have 5 new items in your Tools' toolbar:

Wire up the keyboard shortcuts
As mentioned earlier, I want keyboard shortcuts but if you want toolbar icons, you should checkout the end of this post.
Open up the Keyboard settings within the Visual Studio Option dialog (Tools -> Options -> Environment -> Keyboard) -you may need to select the "Show all settings" checkbox in the bottom left of the Options dialog to see the Keyboard option.
In the Show commands containing field enter "Tools.ExternalCommand" to list the set of commands, irritatingly it just labels each command as "Tools.ExternalCommand#" for each command so this bit will require a little thinking on your behalf. My commands are #2-6 (#1 is the Dotfuscator Community Edition command).
I would then wire up the following shortcuts (I've set them up Globally for convenience):
Tools.ExternalCommand2 (Current Item): Ctrl+E, I
Tools.ExternalCommand3 (Current Project): Ctrl+E, P
Tools.ExternalCommand4 (Current Solution): Ctrl+E, S
Tools.ExternalCommand5 (Bin dir): Ctrl+E, B
Tools.ExternalCommand6 (Target dir): Ctrl+E, T

To enter these shortcuts simply press the first combination (in this case Ctrl+E), then press the second key (I -item, P -project, S -solution, B -binary, T -target). I found that a couple of these were already wired up to ReSharper and Pex which is a pain but I don't tend to use those particular shortcuts so I just overrode them
Now you should be able to press Ctrl+E followed by I and get your current item in Explorer.
It'd be nice if I could get it to use a single instance of Explorer and just refocus the items (on another key combo as that's not always the desired action).
Update: After using it a little, I've noticed that in my projects, I had the Bin/TargetDir the wrong way around (now corrected).
Custom Visual Studio Build Events
Monday, December 15, 2008 6:21:37 PM (GMT Standard Time, UTC+00:00)
I thought I'd share some festive "fun" today. For quite some time now I've hooked into the build events within Visual Studio but I think this is just taking it too far...

Basically the script now increments the version number of the DLL (if relevant) automatically, times the time for the build and adds it to a total build time to date (stored in an external txt file) and finally prints out whether the build was a success or not -basically some of our projects are taking a while to build and I wanted something that was "clearer" ;)
I'm thinking about adding Christmas trees next, anyone know how to do them in ASCII?
WSDL returning a valid response but object is null
Saturday, November 01, 2008 6:28:49 PM (GMT Standard Time, UTC+00:00)
We had an interesting problem the other day while integrating with a web service hosted on an apache server. Every time we called the WSDL methods we could see a valid request being sent and a valid response being returned (ok there were a few syntax errors but nothing that would stop it converting) but despite this every time, without fail, it would return null at code level.
The solution was actually amazingly simple. In short, since our last flurry with web services we've upgraded to Visual Studio 2008 and installed ReSharper (see below for how that's relevant). In VS2008 they've sneakily added a new menu "Add Service Reference" and although it's in the same menu location and a similar wording etc does something different. If you add your WSDL reference this way it will more than likely fail.
To add a "Web Reference" in Visual Studio 2008 follow the instructions below and hopefully you won't go down the same routes that I did trying to debug the XML...
Click the "Add Service Reference" menu option (obviously!)

The screen below should appear, instead of entering the address of the web service into the address bar, click the advanced button at the bottom (highlighted)

That'll then bring up the screen below, on which you need to click the "Add Web Reference" button at the bottom.

You should then be presented with the usual "Add Web Reference" screen (see below).

Why did I mention ReSharper? Well I've notice that as well as adding to the IDE they've also updated some of the menu items, most noticeably "Go to Definition" which is now "go to Declaration" (see below) so I figured this new menu option was thanks to them.
ReSharper: 
Without ReSharper: 
So the next time your WSDL is returning a null object even though a valid response is being retrieved, check how you added it in Visual Studio,.
Registration opens for the UK launch of Visual Studio 2008 -in Birmingham
Friday, January 18, 2008 12:13:38 PM (GMT Standard Time, UTC+00:00)
For those of you Microsoft readers I thought I'd let you know I've just had an email come through about Visual Studio's UK Launch. It's happening on March 19th 2008 in Birmingham's ICC. Registration has finally opened and you can register here: http://go.microsoft.com/?linkid=8126604
Alternatively check out the live cast at: www.heroeshappenhere.co.uk.
Why am I excited about this? Well the last launch event I went to gave away free -and full- copies of Microsoft Visual Studio 2005 and SQL Server 2005 to every delegate! Hope to see you there -let me know if you can make it.
Registration opens for Visual Studio 2008 launch events... but the UK doesn't exist (yet!)
Thursday, January 03, 2008 2:38:19 PM (GMT Standard Time, UTC+00:00)
This mad me smile, when surfing around at lunch I stumbled across www.heroeshappenhere.com -Microsoft's Visual Studio 2008 launch site. I got all giddy with excitement, downloaded the latest version of Silverlight and woohoo -a registration link! Finally!
Sadly though, you can only register for the LA event at the moment. Check the "Outside of the US" drop down though, it'll make you smile (or at least it did me) -notice anyone missing? (Other than France that is :P)
Microsoft Expression Web and CSS -is it all it's cracked up to be?
Thursday, July 19, 2007 11:02:32 PM (GMT Daylight Time, UTC+01:00)
After a number of months of hearing how great Microsoft's latest web development environment is -Microsoft Expression Web- I thought I would install it in place of Dreamweaver on my new laptop. I was -until today- pretty impressed with some of it's features, how well it handles CSS within the IDE and had no reason to complain.
That was until today. As I write this, I'm sitting in our apartment in Croatia with the sun beating down on me, generally enjoying life. As it's incredibly hot outside around noon, I thought it would be a good idea to crack on with some work on the new The Site Doctor design -which I hope to have online shortly after I return. So I load up Microsoft Expression Web and the various pages of the new site and crack on.
I've already sorted the CSS for the site so there was no need to open any of the files or make alterations to them however I like to have them open so I can check class names and ids as I work. When I switched over at one point, I noticed that my nice, neat and tidy CSS file of around 190 lines was suddenly closer to 300. I couldn't work it out until I noticed that Microsoft Expression Web had separated out all my group declarations into separate declarations such i.e.:
Became:
Well done Microsoft, I thought you would have learnt your lesson after the fiasco that was Visual Studio 2003's HTML editing, what on earth were you thinking? I'm sure this is a simple setting I need to change (and I can understand why they've done it) but not having Internet access here there's no easy way of finding out (I've searched the help files) which means hours of careful CSS architecture have been completely trashed.
So, as soon as I realised, I spent about 20 minutes meticulously working through the bunch of CSS files open reversing the mess Microsoft had made of them and promptly closed them, safe in the knowledge Microsoft Expression Web can't mess with them again. Or so I thought.
A short while ago I needed to open one of the CSS files again to alter a few declarations and to my horror I found that the declarations had been ungrouped. I can't believe it, not content with simply altering the CSS files that are open, Microsoft Expression Web actually alters the CSS files on the FSO without you knowing.
If you're ever thinking about using Microsoft Expression Web for CSS development then don't expect your files to be neat and tidy, in my case I would say the files were increased in size by almost 5x which ok may be 1Kb --> 5Kb but if you're getting tens of thousands of hits a day, that's a serious bandwidth increase.
Not a happy bunny.
Importing/Referencing DLLs in Visual Studio
Tuesday, February 13, 2007 8:03:03 PM (GMT Standard Time, UTC+00:00)
A couple of people have got stuck on various lists/forums I’m on moving from ASP to ASP.Net and the differences there are, the one first major sticking point I had was referencing DLLs –so don’t worry you’re not the only one! So this is a really simple look at what you need to look at and how you reference DLLs –if you’ve ever added a DLL before you’ll probably find that this is too simplistic for you but read on anyway!
Firstly, referencing a DLL is basically a way of including someone else’s code within your project (or a common codebase that you re-use), this also includes controls, useful/common functions or just additional functionality such as Crystal reports.
Before you can use someone else’s code (i.e. Phil Whinstanley’s error reporting class) within your code you have to include a reference to the relevant DLL. The first thing I would do is create a folder somewhere that’s easily accessible to all machines that may need to reference the DLL i.e. “c:\Useful DLLs\”. Then, within this folder, I would create the following sub folders:
- c:\Useful DLLs\.Net 1.1
- c:\Useful DLLs\.Net 2.0
- c:\Useful DLLs\.Net 3.0
- c:\Useful DLLs\ASP.Net 1.1
- c:\Useful DLLs\ASP.Net 2.0
- c:\Useful DLLs\ASP.Net 3.0
This is something that I’ve only recently started doing after having multiple releases for the same DLL. For each DLL place a copy within the relevant folder.
Next, load your project within Visual Studio, right click the solution (this is the very top of the tree) and select “Add Reference":
A window will then popup that looks something like this:
Depending on what sort of reference this is, the majority of the time I would expect you’ll be needing to use the “Browse” tab –this allows you to navigate the FSO and find the DLL to reference (which should be somewhere in c:\useful dlls\). Once you’ve found it select the DLL and click Add.
Your DLL is now referenced and you should be able to start using it straight away. Depending on what you need to do with it you’ll also need to add Page and/or Codebehind imports. To check that it has imported correctly, in Visual Studio 2003 you should be able to see it in the references folder or in Visual Studio 2005 you will need to click into the "Class View" tab of the Solution explorer:
How do I identify the namespace?
I had someone ask me a while ago why the his code was throwing a compilation error, it turned out that although he had named the DLL MyDLL, the namespaces within the DLL he wanted to reference was MyNamesapce so how can you identify the namespace?
The easiest way to do this is to use something called the Object Explorer, this should list all the referenced DLLs for a given project and allow you to navigate the namespaces, classes and objects within the class. To open the Object Explorer click on the View menu and then “Object Explorer” within the “Windows” menu. Navigating the DLL is easy, you can either search through it using the search box at the top or alternatively navigate using the object tree.
The best way to work out what declaration you need to add is to locate the object, method or control you plan on using either using the tree navigation or searching, then selecting it. Once selected you will notice the bottom pane of the Object Explorer will change and the namespace will be listed, this is what you need to add as your reference. If you need to enter the assembly name, you can identify this easily as it’s the name given to the top node of the tree –this should have a little grey icon next to it.
If the DLL is adding a control to the page
You’ll need to reference the namespace at the top of the page like this:
<%@ Register TagPrefix="TSD" Namespace="TheSiteDoctor.WebControls" Assembly="TheSiteDoctor" %> You can use whatever prefix you like for the control, I tend to keep it between 2 and 4 characters in length for ease i.e. “TSD” but that’s up-to-you. Adding the control is done in the same way you add the standard controls:
<TSD:SuggestionTypeRadioButtonList runat="server" ID="radCategories" CssClass="inputRadio" ValidationGroup="suggestion" /> You’re all set :)
If however this is a control set that you plan on re-using throughout the application I would opt to add a reference within the web.config, this means you don’t need to repeatidly add the reference for each page. To do this you’ll need to add the following to your web.config file:
<system.web>
<pages validateRequest="false">
<controls>
<add tagPrefix="TSD" namespace="TheSiteDoctor.WebControls" assembly="TheSiteDoctor" />
</controls>
</pages>
</system.web> If the DLL is adding functionality to the codebehind or you want to use the control within the codebehind
If you want to use the control or add the control to the page dynamically you will need to include a reference to the namespace within the codebehind –in the same way you do the System namespaces. This is really simple, at the top of the page you should see a few “using” statements or in VB “Imports”, you’ll just need to add the referenced DLLs namespace below (or above –or- in the middle!) of these others, as long as it’s with the other statements you’ll be fine. You can then reference the various methods and properties of the control.
using TheSiteDoctor.WebControls;

public partial
class SuggestionsPage : System.Web.UI.
Page
{...} 
{
protected void btnAddEntry_Click(
object sender,
EventArgs e)
{...} 
}
I hope that helps you getting started with this new way of importing common code, it’s fairly intuitive once you’ve done it once or twice, but those first few “Could not find xyz –Are you missing an Assembly or Reference” messages do drive you nuts ;)
Web.Config, Visual Studio and Intellisense Issues
Friday, January 05, 2007 2:57:57 AM (GMT Standard Time, UTC+00:00)
I’m not sure how many people this applies to but a while ago I found I was loosing VS2005 IntelliSense when I was working in my web.config. More specifically I lost IntelliSense after editing any of the site’s settings using the Web Site Administration Tool in ASP.Net 2.0.
I quickly realised that the issue was being caused because the Web Site Administration Tool updates the root element (<configuration>) of your Web.Config file to include an attribute of “xmlns”. If you’re loosing IntelliSense, just delete the attribute and you’ll have it back in a tick :)
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
Should be:
<configuration>
p.s. Yes Doug, I can already hear you crying out “Not for me –I don’t use VS” *yawn*
Useful Visual Studio Plugin
Saturday, September 30, 2006 7:13:45 PM (GMT Daylight Time, UTC+01:00)
On surfing around the net the other day looking for a replacement to Visual Studio 2003’s clipboard monitor I stumbled across this excellent Clipboard manager plug-in for Visual Studio 2005. As his blog was offline at the time I wasn’t sure exactly how to use it but now I’ve had a play I’m not sure I’ll be able to do without it!
Check out the Clipboard Manager plug-in at
http://www.csharper.net/blog/clipboard_manager_upgraded_to_package.aspx
For those of you interested, the plug-in monitors the clipboard activity allowing you to resurrect previous clipboards and make them current and even locking items so you can use them at a later date. I’ve found it incredibly useful when testing sites as it allows me to keep common messages on the clip. Downside is you have to have Visual Studio open at the time so I’ll have to look into a standalone version.
Here are a few shots of it in “action”:

The items that have been added to the clipboard in the past show up in the list at the top and there's a small preview window below (which I think you can select parts out of). You can also remove all items from the history by clicking the icon in the top left.

To re-select an old item double click it and it's instantly the main item! The currently selected item is the one in black text with a green arrow next to it.

The context menu offers a number of extra options including the ability to lock and unlock an item, this means when you restart your computer the item is still in the history -great if you have common items such as test credit card numbers! If you want to remove a single item from the history, you can do that using the context menu too. I've not yet used the "Save to File" or "Search Online" items.
Update: There does seem to be some sort of glitch with it, I think my history has got corrupt at somepoint so when I clear all the unlocked items new items weren’t getting caught anymore. I've found two solutions: The first is to restart Visual Studio, the other is to unlock all items and clear the history completely. This seemed to sort it. I did also note that I had one blank item at the top of the list so I guess that's what was causing it.