For copying and pasting source from Visual Studio into my blog posts, I have found CopySourceAsHtml to be very helpful. For those that are not familiar with it, CopySourceAsHtml integrates nicely with Visual Studio by adding a context menu item, which allows you to easily copy source code from your source files. All of the HTML formatting is handled by the add in.
As far as I’m aware, there is currently no official release of CopySourceAsHtml for Visual Studio 2010. The good news, however, is that I was able to modify the associated .Addin file to make it work. This is not an official “workaround” from the CopySourceAsHtml developers; I just happened to find that it worked. Thus far, I have not encountered any issues with using CopySourceAsHtml within Visual Studio 2010 (at the time of this posting, I’m using the Visual Studio 2010 beta 2 release).
To integrate CopySourceAsHtml with Visual Studio 2010, please follow the instructions, below:
- Locate the CopySourceAsHtml.AddIn file (by default, it’s located in, C:\Program Files\J.T. Leigh & Associates\CopySourceAsHtml)
- Copy and paste this file into the Addin directory for Visual Studio 2010 (locate this by selecting Tools –> Options –> Add-in/Macros Security)
- Edit the XML in the .Addin file, changing the text within the <Version> elements to 10.0.
- Change the text in the <Description> element so that it references Visual Studio 2010 rather than 2008.
- Restart Visual Studio 2010 if it was already open
- Check Tools –> Add-in Manager and verify that the CopySourceAsHtml add in is checked to enable it.

Your updated XML should look like this:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Extensibility xmlns="http://schemas.microsoft.com/AutomationExtensibility">
<HostApplication>
<Name>Microsoft Visual Studio Macros</Name>
<Version>10.0</Version>
</HostApplication>
<HostApplication>
<Name>Microsoft Visual Studio</Name>
<Version>10.0</Version>
</HostApplication>
<Addin>
<FriendlyName>CopySourceAsHtml</FriendlyName>
<Description>Adds support to Microsoft Visual Studio 2010 for copying source code, syntax highlighting, and line numbers as HTML.</Description>
<Assembly>JTLeigh.Tools.Development.CopySourceAsHtml, Version=3.0.3215.1, Culture=neutral, PublicKeyToken=bb2a58bdc03d2e14, processorArchitecture=MSIL</Assembly>
<FullClassName>JTLeigh.Tools.Development.CopySourceAsHtml.Connect</FullClassName>
<LoadBehavior>1</LoadBehavior>
<CommandPreload>0</CommandPreload>
<CommandLineSafe>0</CommandLineSafe>
</Addin>
</Extensibility>
Update: For anybody that wants to help test, I have submitted this update as a patch to the CopySourceAsHtml project.