I've been unable to find such an add-in for VS2010, I only found it for earlier versions.
Does anyone know where I can find a newer version?
I've been unable to find such an add-in for VS2010, I only found it for earlier versions.
Does anyone know where I can find a newer version?
You need to install the Visual Studio Productivity Power Tools, which includes just such an extension (along with many others).
You can install the VS2008 version of CopySourceAsHtml (from here), and then manually edit the CopySourceAsHtml.AddIn
file located at C:\Users\<username>\Documents\Visual Studio 2010\Addins
so that both Version elements are 10.0:
<?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 2008 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>
It looks like Code4Blog will do what you're looking for. I just tried it out and it seems pretty good!
Personally though, if it's an option I highly suggest you go with SyntaxHighlighter over the Html produced by this or other similar extensions because it keeps the source code more lightweight and easy to copy/paste.
Be aware that if you install CopySourceAsHtml via that hack it WILL slow down your startup time by quite a bit. It works, but you may only want to enable it when you need it.