InsertableContentSource

The development world of a madman

Top Tips For Live Writer Plug-in Developers

by @ 14:26 on July 13, 2010. Tags: , , ,
Filed under Live Writer, Tips

Whether you’ve written Live Writer plug-ins before, or if you’re just thinking about writing your first, hopefully this post will give you some good tips that will help you build that new plug-in.

Use A Visual Studio Template

I would highly recommend downloading a Visual Studio template. The template can be downloaded for machines running x86 or x64 flavours of Windows (for VB.NET devs, downloads are x86 and x64). The reason I have done ones for both architectures is because otherwise you have to remove and then re-add the reference to WindowsLive.Writer.Api.dll as it will be looking in the wrong Program Files folder. The template itself is based on a combination of templates written by myself and Ben Hall.

To install the template, download the zip file above for which ever architecture of Windows you’re running, rename the zip to be called LiveWriterPlugin.zip, and put it in your template folder (by default this will be %VisualStudioFolder%\Templates\ProjectTemplates\Visual C#\ or Visual Basic if using the VB template). When you then go to create a new project, you will be given a new project type to choose from:
NewLiveWriterPluginProject

This will create a new project with a default plug-in type of ContentSource, although this can be changed to whichever type of plug-in you’re wanting to create. I am hoping that I can create something better for templates, but for now, this will suffice.

Note: All these templates will work with all flavours of Visual Studio from 2005 up to and including 2010 (including Express editions).

Make Sure The Plug-in Copies Automatically To The Plugin Folder

If you’re using the template from above, then you can skip this tip. Right click your plug-in’s project and go to the properties, in the Build Events tab have this: XCOPY /D /Y /R "$(TargetPath)" "C:\Program Files (x86)\Windows Live\Writer\Plugins\" (removing the (x86) reference if you’re on an x86 OS), so you should see this:
LiveWriterBuildEvents

What this will do is every time you build your project, it will put that latest build in your Live Writer plugins folder so when Live Writer is opened, you will already have the latest copy loaded. This proves handy for the next tip.

Run Live Writer When Debugging Plug-ins

Because Live Writer plug-ins are just dlls, it makes it somewhat more difficult to actually debug them, however, with just a simple change to the project’s properties (again), we can make this oh so easy. In the debug section of our project’s properties, we set it to open an external program, in our case Live Writer itself which is at C:\Program Files (x86)\Windows Live\Writer\WindowsLiveWriter.exe.
image

By doing this, we get full debug capabilities of our plug-in.

Add Plug-in Options to the QAT (Wave 4 and newer)

With the latest beta of Live Writer, we have been given the Ribbon UI that has been present in Office for a few years now. One of the features of this is the Quick Access Toolbar (QAT) and you can pin just about any command from Live Writer to the Ribbon (except your own plug-in). One of the things you can pin to the Ribbon is the button for the plug-in options. Normally, this is in the Insert tab as seen below:
LiveWriterPluginOptionsNormal

But we can pin that to the QAT by right clicking it and clicking Add to Quick Access Toolbar
LiveWriterAddToQAT

Which gives us
LiveWriterOptionsOnQAT

What this actually means is if your plug-in as options and you’re making sure this works ok, it gives you really quick access to those options (clue is in the name I guess) as it opens the Live Writer options on the plug-in page.

So there’s my list of top tips when it comes to developing Live Writer plug-ins. Do you have any of your own? If so, do please share them in the comments.

SL

The URI to TrackBack this entry is: http://dev.scottisafool.co.uk/2010/07/13/top-tips-for-live-writer-plug-in-developers/trackback/

7 Responses to “Top Tips For Live Writer Plug-in Developers”

  1. lehenryjr says:

    This is a good post– it’s good information- it’s a place to start.
    Thanks so much…

    Until next time,
    LEHenryJr
    LEHSYS.com

  2. Thanks for the post. This information is very useful for me as I just start to learn.– Couple From London</a

  3. Im thankful for the blog.Much thanks again. Will read on…

  4. Without a CNAME on the root, you have to specify an A record

  5. Hector says:

    El psicólogo posee todas las herramientas científicas para efectuar estudios en la conducta humana, en pequeños y grandes conjuntos.

  6. Jaqueline says:

    El tiempo, se refiere, que una dislalia puede ser dejar de serlo conforme
    evolucione el lenguaje.

  7. mikeyrox says:

    Hey
    I located this site on yahoo
    Kind Regards

Leave a Reply

[InsertableContentSource is proudly powered by WordPress.]