With Visual Studio 2010, an extension existed called Copy as HTML extension that would copy code in Visual Studio, format it as HTML with CSS, and copy the markup to your clipboard. This made it easy to copy code to a blog post or some other online resource. The tool copied into WordPress pretty cleanly too. However, I couldn’t find a version that worked with Visual Studio 2012.
Recently, looking online, I found one that I like that works not too bad with WordPress. It’s available at http://quickhighlighter.com/, an online code formatter tool that gives you a preview and the HTML code. It isn’t quite a clean copy into WordPress; there is some reformatting of markup that needs to take place. However, overall the tool is pretty good.