Error while saving settings.

Topics: ASP.NET 2.0
Jun 11, 2011 at 11:05 AM

Hi,

Installed a fresh BlogEngine.Net 2.0 w/ SQL Server 2008. When I change settings and try to save it.... I'm getting this error...

Could not save settings: Violation of PRIMARY KEY constraint 'PK_be_Settings'. Cannot insert duplicate key in object 'dbo.be_Settings'. The statement has been terminated.

Can anyone please explain this?

Coordinator
Jun 11, 2011 at 6:37 PM

This is BE 2.0, and not one of the recent developer builds from the Source Code tab?  There was a recent report of this in the Issue Tracker, but he is using a recent developer build.

I would try restarting the application by making any change to the web.config file and then try saving settings again.  You could also check the be_Settings table to see if there are any duplicate values ... which there probably is not since duplicate values are not allowed in that table with the primary key ... the same reason you are seeing this error message.

Jun 12, 2011 at 12:16 AM

You can find what 'setting name' is causing the key violation by debugging through        

public override void SaveSettings(StringDictionary settings) of DbBlogProvicer.cs

When you know, you'll probably have a clue.

Jul 4, 2012 at 7:52 AM

I am Having a similar issue on blogEngine version number 2.5, when I try to create my own theme to the site I get an error message about duplicate keys in the DB.

when I open the DB, I find the the be_settings table grow from 96 values, which is normal, to 141 values.