Force BlogEngine.Net to update its cache after an import

9. May 2008

Well my first real post on BlogEngine.Net is...about BlogEngine.Net!

After running the import program from my old DotNetNuke blog I found that the importer had worked, but that the blog entries had not shown up. This was because the cache that BE.Net uses for the XML data files. Since I'm on a shared hosting I couldn't just run an IISReset.exe, so I obviously needed a work around, and here it is:

  1.  Open default.aspx.cs in Visual Studio (or just a text editor)
  2. Add the following to the Page_Load function:

    BlogEngine.Core.Post.Reload();

  3. Save and upload default.aspx.cs, refresh your blog.

Et voila, posts will appear. Phew.

BlogEngine.NET

Comments

Vince R
Vince R
6/27/2008 7:11:26 PM #
thanks much.  this came in handy.
Si
Si
7/7/2008 9:02:53 PM #
Awesome, I've been looking for a solution for a LONG time.
7/14/2008 4:35:51 PM #
My pleasure - it was a bit of a head scratcher for a while!
wild
wild
2/16/2009 9:49:21 PM #
Thanks. Had same issue. BE 1.4.5.
7/27/2009 3:38:31 AM #
Thanks for the post... was baffled about why new categories were showing up on import, but not the posts themselves!
Comments are closed