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

SQL Client: Unable to load DLL 'sni.dll' #4953

Closed
mrmeek opened this issue Mar 31, 2016 · 3 comments
Closed

SQL Client: Unable to load DLL 'sni.dll' #4953

mrmeek opened this issue Mar 31, 2016 · 3 comments
Assignees
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@mrmeek
Copy link

mrmeek commented Mar 31, 2016

Downloaded latest CLI build (beta-2175), created new project with dotnet new, added aspnetcidev myget feed to nuget.config, added AspNetCore, MVCCore, and EFCore dependencies, created context and model for existing database, SQL Server query fails with:

dbug: Microsoft.EntityFrameworkCore.Query.Internal.SqlServerQueryCompilationContextFactory[5]
TRACKED: True
(QueryContext queryContext) => IEnumerable _ShapedQuery(
queryContext: queryContext,
shaperCommandContext: SelectExpression:
SELECT [p].[Id], [p].[Name]
FROM [Products] AS [p]
,
shaper: UnbufferedEntityShaper
)

dbug: Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerConnection[3]
Opening connection to database 'ProductsDb' on server 'localhost\SQLEXPRESS'.
fail: Microsoft.EntityFrameworkCore.Query.Internal.SqlServerQueryCompilationContextFactory[1]
An exception occurred in the database while iterating the results of a query.
System.DllNotFoundException: Unable to load DLL 'sni.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at System.Data.SqlClient.SNINativeMethodWrapper.UnmanagedIsTokenRestricted(IntPtr token, Boolean& isRestricted)

Easiest way to see this in action is to download the cli-samples (https://github.com/aspnet/cli-samples), using HelloMvcApi add "Microsoft.EntityFrameworkCore.SqlServer": "1.0.0-rc2-*" to project.json dependencies, query anything with a context.

Apologies if this is a dupe of known issue in #3925, thought it was worth mentioning because it's occurring again, but, this time on any EF+SqlServer server connections- no tools/ef-commands here.

Also, I understand the churn in these repos. Let me know if there's no need to report such mundane/obvious issues right after changes in the core/cli nightlies.

@mrmeek
Copy link
Author

mrmeek commented Apr 1, 2016

After looking further I see this is not an issue with EF. Targeting System.Data.SqlClient directly and opening a connection throws the same exception ala dotnet/corefx#5252 and the issue probably belongs there

@rowanmiller rowanmiller changed the title EntityFrameworkCore: Unable to load DLL 'sni.dll' SQL Client: Unable to load DLL 'sni.dll' Apr 5, 2016
@rowanmiller rowanmiller added this to the 1.0.0 milestone Apr 5, 2016
@rowanmiller
Copy link
Contributor

Keeping this open to track the issue from the EF side, but opened https://github.com/dotnet/corefx/issues/7518 for SQL Client to fix the issue.

@natemcmaster
Copy link
Contributor

This has been fixed in CLI. I verified sqlclient works with cli-samples + sql server on win7 and win10.

dotnet --info
.NET Command Line Tools (1.0.0-rc2-002351)

Product Information:
 Version:     1.0.0-rc2-002351
 Commit Sha:  0128033afd

Runtime Environment:
 OS Name:     Windows
 OS Version:  6.1.7601
 OS Platform: Windows
 RID:         win7-x64

@ajcvickers ajcvickers modified the milestones: 1.0.0-rc2, 1.0.0 Oct 15, 2022
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants