Problem:

Hosted a BlogEngine.NET on Windows Server 2008 [R2] / Windows 8 IIS server (7.5 or higher), and used SQLite as Blog’s database. When navigate to the blog, an error clames “Attempt to write a read-only database”.

Attempt to write a read-only database

Solution:

1. Make sure the account IIS_IUSRS has the permission to modify the database file (usually the database file is under ~/App_Data and its named called BlogEngine.s3db).

Solved: Attempt to write a read-only database

2. Do the same for the containing folder of that database file (~/App_Data).

3. Make sure the “Application pool identity” is checked in the Anonymous user identity panel of your web site. To check that setting, press Win + Run, type “inetmgr” and hit Enter key, in the Internet Information Services (IIS) Manager, choose your web site, click “Authentication” icon, then the following panel appears.

Solved: Attempt to write a read-only database

4. Restart your web site or just press Win + Run, type “iisreset” and hit Enter key.

5. Revisit the blog, the error should be gone.