On editor it works fine, but when I build or build and run I get this exception and it fails to establish a connection to MySQL server
Platform assembly: D:\Build 9\game_Data\Managed\System.Configuration.dll (this message is harmless)
TypeLoadException: Could not load type 'System.Configuration.Internal.ConfigurationManagerInternal, System.Configuration, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
at (wrapper managed-to-native) System.Type:internal_from_name (string,bool,bool)
at System.Type.GetType (System.String typeName, Boolean throwOnError) [0x00011] in /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Type.cs:471
at System.Configuration.TypeUtil.CreateInstanceWithReflectionPermission (System.String typeString) [0x00000] in <filename unknown>:0
at System.Configuration.ConfigurationManagerInternalFactory.get_Instance () [0x00000] in <filename unknown>:0
at System.Diagnostics.DiagnosticsConfiguration.Initialize () [0x00000] in <filename unknown>:0
at System.Diagnostics.DiagnosticsConfiguration.get_Sources () [0x00000] in <filename unknown>:0
at System.Diagnostics.TraceSource.Initialize () [0x00000] in <filename unknown>:0
at System.Diagnostics.TraceSource.get_Listeners () [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.MySqlTrace..cctor () [0x00000] in <filename unknown>:0
Rethrow as TypeInitializationException: An exception was thrown by the type initializer for MySql.Data.MySqlClient.MySqlTrace
at MySql.Data.MySqlClient.Driver.Create (MySql.Data.MySqlClient.MySqlConnectionStringBuilder settings) [0x00000] in <filename unknown>:0
(Filename: /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/Type.cs Line: 471)
And the error when I try to use the MySQL connection that should be open by now
InvalidOperationException: Connection must be valid and open.
at MySql.Data.MySqlClient.ExceptionInterceptor.Throw (System.Exception exception) [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.MySqlConnection.Throw (System.Exception ex) [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) MySql.Data.MySqlClient.MySqlConnection:Throw (System.Exception)
at MySql.Data.MySqlClient.MySqlCommand.Throw (System.Exception ex) [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.MySqlCommand.CheckState () [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader (CommandBehavior behavior) [0x00000] in <filename unknown>:0
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) MySql.Data.MySqlClient.MySqlCommand:ExecuteReader ()
at MySQL.checkUser (System.String user, System.String password, System.Int32& userID) [0x00018] in C:\Users\Chapi\Documents\Survival Game\Assets\Scripts\MySQL.cs:61
at networkingScript.logIn (System.String user, System.String password) [0x00002] in C:\Users\Chapi\Documents\Survival Game\Assets\Scripts
etworkingScript.cs:20
at mainMenu.ConnectWindow (Int32 windowID) [0x00099] in C:\Users\Chapi\Documents\Survival Game\Assets\Scripts\mainMenu.cs:92
at UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID) [0x00076] in C:\BuildAgent\work\aeedb04a1292f85a\artifacts\StandalonePlayerGenerated\GUILayout.cs:413
at UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) [0x0005c] in C:\BuildAgent\work\aeedb04a1292f85a\artifacts\StandalonePlayerGenerated\GUI.cs:1402
(Filename: C Line: 0)
Any clue of whats causing this and how to fix it?