• <legend id='tLRcU'><style id='tLRcU'><dir id='tLRcU'><q id='tLRcU'></q></dir></style></legend>
    • <bdo id='tLRcU'></bdo><ul id='tLRcU'></ul>

    <small id='tLRcU'></small><noframes id='tLRcU'>

  • <tfoot id='tLRcU'></tfoot>

        <i id='tLRcU'><tr id='tLRcU'><dt id='tLRcU'><q id='tLRcU'><span id='tLRcU'><b id='tLRcU'><form id='tLRcU'><ins id='tLRcU'></ins><ul id='tLRcU'></ul><sub id='tLRcU'></sub></form><legend id='tLRcU'></legend><bdo id='tLRcU'><pre id='tLRcU'><center id='tLRcU'></center></pre></bdo></b><th id='tLRcU'></th></span></q></dt></tr></i><div id='tLRcU'><tfoot id='tLRcU'></tfoot><dl id='tLRcU'><fieldset id='tLRcU'></fieldset></dl></div>
      1. 无法加载 DLL 'sni.dll' - 实体框架核心

        时间:2023-05-22
            <tbody id='sJWP8'></tbody>

          <small id='sJWP8'></small><noframes id='sJWP8'>

              <tfoot id='sJWP8'></tfoot>
              <legend id='sJWP8'><style id='sJWP8'><dir id='sJWP8'><q id='sJWP8'></q></dir></style></legend>
            1. <i id='sJWP8'><tr id='sJWP8'><dt id='sJWP8'><q id='sJWP8'><span id='sJWP8'><b id='sJWP8'><form id='sJWP8'><ins id='sJWP8'></ins><ul id='sJWP8'></ul><sub id='sJWP8'></sub></form><legend id='sJWP8'></legend><bdo id='sJWP8'><pre id='sJWP8'><center id='sJWP8'></center></pre></bdo></b><th id='sJWP8'></th></span></q></dt></tr></i><div id='sJWP8'><tfoot id='sJWP8'></tfoot><dl id='sJWP8'><fieldset id='sJWP8'></fieldset></dl></div>

                <bdo id='sJWP8'></bdo><ul id='sJWP8'></ul>
                  本文介绍了无法加载 DLL 'sni.dll' - 实体框架核心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  在 Visual Studio 2017 上的 ASP.Net Core 应用程序中使用 Entity Framework Core 时,我间歇性地收到错误无法加载 'sni.dll'.

                  When using Entity Framework Core in an ASP.Net Core application on Visual Studio 2017 I intermittently get the error "Unable to load 'sni.dll'.

                  奇怪的是,我找到了一个临时解决方法:重新启动我的电脑.

                  Strangely though I have found a temporary fix: restarting my PC.

                  我不知道为什么错误不断发生,我不知道变量可能是什么.任何人都可以阐明可能的原因吗?我会提供完整的堆栈跟踪,但自从决定在这里发帖以来就没有发生过,下次发生时我一定会更新它.我肯定知道(因为调试捕获异常)当 EF 有理由从数据库获取数据并转换为实体时会发生这种情况.

                  I don't know why the error keeps happening, I don't know what the variable could be. Could anyone shed light on the possible cause? I would offer a full stack trace but it hasn't happened since deciding to post on here, when it next happens I'll be sure to update this. I know for certain though (as the debug catches the exception) that it happens when EF has cause to get data from the db and transform to entities.

                  提前感谢您的任何建议.

                  Thanks in advance for any suggestions.

                  --编辑这仍在发生.设法记住捕获堆栈跟踪:

                  --EDIT This is still happening. Managed to remember to capture the stack trace:

                  发生 System.DllNotFoundExceptionH结果=0x80131524消息=无法加载 DLL 'sni.dll':指定的网络名称不再可用.(来自 HRESULT 的异常:0x80070040)来源=堆栈跟踪:在 System.Data.SqlClient.SNINativeMethodWrapper.UnmanagedIsTokenRestricted(IntPtr 令牌,布尔和 isRestricted)在 System.Data.Win32NativeMethods.IsTokenRestrictedWrapper(IntPtr 令牌)在 System.Data.ProviderBase.DbConnectionPoolIdentity.GetCurrent()在 System.Data.ProviderBase.DbConnectionPoolGroup.GetConnectionPool(DbConnectionFactory 连接工厂)在 System.Data.ProviderBase.DbConnectionFactory.GetConnectionPool(DbConnection owningObject,DbConnectionPoolGroup connectionPoolGroup)在 System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection,TaskCompletionSource1 重试,DbConnectionOptions userOptions,DbConnectionInternal oldConnection,DbConnectionInternal& 连接)在 System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 重试, DbConnectionOptions userOptions)在 System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 重试)在 System.Data.SqlClient.SqlConnection.Open()在 Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open()在 Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(布尔缓冲区)在 Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](Func2 操作,Func2 verifySucceeded,TState 状态)在 Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_ShapedQuery>d__31.MoveNext()在 Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_Include>d__301.MoveNext()在 System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 源)在 Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass20_01.<CompileQueryCore>b__0(QueryContext qc)在 System.Linq.Queryable.FirstOrDefault[TSource](IQueryable1 源)

                  System.DllNotFoundException occurred HResult=0x80131524 Message=Unable to load DLL 'sni.dll': The specified network name is no longer available. (Exception from HRESULT: 0x80070040) Source= StackTrace: 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, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry) at System.Data.SqlClient.SqlConnection.Open() at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open() at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable.Enumerator.BufferlessMoveNext(Boolean buffer) at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.Execute[TState,TResult](Func2 operation, Func2 verifySucceeded, TState state) at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_ShapedQuery>d__31.MoveNext() at Microsoft.EntityFrameworkCore.Query.QueryMethodProvider.<_Include>d__301.MoveNext() at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable1 source) at Microsoft.EntityFrameworkCore.Query.Internal.QueryCompiler.<>c__DisplayClass20_01.<CompileQueryCore>b__0(QueryContext qc) at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable1 source)

                  推荐答案

                  添加 nuget 包 System.Data.SqlClient v4.4.0 为我解决了同样的问题.该问题并非特定于实体框架.这是由于旧版本的 SqlClient 依赖于 dotnet Core 2 中不可用的 API.

                  Adding nuget package System.Data.SqlClient v4.4.0 solved the same problem for me. The problem is not specific to Entity Framework. It is caused by older version of SqlClient dependency on APIs not available in dotnet Core 2.

                  这篇关于无法加载 DLL 'sni.dll' - 实体框架核心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Console.WriteLine("");卡住 下一篇:为什么我不能在具有 System.Net.Http 参考的解决方案中使用 System.Net.Http 包?

                  相关文章

                    <bdo id='CrhRS'></bdo><ul id='CrhRS'></ul>

                    <tfoot id='CrhRS'></tfoot>

                    <i id='CrhRS'><tr id='CrhRS'><dt id='CrhRS'><q id='CrhRS'><span id='CrhRS'><b id='CrhRS'><form id='CrhRS'><ins id='CrhRS'></ins><ul id='CrhRS'></ul><sub id='CrhRS'></sub></form><legend id='CrhRS'></legend><bdo id='CrhRS'><pre id='CrhRS'><center id='CrhRS'></center></pre></bdo></b><th id='CrhRS'></th></span></q></dt></tr></i><div id='CrhRS'><tfoot id='CrhRS'></tfoot><dl id='CrhRS'><fieldset id='CrhRS'></fieldset></dl></div>
                    <legend id='CrhRS'><style id='CrhRS'><dir id='CrhRS'><q id='CrhRS'></q></dir></style></legend>

                    1. <small id='CrhRS'></small><noframes id='CrhRS'>