Fix Live Writer Protocol Violation Error CR Must Be Followed by LF

One of the most vexing problems I have encountered recently was when Live Writer was not able to open posts on DragonBlogger.com or even publish articles to the site.  Any attempt to contact my WordPress blog would reveal a popup that complained about The server committed a protocol violation.  Section=ResponseHeaderDetail=CR must be followed by LF.

image

This protocol violation was with Live Writer and this one WordPress blog, all my other blogs worked fine.  I investigated like crazy and the problem only started happening when I switched DragonBlogger.com to using Incapsula.  I even disabled WP Better Security to rule it out as a problem.

image

But, I found some solutions that applied to other .NET web applications that I was able to manually apply to Windows Live Writer and get it to work.

Steps to Fix Windows Live Writer Protocol Violation Problem

First make sure you closed Windows Live Writer, the program can’t be open.

image

Open your WindowsLiveWriter.exe.config (yeah it’s a .exe.config file) open it in a text editor.

The file starts with these lines:

<configuration>
<startup>
<supportedRuntime version=”v2.0.50727″/>
</startup>

You will want to add the following lines immediately under those lines:

<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing=”true” />
</settings>
</system.net>

Then save the file.

Note: If you run into problems saving the file because of permissions, you will need to right click on the file, click properties and allow all users to read/write to  the file, then modify the file and restore original permissions after you overwrite the file.

Start up Windows Live Writer, if it gives you problems double check the config file you may have broken the syntax or don’t have something copied correctly.  If it starts properly then go ahead and connect to your blog and your problems should be resolved I know mine were.

 

Update:  Okay I found out this fix does work for Writer 2012, I had to put the statement under the <configuration> tag instead of the <startup> tag however, so for Windows Live Writer 2012 you want it to look like this:

<configuration>
<system.net>
<settings>
<httpWebRequest useUnsafeHeaderParsing = “true”/>
</settings>
</system.net>

Update Dec 6th 2012

Note, if you put your blog behind the Incapsula web caching/proxy service it will block Live Writer without making this configuration change. I confirmed that using Incapsula is what caused Live Writer to stop working and making proper POST calls to the xmlrpc.php in WordPress.  Adding the parameter remediates this problem.

 

Share Feedback We Want to Hear From You