This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
[Posted on behalf of a customer] I have finally gotten all our code converted over to work with Lightspeed, and am starting to try running my code in my integration tests. The problem I have run into at the moment is that when I try to create a database connection for some direct SQL code (have not gotten to any of the ORM stuff yet), I get an exception saying that it is unable to load the MySQL.Data.dll library, version 6.3.6. I have 6.3.7 installed on my system, and I have scoured my code and I cannot find anything anywhere in config files that might reference that specific version of MySQL. Do you have any idea what would cause this? Is Lightspeed looking for a specific version of MySQL? Or is something else not set up right such that the ADO.NET database provider factory is looking for the wrong version of MySQL for some reason? |
|
|
LightSpeed is built against MySQL 3.6. You can either reference the MySQL DLL included with LightSpeed in the Providers directory (which will always be the version against which LightSpeed was built), or set up an assembly binding redirect to tell the CLR that when LightSpeed asks for 3.6 it should load 3.7 anyway. The former option is easiest unless you need anything specific to 3.7; if you do need 3.7, then see http://msdn.microsoft.com/en-us/library/eftw1fys.aspx for info about setting up a binding redirect. |
|
|
Ok thanks. So that means I need to ensure the MySQL.Data.dll library you compile against is included with our applications. I will do that for now, but I was under the impression that if you use the ADO.NET DbProviderFactory stuff it will dynamically load the current MySQL.Data.dll library that is installed in the GAC and will use that, and then you don't need to deploy a specific version alongside your application? Personally I would much prefer that this DLL is not directly linked against, because it is GPL licensed and you could argue that if it is directly linked against it will infect your code (and my code) with the GPL licensing clause. Going through the DB provider API's means that it is easier to make the argument that the DB provider can be changed easily, so the GPL should not infect across the boundary. I suppose you could argue the same thing that Lightspeed is DB independent so MySQL can be easily replaced also, but it just feels dirty to me to directly link to any GPL code in my commercial projects :) Finally, can I request that this is documented on this page: http://www.mindscapehq.com/documentation/lightspeed/Working-with-Database-Providers/MySQL |
|