BlogEngine 1.4.5 RSS Issue

January 8, 2009 20:42 by daub815

I tried to add FeedBurner with my new blog website.  However, there was a big error: Specified argument was out of the range of valid values. Parameter name: utcDate.  How nice?  Well, I did some googling and found this answer (Thanks krishnan).  However, the answer was a bit vague as to when the bug fix occurred, so I did some investigating.

The error usually occurs when the hosting server is not in the same time zone as the blogger (i.e. me = East Coast and GoDaddy = West Coast).  That means the server offset time is usually +2, so the posts appear right to the blogger. 

Here is the code from the latest BlogEngine.Net release: 

 
foreach (IPublishable item in items) 
{ 
	if (item.DateModified > lastModified) 
		lastModified = item.DateModified; 
}

At first glance, everything seems fine.  However, there is an issue because the server offset is never taken into account, so here is the latest fix:

foreach (IPublishable item in items) 
{ 
	if (item.DateModified.AddHours(
		-BlogSettings.Instance.Timezone) > lastModified) 
		
		lastModified = item.DateModified.AddHours(
		-BlogSettings.Instance.Timezone); 
} 

Now, how do you apply this update? 

  1. Download the 1.4.5 source code.
  2. Open up the Visual Studio Solution (pretty basic and easy to do)
  3. Open the SyndicationHandler.cs, which is located at this path: DotNetSlave.BusinessLogic\Web\HttpHandlers\
  4. Scroll down to line 273 and paste the 2nd code example from above (i.e. replace lines 273-278)
  5. Rebuild the solution
  6. Copy the BlogEngine.Core.dll from the BlogEngine.Web\Bin\ directory to the bin directory on your website
  7. All finished

If you don't want to go through all the trouble above, here an updated dll (243 kb)*.  Heck, if you don't trust me, the fix was applied at 15487, so just download any of the checked in code past that and you will be fine.

*Disclaimer: Please be assured that the above is correct to the best of my knowledge.  I am using the same dll for this website that I have posted above.  If the above steps or dll crashes your server or loss of data, I am not held responsible or liable for any issues that might arise.