This is not a standard nullreferenceexception question because there are no objects instantiated that this initialization relies on, only namespaces
I've been racking my brain for a couple of days on this one. The code works on another developer's machine (who is no longer here), so I have installed MySQL and imported the configuration, but I keep coming back to this exception. MySqlDB.MySQL
is a namespace and MySQL()
is just a method stub from the metadata.
The DLL is MySqlDB.dll, which lives with the project.
I have confirmed the executable by itself doesn't work on my machine either, so I know it is an environmental issue. Here's the list of other things I've tried (the application also has a dependency on SQL Server).
- install SQL Server Express
- uninstall SQL Server Express
- install SQL Server
- install Excel 2016 version for mysql plugin for Excel that was missing
- moved executable from developer's machine to attempt running outside of Visual Studio - confirmed environmental issue
- checked .NET version
- Remove and Add MySQL DLL
- Reinstall MySQL
- Copied MySQL DLLs from GAC on developer's machine
- Export and Import MySQL DB Configuration
var mySql = new MySqlDB.MySql.MySql();
at MySqlDB.MySql.MySql.c909228df886bcca197ed06f91ce6af71() at MySqlDB.MySql.MySql..ctor() at BCS_UI.App.Register() in c:\GitCode\Windows_UI_Beta\UI\UI\App.xaml.cs:line 47 at BCS_UI.App.Application_Startup(Object sender, StartupEventArgs e) in c:\GitCode\Windows_UI_Beta\UI\UI\App.xaml.cs:line 23 at System.Windows.Application.OnStartup(StartupEventArgs e) at System.Windows.Application.<.ctor>b__1_0(Object unused) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)