Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
swaggerloaf opened this issue Feb 25, 2015 · 4 comments
Closed

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

swaggerloaf opened this issue Feb 25, 2015 · 4 comments

Comments

@swaggerloaf
Copy link

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>
@bricelam
Copy link
Contributor

What version/architecture of Windows are you running?

@swaggerloaf
Copy link
Author

Win 7 SP1 x64 Ultimate
SQL Server Express 2014 CU6

@swaggerloaf
Copy link
Author

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.

@divega
Copy link
Contributor

divega commented Feb 25, 2015

Win 7 SP1 x64 Ultimate

Most likely a duplicate of #1545 then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants