Skip to main content

Force BlogEngine.Net to update its cache after an import

·105 words·1 min
 Author
Author
Sam McGeown
Steely-eyed missile man
Warning: This article is now 18 years old! It is highly likely that this information is out of date and the author will have completely forgotten about it. Please take care when following any guidance to ensure you have up-to-date recommendations.

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.