DefinIT

Force BlogEngine.Net to update its cache after an import

| 09/05/2008 | Tags:

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.