A few friends have asked lately about pasting code into blog posts from visual studio.  When you do add code, you want to retain the syntax highlighting features from VS so the code is more readable.  This is a snap with Windows Live Writer.  Live Writer is still considered Beta software but it seems to work pretty well for me.

All you need to do is go to the Live Writer Gallery and check out the cool pluggins that are available.  In this case, I am using the pluggin called “Paste From Visual Studio“.

Just install that and in a snap you go from this:

 

public void dosomething(string anArgument)
{
//this method doesn’t really do anything.
string message = “hello world”
DateTime date = DateTime.Now;
}

To This:

    public void dosomething(string anArgument)
    {
        //this method doesn’t really do anything.
        string message = “hello world”;
        DateTime date = DateTime.Now;
    }

It couldn’t be easier!  Now I just need to add some posts to this blog that really use some pasted code!  Check out this other post I wrote about some other cool features of Live Writer.

Leave a reply

required

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>