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

sni.dll cannot be loaded on downlevel #1545

Closed
victorhurdugaci opened this issue Feb 4, 2015 · 11 comments
Closed

sni.dll cannot be loaded on downlevel #1545

victorhurdugaci opened this issue Feb 4, 2015 · 11 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

@victorhurdugaci
Copy link

This happens on Win7 and Win2008 R2. We are seeing it during the cross plat CI runs:

  1. http://projectk-tc/viewLog.html?buildId=89200&tab=buildLog&buildTypeId=XPlat_Windows7&logTab=tree#_focus=673
  2. http://projectk-tc/viewLog.html?buildId=89046&tab=buildResultsDiv&buildTypeId=XPlat_Windows7

The error is the same all the time:

System.DllNotFoundException : Unable to load DLL 'sni.dll': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)

You can repro by using the MusicStore tests with KRE 1.0.0-beta3-11014 and EF 7.0.0-beta3-12128,or by building EF from the release branch and using the same KRE.

Later edit: it happens with the bits in the dev branch too.

@victorhurdugaci victorhurdugaci changed the title There seems to be a mismatch between the versions of sni.dll on the release branch sni.dll cannot be loaded on downlevel Feb 6, 2015
@victorhurdugaci
Copy link
Author

Investigation results:

sni.dll has some native dependencies that aren’t present on win 7:
API-MS-WIN-CORE-INTERLOCKED-L1-2-0.DLL
API-MS-WIN-CORE-NAMEDPIPE-L1-2-0.DLL
API-MS-WIN-SECURITY-BASE-L1-2-0.DLL

The CoreCLR drop that is packaged with XRE does have the L1-1-0 versions of these.

@rowanmiller
Copy link
Contributor

Interesting that this person reported that swapping to x64 runtime resolved the issue #1701

@swaggerloaf
Copy link

I got this error when using x64 Windows 7, x64 SQL Server 2014 Express, when I ran on x86 CLR.
I switched to x64 CLR and the error went away.
Maybe same issue?

@swaggerloaf
Copy link

I was able to reproduce error.
Doesn't seem to be related to x86 / x64 CLR
But I used x86 CoreCLR and got the error

Active Version           Runtime Architecture Location                   Alias
------ -------           ------- ------------ --------                   -----
       1.0.0-beta3       clr     x64          C:\Users\Glenn\.k\runtimes
       1.0.0-beta3       clr     x86          C:\Users\Glenn\.k\runtimes
       1.0.0-beta3       coreclr x64          C:\Users\Glenn\.k\runtimes
       1.0.0-beta3       coreclr x86          C:\Users\Glenn\.k\runtimes
       1.0.0-beta4-11138 clr     x86          C:\Users\Glenn\.k\runtimes
  *    1.0.0-beta4-11138 coreclr x86          C:\Users\Glenn\.k\runtimes default

I first used 1.0.0-beta4-11138 clr x86 and that worked fine.
then installed 1.0.0-beta4-11138 coreclr x86 and got the sni dll error on apply migration

I have Windows 7 SP1 x64, SQL Server 2014 Express x64 with CU6 applied
When the coreclr got installs I see a few suspect messages during native image compile shown below but the runtime seems to work
I would look at something related with CoreCLR anyway.

Failed to load type token 690029c5 for the profile data in [C:\Users\Glenn\.k\runtimes\kre-coreclr-win-x86.1.0.0-beta4-11138\bin\Microsoft.C
odeAnalysis.CSharp.dll] The type specified by the IBC data is no longer present in the assembly's metadata.  The type was [Microsoft.CodeAna
lysis]Microsoft.CodeAnalysis.ArrayBuilder`1+<>c__DisplayClass0.
Failed to load type token 69000bac for the profile data in [C:\Users\Glenn\.k\runtimes\kre-coreclr-win-x86.1.0.0-beta4-11138\bin\Microsoft.C
odeAnalysis.CSharp.dll] The type specified by the IBC data is no longer present in the assembly's metadata.  The type was [Microsoft.CodeAna
lysis]Microsoft.CodeAnalysis.CachingIdentityFactory`2+<>c__DisplayClass0.
Failed to load type token 69001e5e for the profile data in [C:\Users\Glenn\.k\runtimes\kre-coreclr-win-x86.1.0.0-beta4-11138\bin\Microsoft.C
odeAnalysis.CSharp.dll] The type specified by the IBC data is no longer present in the assembly's metadata.  The type was [Microsoft.CodeAna
lysis]Microsoft.CodeAnalysis.ArrayBuilder`1+<>c__DisplayClass0.
Failed to load type token 69002056 for the profile data in [C:\Users\Glenn\.k\runtimes\kre-coreclr-win-x86.1.0.0-beta4-11138\bin\Microsoft.C
odeAnalysis.CSharp.dll] The type specified by the IBC data is no longer present in the assembly's metadata.  The type was [Microsoft.CodeAna
lysis]Microsoft.CodeAnalysis.ArrayBuilder`1+<>c__DisplayClass0.
Failed to load type token 690021e8 for the profile data in [C:\Users\Glenn\.k\runtimes\kre-coreclr-win-x86.1.0.0-beta4-11138\bin\Microsoft.C
odeAnalysis.CSharp.dll] The type specified by the IBC data is no longer present in the assembly's metadata.  The type was [Microsoft.CodeAna
lysis]Microsoft.CodeAnalysis.ArrayBuilder`1+<>c__DisplayClass0.
Failed to load type token 69002490 for the profile data in [C:\Users\Glenn\.k\runtimes\kre-coreclr-win-x86.1.0.0-beta4-11138\bin\Microsoft.C
odeAnalysis.CSharp.dll] The type specified by the IBC data is no longer present in the assembly's metadata.  The type was [Microsoft.CodeAna
lysis]Microsoft.CodeAnalysis.ArrayBuilder`1+<>c__DisplayClass0.
Failed to load type token 690024fe for the profile data in [C:\Users\Glenn\.k\runtimes\kre-coreclr-win-x86.1.0.0-beta4-11138\bin\Microsoft.C
odeAnalysis.CSharp.dll] The type specified by the IBC data is no longer present in the assembly's metadata.  The type was [Microsoft.CodeAna
lysis]Microsoft.CodeAnalysis.Collections.PooledDictionary`2+<>c__DisplayClass0.

@swaggerloaf
Copy link

tested on x64 coreclr with same error as on x86 coreclr
so CLR works (x86 and x64) but coreclr does not

c:\projects\2015\NeoSample-ASPNET5-master\src\NeoSample>kvm list
Active Version           Runtime Architecture Location                   Alias
------ -------           ------- ------------ --------                   -----
       1.0.0-beta3       clr     x64          C:\Users\Glenn\.k\runtimes
       1.0.0-beta3       clr     x86          C:\Users\Glenn\.k\runtimes
       1.0.0-beta3       coreclr x64          C:\Users\Glenn\.k\runtimes
       1.0.0-beta3       coreclr x86          C:\Users\Glenn\.k\runtimes
  *    1.0.0-beta4-11138 coreclr x64          C:\Users\Glenn\.k\runtimes default
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 HRESUL
   at System.Data.SqlClient.SNINativeMethodWrapper.UnmanagedIsTokenRestricted(IntPtr token, Boolean& isRestricted)
   at System.Data.Win32NativeMethods.IsTokenRestrictedWrapper(IntPtr token)

@divega
Copy link
Contributor

divega commented Mar 21, 2015

@victorhurdugaci has confirmed that this started working correctly in recent builds.

@ostelaymetaule
Copy link

I can reproduce this on RC (Windows 7, sql 2008R2)

An exception of type 'System.DllNotFoundException' occurred in EntityFramework.Core.dll but was not handled in user code

Additional information: Unable to load DLL 'C:\Users\elgin.dnx\packages\System.Data.SqlClient.sni- x86\4.0.0-beta-23019\runtimes\win7-x86\native\sni.dll'

Package.json:

{
"version": "1.0.0-*",
"description": "ImportAllerWithdrawsInDB Console Application",
"authors": [ "elgin" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",

"compilationOptions": {
"emitEntryPoint": true
},

"dependencies": {
"EntityFramework.Core": "7.0.0-rc1-final",
"EntityFramework.MicrosoftSqlServer": "7.0.0-rc1-final",
"System.Data.SqlClient": "4.0.0-beta-23516",
"System.Data.SqlClient.sni-x86": "4.0.0-beta-23019"
},

"commands": {
"ImportAllerWithdrawsInDB": "ImportAllerWithdrawsInDB"
},

"frameworks": {

"dnxcore50": {
  "dependencies": {
    "Microsoft.CSharp": "4.0.1-beta-23516",
    "System.Collections": "4.0.11-beta-23516",
    "System.Console": "4.0.0-beta-23516",
    "System.Linq": "4.0.1-beta-23516",
    "System.Threading": "4.0.11-beta-23516"


  }
}

}
}

@rowanmiller
Copy link
Contributor

@ostelaymetaule this is a known issue in RC1 where SQL Client depends on Visual C++ Redistributable for Visual Studio 2012. They are working the resolve the issue. We have #3787 tracking the issue on the EF side.

@dontbesorry80
Copy link

I am trying to deploy a website using the coreclr-x64-rc1-update1 on Windows Server 2008 R2.

I've installed both x86 and x64 versions of the Visual C++ Redist for Visual Studio 2012, 2013 & 2015 and I still seem to get the error.

Is there anything else I need to do to get this working?

@juswes
Copy link

juswes commented Dec 29, 2015

@dontbesorry80 Indeed, same issue here.
coreclr-x64-rc1-update1 on Windows Server 2008 R2 with Microsoft Visual C++ 2012 Redistributable installed and the issue persists.

@rowanmiller
Do you know of any other workarounds or solutions available yet?

@rowanmiller
Copy link
Contributor

@dontbesorry80 @juswes - We have seen some more reports of this occurring on RC1 (beyond the original issues that we fixed - such as this one). Here is the issue we are tracking now #4162. No workaround as yet, but we'll keep that thread updated as we investigate (we're catching up on a backlog of issue reports after folks were out for the holidays).

@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
@ajcvickers ajcvickers modified the milestones: 1.0.0-beta6, 1.0.0 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

8 participants