2013-06-16 Update: There is now a patch for the issue discussed below.
I just upgraded to BlogEngine.net 2.8 as it contains a fix for broken links from Facebook. There were a couple of hitches that I'll share in case they help anyone else.
I messed up the first upgrade attempt because the updater utility updates the source folder (containing the newly downloaded 2.8 code) instead of the destination folder (containing the current version of your blog). This is a little odd and the result is I uploaded an unchanged instance and then embarrassingly complained the the Facebook bug hadn't been fixed. It had, just not in the folder I was expecting. I probably didn't pay enough attention to the instruction video.
Having got that out of the way I discovered that new posts were appearing with a bad link (to /.aspx instead of /blog-title.aspx). I rarely post using the editor as I have a home-grown post by email service running. After a bit of digging it turns out that prior to 2.8 you could leave the slug empty when creating a post but now this results in the bad link. Luckily there isn't much effort require to fix this, you just need to set the slug before saving the new post:
post.Slug = Post.GetUniqueSlug(post.Title, post.Id);
In the middle of playing with this my live site died and started returning a 500 error. No amount of uploading the working local copy would fix this. Happily Server Intellect have outstanding support and restored a working backup for me in the middle of the night. Thanks chaps!
Today I upgraded this blog to the latest and greatest version of BlogEngine.NET. Not entirely smooth sailing, so here are my notes for others (and the next time I have to do it):
The IsCommentsEnabled property BlogEngine.Core.Post has changed to HasCommentsEnabled. Not sure why this was worth changing but easy enough to fix.
BlogSettings.Instance.StorageLocation doesn't exist any more. After some digging it turns out that you need to use Blog.CurrentInstance.StorageLocation instead.
WidgetBase and WidgetEditBase in a couple of custom widgets complained that the type or namespace could not be found. This is fixed by adding a using statement for App_Code.Controls.
Getting the blog running locally was as usual only half the hassle. The next step is deploying to my hosting provider, Server Intellect. Things always start going wrong at this point. Luckily Server Intellect has some really great support staff and they respond quickly even on a Saturday night.
The first problem is that my backups were broken. Backups always succeed, restores always fail. After restoring my App_Data folder the last month of posts were missing. After digging for a bit it turned out that recent files were invisible over FTP but present in the control panel for the domain. My server had been migrated and some sort of permissions issue had broken access to new files. Not specifically a BlogEngine.net issue, but took a while to figure out and then for Server Intellect to fix.
Once the files were all there I uploaded and the blog itself was working fine, but the admin pages were screwy. It turns out that my server doesn't have ASP.NET MVC 3 installed. Server Intellect offered to migrate the server, but instead I copied System.Web.Mvc.dll to the Bin folder after finding a post on MVC 3 deployment from Scott Hanselman. I also needed to add a MIME type for .cshtml (text/html). With this in place the fancy new admin pages are up and running.
Updated again, 2012-03-11:
Another namespace issue, ExtensionSettings in an extension doesn't resolve any more. Need to add a using statement for BlogEngine.Core.Web.Extensions. There are also some changes required to make an extension support multiple blogs.
Testing posting by email with a picture of the moon from last night...
I've extended BlogEngine.NET to post by email. Not horrible for the very specific case of this blog and a short list of email clients. I shudder to think of extending it to the general emails and different templates.
I’ve just moved ITHCWY comments over to Disqus. BlogEngine.NET now supports Disqus out of the box, but doesn’t export comments to anything that Disqus is willing to eat. I’ve knocked up a quick converter that takes a full BlogML export from BlogEngine.NET (and at least in theory any other source of BlogML) and converts the comments to WXR. You can import the WXR file under the Generic option in Disqus.
The tool is a Windows console application that takes two parameters, the BlogML import file and the WXR output, i.e.:
BlogMLtoDisqus.exe C:\BlogML.xml C:\ForDisqus.wxr
It isn’t fancy and there is no error checking so it will either work or die horribly. If the latter, leave a comment and I’ll try to fix it for you.
Download BlogMLtoDisqus.exe. You’ll need to install .NET 4.0 as well if you don’t already have it.
Updated 2011-04-22: Added an optional third parameter that specifies the XML namespace for BlogML in case you need to override the default.
I've written an extension for BlogEngine.NET that automatically adds several different geographical tags to blog posts. I knocked this up for my Hikes blog. It might be useful for any blog where some of the posts are related to a real world location.
To get started download GeotagFromKML.zip (2.24 kb) and copy GeotagFromKML.cs to the App_Code\Extensions folder in your BlogEngine.NET instance.
The extension does two things. Firstly it looks for a link to a KML file when post is added or updated (it does this because each of my hike posts includes a Google Earth KML file for the hike). If a KML link is found then a paragraph is added to the post containing the longitude and latitude of the first coordinate in the KML file. The paragraph uses the Geo microformat. You can customize the text in settings for the extension. You can also regenerate by deleting the paragraph and saving the post.
The second function is to add ICBM and Geo Tag META tags when serving a post that contains the geotagged coordinates. You can take advantage of this without linking to a KML file, just include a location like this in your post:
Once you have geotagging up and running you might also want to add GeoURL to the list of ping services for your site.
I finished off my BlogEngine.NET migration yesterday missing a couple of useful sections from the previous incarnation of this blog. The first is a list of the most popular posts based on Google Analytics data. I've just finished porting this from a UserControl to a widget for BlogEngine.NET. To use this just download and extract this zip file to your widgets directory:
MostPopularFromGA.zip (5.22 kb)
You can see the widget in action under the Most Popular heading to the left if you're reading this post on the blog.
(Update June 22, 2010: I've released a tool, Blogger2BlogML, that converts Blogger's ATOM export file to BlogML. I ended up doing this because of problems with comments when I migrated this blog — I had to fix these up manually which was painful. I'm now working on some larger blogs where this would be impossible…)
In January I got an email from Blogger announcing that they're killing FTP support. Apparently only 0.5% of Blogger blogs are published using FTP and it's a huge pain to support, mainly because many hosting providers restrict FTP access to certain IP addresses and if the Google servers running Blogger that moment aren't listed it's technical support time.
Fair enough, but a bit painful for me as I have five blogs running on top of Blogger. I need FTP publishing as the templates I use end up running as ASP or ASP.NET pages. I Thought He Came With You is the first to move - if you're reading this post then it's up and running on BlogEngine.NET. This is an open source ASP.NET blogging platform. If it works out for this blog over the next month I'll start migrating the others.
Getting up and running with BlogEngine.NET is easy enough - download the latest release and follow the getting started guide. I added the default install to a new Visual Studio web site project and was able to run it fine in the development server, no need to configure IIS.
The challenge was moving posts and comments from Blogger into BlogEngine.NET. BlogEngine.NET happily imports and exports BlogML, Blogger spits out it's own Atom export format.