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!
I’ve just released Catfood Earth for Android 1.10. You can control the center of the screen manually (the most requested new feature) and also tweak the transparency of each layer and the width of the terminator between day and night. It also starts a lot faster and has fewer update glitches. Grab it from Google Play if this looks like your sort of live wallpaper.
I’ve just released Catfood Earth for Android. It’s my second app created with Xamarin’s excellent toolkit. Being able to develop in C# allowed me to reuse a lot of code from the Windows version of Catfood Earth. The Android version doesn’t include all the same layers (yet) but it’s got the main ones – daytime (twelve different satellite images included, based on NASA’s Blue Marble Next Generation but with some special processing to make them look better), nighttime (city lights, shaded to show nighttime and the terminator between day and night) and a clouds layer that is downloaded every three hours.
My main worry had been that this would suck the phone battery dry, but after a fair amount of optimization it doesn’t even register on the battery consumption list. Grab it now from Google Play ($3.99, Android 2.2 or better).
Here’s how to share a picture to Facebook, Twitter and so forth from MonoDroid:
Java.IO.File cache = ExternalCacheDir;
if ((cache == null) || (!cache.CanWrite()))
// no external cache
cache = CacheDir;
Java.IO.File tempFile = new Java.IO.File(cache, "temp.jpg");
using (FileStream fileStream = File.OpenWrite(tempFile.AbsolutePath))
_currentBitmap.Compress(Bitmap.CompressFormat.Jpeg, 85, fileStream);
Intent shareIntent = new Intent(Intent.ActionSend);
shareIntent.PutExtra(Intent.ExtraText, "Some text - appears in tweets, not on facebook"));
StartActivity(Intent.CreateChooser(shareIntent, "Share Image");
A fun mix of Java and C#. The directory got me to start with so check to see if the ExternalCacheDir is available and if not fall back to the internal CacheDir. Frustratingly Facebook doesn’t pick up on the text associated with an image regardless of the intent ExtraWhatever specified.
I’ve just released a WebCam app for Android. It’s based on WebCamSaver but allows you to control the webcam – you tap the edges of the screen to pan, pinch to zoom in and out. A fun little time waster.
This is the first app I’ve released using Xamarin’s MonoDroid framework. This integrates nicely into Visual Studio and allows you to program an Android app in C#. This is fantastic for productivity and code reuse and I enjoyed the process a lot more than previous work I’ve done in Java / Eclipse. The main drawback is that the framework adds around 5MB (significant for mobile) and the documentation isn’t always the best, especially when you search for something and find out you’ve been dumped into iOS reference material. Digging around the sample code and cross-referencing the official Android documentation helps a lot. I’m going to take a stab at something a little more ambitious next…
I’ve stubbed my toe on this a couple of times, so here is the magic incantation:
using (SmtpClient smtp = new SmtpClient())
smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.UseDefaultCredentials = false;
smtp.EnableSsl = true;
smtp.Host = "smtp.gmail.com";
smtp.Port = 587;
smtp.Credentials = new NetworkCredential("email@example.com", "password");
// send the email
Catfood PdfScan 1.40 is a small bug fix release. PdfScan converts documents to PDFs with the help of a flatbed or automatic document feeder (ADF) scanner.
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.