As there are still bloggers who use CopySourceAsHtml add-on for Visual Studio to get syntax highlighted code to their blog posts and there is no guidance in CSAH site how to make it work with Visual Studio 2010 I will give my guidance here. Almost all code in this blog is syntax highlighted by this add-on (read more from my post Visual Studio add-in: CopySourceAsHTML).
Last version of CSAH is available for VS2008 but it is easy to make it work with VS2010. Just follow these steps.
- Close VS2010 if it is opened.
- Goto folder MyDocuments\Visual Studio 2010.
- Move to AddIns subfolder (create it if there is no such subfolder).
- Create file called CopySourceAsHtml.AddIn and open it in text editor.
- Paste the following XML to editor:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Name>Microsoft Visual Studio Macros</Name>
<Name>Microsoft Visual Studio</Name>
<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>
- Save file and close it.
- Run VS2010 and activate add-on if it is not activated yet.
That’s it. If you are heavy user of CSAH then I recommend you to bookmark this post. :)