Installation problem: “The given key was not present in the dictionary.”

Topics: Developer Forum
May 17, 2008 at 4:03 PM

I am trying to install the new release (version 1.3.5) using the installer guide (/edit/install).
I am stuck at step 2. The connection string and the database dialect are configured.
Every time I test the connection I keep getting the following result:

"Connection problem, hopefully this error message can help you figure out what's wrong:
The given key was not present in the dictionary."

Has anyone got an idea as to what this error means?

It would be great if it would be possible to download a N2 project without any sample code and database.
The problem is that the web.config file in all the downloads contains settings that assume that the database is configured.
What should be removed in web.config if I want to make a new setup with e.g. a MySql database?

May 17, 2008 at 5:38 PM
Hi Carsten. It seems nhibernate 2.0 changed a dictionary type which causes the error. Thanks for bringing this up. I just committed a fix.

To use MySQL you should add a connection string:

<add name="MySql" connectionString="Data Source=MySqlServer;Database=MySqlDatabase;User Id=MySqlUser;Password=MySqlPassword;" providerName="MySql.Data.MySqlClient"/>

And change the dialect:

          <entry key="connection.driver_class">NHibernate.Driver.MySqlDataDriver</entry>
          <entry key="dialect">NHibernate.Dialect.MySQL5Dialect</entry>

May 17, 2008 at 5:55 PM
Oh, you can continue and install the database and ignore the connection tab.
May 17, 2008 at 7:19 PM
Hi libardo

Thank you for the quick reply!
After ignoring step 2, the installation succeeded ;)