Heya, I'm currently trying to get bltoolkit working in my project. I've added the BLToolkit.3 project to my solution and am referencing it appropriately.
The code in question is really simple.
public List<Account> LoadAccounts()
{
using (DbManager db = new DbManager("MySql"))
{
var query = new SqlQuery<Account>();
return query.SelectAll(db);
}
}
With an app.config of
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<section name="bltoolkit" type="BLToolkit.Configuration.BLToolkitSection, BLToolkit.3"/>
</configSections>
<bltoolkit>
<dataProviders>
<add type="BLToolkit.Data.DataProvider.MySqlDataProvider" />
</dataProviders>
</bltoolkit>
<connectionStrings>
<add name="MySql" connectionString="Server=localhost;Port=3306;Database=BLT;Uid=root;" providerName="MySql.Data.MySqlClient"/>
</connectionStrings>
</configuration>
When I try to run that, I get the following exception: "The type initializer for 'BLToolkit.Data.DbManager' threw an exception."
Upon closer inspection it seems to be line 261 in DbManager.Config.cs
Type dataProviderType = Type.GetType(provider.TypeName, true);
Which basically fails to get the MySQL providers type. I've tried putting the MySQL.data.dll in my applications run path, with no luck.
Any ideas?