I have a winform app with some isolated modules that access remote MySQL tables.
I want to test for its presence and signal the user that those modules can't be used on the workstation, if the user tries to access one of them and the MySQL.Data.dll is not installed on the workstation running it.
As it stands now, the app just crashes if that happens,
I could probably use try.. catch, but I wanted something more elegant.
So, after searching the web for ideas, I wrote this test program:
static void Main(string[] args)
{
MySqlConnection conn = new MySqlConnection("server=myurluserid=hillary;password=clinton;");
AppDomain currentDomain = AppDomain.CurrentDomain;
Assembly[] assems = currentDomain.GetAssemblies();
Console.WriteLine("List of assemblies loaded in current appdomain:");
foreach (Assembly assem in assems)
{
Console.WriteLine( System.IO.Path.GetDirectoryName(assem.Location));
}
}
The results show the MySQL.Data.dll as residing in the GAC_MSIL folder- not the programsX86, etc folder where it really resides.
I get the idea that GAC_MSIL is an artifact pointing at the "real" file, etc., but here's my question:
If I find it in GAC_MSIL, can I be sure that it's in "real" folder and that the app will be OK?
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.