Failed to update database "XXX.MDF" because the database is read-only
This error occurres when the database folder and the containing files don't have the necessary rights set.
To solve this issue do the following:
- Make sure App_Data directory or any contained files does not have file system attribute Read-only set.
- Give user ASPNET and NETWORK SERVICE Modify control over the App_Data directory.
- Run IISRESET to restart IIS to refresh its permissions.