Windows Live Writer – ArgumentOutOfRangeException

Although the new beta of Windows Live Writer is pretty slick it does have one horrible horrible bug that affects WordPress users.

After installing the second beta I found any attempt to open an existing post or draft from my WordPress blog would fail with a cryptic error of “ArgumentOutOfRangeException”. After a lot of trial and error I tracked the problem to several posts that used <pre></pre> tags to wrap pre-formatted text such as code snippets.

This was confirmed when I posted my findings on the Live Writer forum, though the problem isn’t just with <pre> tags. Any post containing multiple <script> or <style> tags within the body will also cause an ArgumentOutOfRangeException.

For anyone using these tags in their posts this is very much a show stopper. There’s no workaround in Windows Live Writer, and no planned fix until the next version – which could be months away.

Fortunately, there is a temporary solution.

The latest version of the Keyword Tags WordPress plugin includes an option that fixes this problem server side. When Windows Live Writer retrieves a post from your blog for editing any <pre>/<script>/<style> tags are converted into uppercase, which for some reason does not cause a problem.

This is far from ideal, but if this bug is preventing you from using Windows Live Writer with your WordPress blog then it’s the best workaround that I’m aware of!

This entry was posted in General and tagged . Bookmark the permalink.

7 Responses to Windows Live Writer – ArgumentOutOfRangeException

  1. Can you try upper-casing the pre, script, and style tags (just the tag name itself) on download? The code in question is case-sensitive.

    And I don’t think you’d even need to do anything on upload then.

  2. Andrew says:

    Hi Joe,

    Yes uppercase also works, and is of course a far better solution. Thanks for the tip!

  3. Roy says:

    Great, thanks Andrew!

  4. OmegaMan says:

    How did you debug this issue? I would never have thought that this problem dealt with tags of the html, let alone the case of the tags….thanks for finding and reporting on it.

  5. Pingback: Update On Windows Live Writer Bug Fixes » First the dreaded ArgumentOutOfRangeException, any , The second problem, Stripped div tags, all, Wordpress, I've, Live, Writer, Technorati » Just Thinkin'

  6. Pingback: Working… | Fredrik Wall

  7. John Yedinak says:

    Thank you!

    You just made my morning… I started getting this error over the weekend and it drove me crazy!

    Thanks again.

    John