Force BlogEngine.Net to update its cache after an import

Written by Sam McGeown
Published on 9/5/2008 - Read in about 1 min (105 words)

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)
</div>
  1. Add the following to the Page_Load function:

    BlogEngine.Core.Post.Reload();

</div>
  1. Save and upload default.aspx.cs, refresh your blog.

</div>

Et voila, posts will appear. Phew.

Share this post