[Mono-dev] Ug

Jonathan Pryor jonpryor at vt.edu
Fri May 1 22:04:20 EDT 2009

On Fri, 2009-05-01 at 18:00 -0400, Miguel de Icaza wrote:
> > mono-devel-list context: Scott found a bug in sqlmetal today, in that it
> > wouldn't connect to a MySQL database.  The problem was that
> > sqlmetal.exe.config is used to specify which connection type to use for
> > a given /provider option, and the MySQL entry was referencing an invalid
> > assembly.
> Is it possible to load the types dynamically, so that at least if the
> end-user installs MySql.Data on his own, it will work?

The types are always loaded dynamically -- the fully qualified type
names are listed within the sqlmetal.exe.config file.

So it's a question of which kind of error message is preferable.  If the
entry isn't present within sqlmetal.exe.config, then `sqlmetal
-provider:MySQL ...' will generate the error message "Failed to load
provider MySQL...", while if the entry is present but the assembly isn't
found, they'll get an error message similar to "Could not load type
"MySql.Data.MySqlConnection, MySql.Data".

Either way it doesn't work, so it's likely just a matter of which error
is "better."

The latter would more easily allow the end-user to install MySql.Data
and have things Just Work, though, which is an argument toward that.

 - Jon

More information about the Mono-devel-list mailing list