Syntax Highlighted Code in Your Blog


I sometimes get questions about how to paste syntax highlighted code from Visual Studio into your blog so that it looks purdy, even when using code from a beta product:

var pred = Expression.Lambda<Func<Customer, bool>>(
                  Expression.Equal(Expression.Property(c1, City),
                  Expression.Constant("Seattle")), c1);

You should first install Live Writer:

http://get.live.com/WL/config_all

Then go to the Live Gallery:

http://gallery.live.com/?mkt=en-us

Look at all the Live Writer Add ins:

http://gallery.live.com/results.aspx?bt=9&pl=8&st=3

Select the Paste from Visual Studio add in:

http://gallery.live.com/liveItemDetail.aspx?li=d8835a5e-28da-4242-82eb-e1a006b083b9&bt=9&pl=8

Comments (3)
  1. ccalvert says:

    Ben,

    Yes, the Manoli tools are great. I’ve used them a lot. Recently I’ve used Paste from VS because that will capture the cases where the team has added some new feature, usually in a beta, that is not available yet in the manoli tools. There is a manoli add in for LiveWriter.

    – Charlie

Comments are closed.

Skip to main content