Source Code plug in for WordPress blogs using Open Live Writer

This article has been moved to its new home here:

Read the comment section.

I like to write.  I use WordPress at the moment for my blogs, I think as the blogs are stored in a database instead of being static text when I want to move to another platform or technologiy, I will only need to export the data and format it to match the new platform requirements.  Also, I can change templates and see how my blog looks.  So I can chage how my blog looks almost as often as I would like.  I also host my WordPress blog on Azure, and there are many options, see Figure 1.


Figure 1, wordpress on Azure, so easy

I also use Open Live Writer which you can get from here.  This makes it so easy to write and then post a blog.

As I find myself working on many computers, I need also to configure the Open Live Writer to format my source code example, I can always find the plug-in, but sometimes it give me some troubles during the configuration.  I am going to document it here for future reference.  You can download and see the already provided configuration instructions here.

Here are the actions I take to configure this plug-in.

  1. Download the Version 2.0.0 BETA (recommended) –>
  2. Make sure I have at least .NET 4.5.2 installed.  Using Web Platform Installer to find out which version of .NET you are running is a good approach.  I mention this in a number of my posts here, here, here and here. As shown in Figure 2, .NET 4.5.2 is not installed.  Therefore it needs to be installed.  YOu might consider installing the most current version of Visual Studio as this would usually include the most current version of the .NET Framework.
  3. Create a directory named Plugins here:  C:\Users\<username>\AppData\Local\OpenLiveWriter\app-*.*.*.
  4. Place all the contents of the downloaded ZIP file into the Plugins directory.
  5. Restart Open Live Wrtier and check if the plugin is present, see Figure 3, it is not there
  6. Use Process Monitor to see what is going on….  What I find is that:
    1. There is a log being written, see Figure 4.
    2. The process is looking into the Plugins dirctory I created in step 4 and it finds it
  7. Look into the log file and see if there are any tips, BINGO…
  8. The link in the exception mentions that I need to add an entry into the configuration file:
    1. The configuration file is located here:  C:\Users\<username>\AppData\Local\OpenLiveWriter\app-
    2. It’s called OpenLiveWriter.exe.config
  9. Add/enable the loadFromRemoteSource attribute in the file
  10. Restart the editor, and you should see the Plugin, Figure 6
<?xml version="1.0" encoding="utf-8"?>
    <loadFromRemoteSources enabled="true" />
OpenLiveWriter,1.8332,None,00008,19-Jan-2017 13:52:10.007,"System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\benperk\AppData\Local\OpenLiveWriter\app-\Plugins\SyntaxHighlight_WordPressCom_OLWPlugIn.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)File name: 'file:///C:\Users\benperk\AppData\Local\OpenLiveWriter\app-\Plugins\SyntaxHighlight_WordPressCom_OLWPlugIn.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See for more information.



Figure 2, how to check the version of .NET installed on your work station


Figure 3, source code plugin for WordPress blog and Open Live Writer


Figure 4, Open Live Writer log file, source code plugin


Figure 5, Open Live Writer log file, source code plugin


Figure 6, Open Live Writer source code plugin

Comments (6)
  1. Vishal says:

    Thanks for this plugin

  2. Note to self, thanks for this one! WHen I wrote this article i had app- and somehow it updated itself and created a new folder with app-0.6.2 and the config file did not have the proper configuration. I added it and back in business, thanks.

    1. Another note, when the upgrade happened to app-0.6.2, I also needed to copy the Plugins directory that contains the SyntaxHighlight_WordPressCom_OLWPlugIn.dll from the previous version.

      1. Note to self: I installed the Live Writer Plugin on my PC, but for some reason I installed Version 1.4.2 and got an error when loading it that included a reference to WindowsLive.Writer.Api. I then installed Version 2.0.0 BETA and it worked again as expected.

  3. You can add a registry string value to HKEY_CURRENT_USER\Software\OpenLiveWriter\PluginAssemblies in the registry to point to the location on your machine where the DLL resides. Avoids having to copy the DLL to a new folder with each release. An example string value:

    Value Name: SyntaxHighlighter
    Value Data: C:\Apps\OLW\AddIns\SyntaxHighlight_WordPressCom_OLWPlugIn.dll

  4. Local drafts are stored in C:\Users\yourId\Documents\My Weblog Posts, this is configurable via File -> Options -> Preferences

Comments are closed.

Skip to main content