by Klaus Graefensteiner
22. October 2010 09:42
Introduction
I am a BlogEngine.NET user since version 1.2. From the very beginning I authored and published my blog posts with Windows Live Writer. In these early days BlogEngine.NET created a separate picture file folder for each blog post. It was located in the \files\WindowsLiveWriter\ directory and Windows Live Writer created a uniquely named subfolder that had the title of the blog post plus some numbers and letters at the end.
With BlogEngine.NET 1.4 and greater this changed. By default the pictures get published into the \files\ directory using the original picture name plus and index that BlogEngine.NET generates.
This blog post describes how to change BlogEngine.NET 1.6.1 or 1.5 back to its old behavior.
Individual picture folders for each blog post
The solution is pretty simple. All you need to do is modifying the wlwmanifest.xml file that is located in the BlogEngine.NET root folder. The original BlogEngine.Net wlwmanifest.xml files looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<manifest xmlns="http://schemas.microsoft.com/wlw/manifest/weblog">
<options>
<clientType>Metaweblog</clientType>
<supportsEmbeds>Yes</supportsEmbeds>
<supportsKeywords>Yes</supportsKeywords>
<supportsNewCategories>Yes</supportsNewCategories>
<supportsNewCategoriesInline>Yes</supportsNewCategoriesInline>
<supportsCommentPolicy>Yes</supportsCommentPolicy>
<supportsSlug>Yes</supportsSlug>
<supportsExcerpt>Yes</supportsExcerpt>
<supportsPages>Yes</supportsPages>
<supportsPageParent>Yes</supportsPageParent>
<supportsAuthor>Yes</supportsAuthor>
<supportsGetTags>Yes</supportsGetTags>
<requiresHtmlTitles>No</requiresHtmlTitles>
<fileUploadNameFormat>{FileName}</fileUploadNameFormat>
</options>
<weblog>
<ServiceName>BlogEngine.NET</ServiceName>
<imageUrl>pics/wrenchicon16.png</imageUrl>
<watermarkImageUrl>pics/wrench84watermark.png</watermarkImageUrl>
<homepageLinkText>View your blog</homepageLinkText>
<adminLinkText>Manage your blog</adminLinkText>
<adminUrl><![CDATA[{blog-homepage-url}login.aspx]]></adminUrl>
</weblog>
<buttons>
<button>
<id>2</id>
<text>Tags</text>
<imageUrl>pics/benTag24.png</imageUrl>
<contentUrl><![CDATA[
{blog-homepage-url}api/tagminiview.aspx
]]></contentUrl>
<contentDisplaySize>250,250</contentDisplaySize>
</button>
</buttons>
</manifest>
Open the file in notepad or better notepad2 and modify the fileUploadNameFormat XML element like this:
Before change
<fileUploadNameFormat>{FileName}</fileUploadNameFormat>
After change
<fileUploadNameFormat></fileUploadNameFormat>
Download
The wlwmanifest.xml files (before and after) can be downloaded here: WLWBEFix.zip
Other notes
Reload the Windows Live Writer manifest file
After the change save the wlwmanifest.xml file. Then go to Manage Your Account in Windows Live Writer remove the one that is working with BlogEngine.NET and recreate it. This assures that the wlwmanifest.xml file is reloaded. I also recommend to recycle the IIS application pool to also reset the BlogEngine.NET application.
Recent changes in Windows Live Writer
Windows Live Writer also changed in the way it provides the parent folder for the blog specific directories. It used to be called WindowsLiveWriter, but now it is Windows-Live-Writer.
Changes, changes, changes…