Я использую sql server на Mac с помощью docker, и он общается с моим основным приложением .net. Я запускаю тесты specflow, которые подключаются к указанной базе данных, создают необходимую схему и затем запускают тесты. Я получаю следующее исключение, когда запускаю эти тесты на Mac, но он отлично работает на Windows-машинеВ ядре .net отсутствуют какие-либо библиотеки?
Моя строка подключения выглядит следующим образом: public static string ConnectionString = @ "Server = localhost: 1433; База данных = csn_product; Пользователь = sa; Пароль = ****; ";
MultipleActiveResultSets = true; Trusted_Connection=False; Integrated_Security=False
Я также пробовал вышеуказанные параметры в строке подключения, но ничего не получалось.
Microsoft.SqlServer.Management.Common.ConnectionFailureException: Failed to connect to server MyServer. ---> System.Data.SqlClient.SqlException: Unable to find an entry point named 'NetSecurityNative_ImportPrincipalName' in shared library 'System.Net.Security.Native'.
at Interop.NetSecurityNative.ImportPrincipalName(Status& minorStatus, String inputName, Int32 inputNameByteCount, SafeGssNameHandle& outputName)
at Microsoft.Win32.SafeHandles.SafeGssNameHandle.CreatePrincipal(String name)
at System.Net.Security.SafeDeleteNegoContext..ctor(SafeFreeNegoCredentials credential, String targetName)
at System.Net.Security.NegotiateStreamPal.EstablishSecurityContext(SafeFreeNegoCredentials credential, SafeDeleteContext& context, String targetName, ContextFlagsPal inFlags, SecurityBuffer inputBuffer, SecurityBuffer outputBuffer, ContextFlagsPal& outFlags)
at System.Net.Security.NegotiateStreamPal.InitializeSecurityContext(SafeFreeCredentials credentialsHandle, SafeDeleteContext& securityContext, String spn, ContextFlagsPal requestedContextFlags, SecurityBuffer[] inSecurityBufferArray, SecurityBuffer outSecurityBuffer, ContextFlagsPal& contextFlags)
at System.Data.SqlClient.SNI.SNIProxy.GenSspiClientContext(SspiClientContextStatus sspiClientContextStatus, Byte[] receivedBuff, Byte[]& sendBuff, Byte[] serverName)
at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.GenerateSspiClientContext(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength, Byte[] _sniSpnBuffer)
at System.Data.SqlClient.TdsParser.SNISSPIData(Byte[] receivedBuff, UInt32 receivedLength, Byte[]& sendBuff, UInt32& sendLength)
at at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at at System.Data.SqlClient.SqlConnection.Open()
at at Microsoft.SqlServer.Management.Common.ConnectionManager.InternalConnect()
at at Microsoft.SqlServer.Management.Common.ConnectionManager.Connect()