Posting source code on a WordPress.com blog

Perhaps you – like I was – are trying to post source code on your wordpress.com hosted blog but can’t get it to display properly. You’ve inserted the ‘sourcecode’ tag in HTML view, but when you hit the ‘Visual’ tab of the editor, it still comes out like this:

Perhaps you’ve already followed the instructions on this page to no avail.

As it turns out, the Visual preview feature of the editor simply doesn’t fully render your post. You need to use the ‘Preview’ button to determine whether your sourcecode tags are working:

public void WriteToConsole()
{
Debug.WriteLine("This is what you should see when you hit 'Preview'!");
}

And that’s really all there is to it. You don’t need to add a plugin or anything – it’s already available for you to use.