I am trying to open an SQL Connection (Azure DB) in a server build standalone Windows (in Editor works fine) and I get this error (after including the I18N dlls).
I am using Unity 2019.3.13f1.
The code is:
using (var sqlConnection = new SqlConnection(",,,"))
{
using (var sqlCommand = new SqlCommand())
{
sqlCommand.Connection = sqlConnection;
sqlCommand.CommandText = $"...";
try
{
sqlConnection.Open();
}
catch (Exception ex)
{
Debug.LogException(ex);
return false;
}
}
}
Any ideas?
InvalidProgramException: Invalid IL code in I18N.Common.Manager:get_PrimaryManager (): IL_0000: ret
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke(System.Reflection.MonoMethod,object,object[ ],System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) [0x00032] in <437ba245d8404784b9fbab9b439ac908>:0
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) [0x00048] in <437ba245d8404784b9fbab9b439ac908>:0
at System.RuntimeType.InvokeMember (System.String name, System.Reflection.BindingFlags bindingFlags, System.Reflection.Binder binder, System.Object target, System.Object[ ] providedArgs, System.Reflection.ParameterModifier[ ] modifiers, System.Globalization.CultureInfo culture, System.String[ ] namedParams) [0x00680] in <437ba245d8404784b9fbab9b439ac908>:0
at System.Text.EncodingHelper.InvokeI18N (System.String name, System.Object[ ] args) [0x0009a] in <437ba245d8404784b9fbab9b439ac908>:0
at System.Text.Encoding.GetEncoding (System.Int32 codepage) [0x0020d] in <437ba245d8404784b9fbab9b439ac908>:0
at System.Data.SqlClient.TdsParser.TryProcessEnvChange (System.Int32 tokenLength, System.Data.SqlClient.TdsParserStateObject stateObj, System.Data.SqlClient.SqlEnvChange[ ]& sqlEnvChange) [0x00246] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.TdsParser.TryRun (System.Data.SqlClient.RunBehavior runBehavior, System.Data.SqlClient.SqlCommand cmdHandler, System.Data.SqlClient.SqlDataReader dataStream, System.Data.SqlClient.BulkCopySimpleResultSet bulkCopyHandler, System.Data.SqlClient.TdsParserStateObject stateObj, System.Boolean& dataReady) [0x004f4] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.TdsParser.Run (System.Data.SqlClient.RunBehavior runBehavior, System.Data.SqlClient.SqlCommand cmdHandler, System.Data.SqlClient.SqlDataReader dataStream, System.Data.SqlClient.BulkCopySimpleResultSet bulkCopyHandler, System.Data.SqlClient.TdsParserStateObject stateObj) [0x00010] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin (System.Boolean enlistOK) [0x00000] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin (System.Data.SqlClient.ServerInfo serverInfo, System.Boolean ignoreSniOpenTimeout, System.Data.ProviderBase.TimeoutTimer timeout, System.Boolean withFailover) [0x000a4] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover (System.Data.SqlClient.ServerInfo serverInfo, System.Boolean redirectedUserInstance, System.Data.SqlClient.SqlConnectionString connectionOptions, System.Data.ProviderBase.TimeoutTimer timeout) [0x000bc] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist (System.Data.ProviderBase.TimeoutTimer timeout, System.Data.SqlClient.SqlConnectionString connectionOptions, System.Boolean redirectedUserInstance) [0x000ad] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.SqlInternalConnectionTds…ctor (System.Data.ProviderBase.DbConnectionPoolIdentity identity, System.Data.SqlClient.SqlConnectionString connectionOptions, System.Object providerInfo, System.Boolean redirectedUserInstance, System.Data.SqlClient.SqlConnectionString userConnectionOptions, System.Data.SqlClient.SessionData reconnectSessionData, System.Boolean applyTransientFaultHandling) [0x00122] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection (System.Data.Common.DbConnectionOptions options, System.Data.Common.DbConnectionPoolKey poolKey, System.Object poolGroupProviderInfo, System.Data.ProviderBase.DbConnectionPool pool, System.Data.Common.DbConnection owningConnection, System.Data.Common.DbConnectionOptions userOptions) [0x0012a] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection (System.Data.ProviderBase.DbConnectionPool pool, System.Data.Common.DbConnection owningObject, System.Data.Common.DbConnectionOptions options, System.Data.Common.DbConnectionPoolKey poolKey, System.Data.Common.DbConnectionOptions userOptions) [0x0000c] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.ProviderBase.DbConnectionPool.CreateObject (System.Data.Common.DbConnection owningObject, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal oldConnection) [0x00184] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest (System.Data.Common.DbConnection owningObject, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal oldConnection) [0x00040] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection (System.Data.Common.DbConnection owningObject, System.UInt32 waitForMultipleObjectsTimeout, System.Boolean allowCreate, System.Boolean onlyOneCheckConnection, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal& connection) [0x000a4] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection (System.Data.Common.DbConnection owningObject, System.Threading.Tasks.TaskCompletionSource1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal& connection) [0x00026] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection (System.Data.Common.DbConnection owningConnection, System.Threading.Tasks.TaskCompletionSource
1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions, System.Data.ProviderBase.DbConnectionInternal oldConnection, System.Data.ProviderBase.DbConnectionInternal& connection) [0x0021d] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal (System.Data.Common.DbConnection outerConnection, System.Data.ProviderBase.DbConnectionFactory connectionFactory, System.Threading.Tasks.TaskCompletionSource1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions) [0x00036] in <290425a50ff84a639f8c060e2d4530f6>:0 at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection (System.Data.Common.DbConnection outerConnection, System.Data.ProviderBase.DbConnectionFactory connectionFactory, System.Threading.Tasks.TaskCompletionSource
1[TResult] retry, System.Data.Common.DbConnectionOptions userOptions) [0x00000] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.SqlConnection.TryOpen (System.Threading.Tasks.TaskCompletionSource`1[TResult] retry) [0x0005d] in <290425a50ff84a639f8c060e2d4530f6>:0
at System.Data.SqlClient.SqlConnection.Open () [0x0003b] in <290425a50ff84a639f8c060e2d4530f6>:0