efcore icon indicating copy to clipboard operation
efcore copied to clipboard

Unable to load DLL 'sni.dll' on migration apply

Open swaggerloaf opened this issue 11 years ago • 4 comments

Possible version mismatch ?

EF 7 release 7.0.0-beta4-12364 runtime: 1.0.0-beta4-11138 clr x86

c:\projects\2015\NeoSample-ASPNET5-master\src\NeoSample>k --version
1.0.0-beta4-11138

c:\projects\2015\NeoSample-ASPNET5-master\src\NeoSample>k ef --version
7.0.0-beta4-12364

c:\projects\2015\NeoSample-ASPNET5-master\src\NeoSample>k ef migration apply  CreateIdentitySchema  -c ApplicationDbContext
Using context 'ApplicationDbContext'.
System.DllNotFoundException: Unable to load DLL 'sni.dll': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)
   at System.Data.SqlClient.SNINativeMethodWrapper.UnmanagedIsTokenRestricted(IntPtr token, Boolean& isRestricted)
   at System.Data.Win32NativeMethods.IsTokenRestrictedWrapper(IntPtr token)
   at System.Data.ProviderBase.DbConnectionPoolIdentity.GetCurrent()
   at System.Data.ProviderBase.DbConnectionPoolGroup.GetConnectionPool(DbConnectionFactory connectionFactory)
   at System.Data.ProviderBase.DbConnectionFactory.GetConnectionPool(DbConnection owningObject, DbConnectionPoolGroup connectionPoolGroup)
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectio
nOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFa
ctory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, Tas
kCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at Microsoft.Data.Entity.Relational.RelationalConnection.Open()
   at Microsoft.Data.Entity.SqlServer.SqlServerDataStoreCreator.Exists(Boolean retryOnNotExists)
   at Microsoft.Data.Entity.SqlServer.SqlServerDataStoreCreator.Exists()
   at Microsoft.Data.Entity.SqlServer.Migrations.SqlServerHistoryRepository.Exists()
   at Microsoft.Data.Entity.SqlServer.Migrations.SqlServerHistoryRepository.GetAppliedMigrations()
   at Microsoft.Data.Entity.Relational.Migrations.Migrator.ApplyMigrations(String targetMigration)
   at Microsoft.Data.Entity.Commands.MigrationTool.ApplyMigration(String migrationName, String contextTypeName)
   at Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass11_0.b__0()
   at Microsoft.Data.Entity.Commands.Program.ExecuteInDirectory(String startupProject, Func`1 invoke)
   at Microsoft.Data.Entity.Commands.Program.ApplyMigration(String migration, String context, String startupProject)
   at Microsoft.Data.Entity.Commands.Program.<>c__DisplayClass8_2.
b__8() at Microsoft.Framework.Runtime.Common.CommandLine.CommandLineApplication.Execute(String[] args) at Microsoft.Data.Entity.Commands.Program.Main(String[] args) c:\projects\2015\NeoSample-ASPNET5-master\src\NeoSample>

swaggerloaf avatar Feb 25 '15 14:02 swaggerloaf

What version/architecture of Windows are you running?

bricelam avatar Feb 25 '15 16:02 bricelam

Win 7 SP1 x64 Ultimate SQL Server Express 2014 CU6

swaggerloaf avatar Feb 25 '15 18:02 swaggerloaf

SQL Server Express 2014 is x64 I switched to x64 runtime,

  • 1.0.0-beta4-11138 clr x64 C:\Users\Glenn.k\runtimes default

and was able to connect to database , error is cleared. Should be able to close this issue. Good catch.

swaggerloaf avatar Feb 25 '15 18:02 swaggerloaf

Win 7 SP1 x64 Ultimate

Most likely a duplicate of #1545 then.

divega avatar Feb 25 '15 18:02 divega