当使用。net 4.5连接到SQL Server Azure时发生握手异常

时间:2022-07-03 01:54:00

So I opened up some code that hasn't been touched in about 2 months.

所以我打开了一些2个月未被触及的代码。

Last time I opened the application all unit tests passed. Now with no code changes all my data unit tests fail with the following error:

上次打开应用程序时,所有单元测试都通过了。现在,由于没有代码更改,我所有的数据单元测试都以以下错误失败:

Initialization method PerTrac.Pictor.Data.Test.RequestLogRepositoryShould.CreateLog threw exception. System.Data.EntityException: System.Data.EntityException: The underlying provider failed on Open. ---> System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the pre-login handshake. (provider: SSL Provider, error: 0 - The wait operation timed out.) ---> System.ComponentModel.Win32Exception: The wait operation timed out.

PerTrac.Pictor.Data.Test.RequestLogRepositoryShould初始化方法。CreateLog抛异常。System.Data。EntityException:System.Data。EntityException:底层提供者在打开时失败。推荐- - - - - - > System.Data.SqlClient。SqlException:与服务器成功建立连接,但在登录前握手时发生错误。(提供程序:SSL提供程序,错误:0 -等待操作超时)---> System.ComponentModel。异常:等待操作超时。

I realize there is an existing question similar to this, but those solutions had no effect what so ever on my situation.

我意识到存在一个类似的问题,但这些解决方案对我的情况没有任何影响。

Has anyone experienced this error with entity framework and SQL Azure specifically ?

有谁在实体框架和SQL Azure中遇到过这种错误吗?

I should note that I can connect from SSMS with no issue using them same credentials. I don't have Force Encryption set on disabled protocols and I have reset my local IIS several times.

我应该注意到,我可以使用相同的凭证从SSMS连接,没有问题。我没有在禁用协议上设置强制加密,而且我已经多次重设本地IIS。

11 个解决方案

#1


17  

Most likely you have some application installed on your computer that is using deprecated network protocols to intercept network traffic. The correct solution is hopefully to disable or uninstall those applications.

很可能您的计算机上安装了一些应用程序,这些应用程序正在使用废弃的网络协议来拦截网络通信。正确的解决方案是禁用或卸载这些应用程序。

Run the command line command netsh WinSock Show Catalog >> winsock.txt and then notepad winsock.txt to open the file.

运行命令行命令netsh WinSock显示目录>> WinSock。然后是记事本winsock。txt打开文件。

Look at every Winsock Catalog Provider Entry returned. If the Service Flags value has the 0x20000 bit set then the provider uses IFS handles and will work fine. If the “Service Flags” 0x20000 bit is clear (not set), then it is a non-IFS BSP or LSP and could be an issue. Try disabling this application and let us know if it then worked.

看一下返回的每个Winsock目录提供者条目。如果服务标记值设置了0x20000位,那么提供程序将使用IFS句柄并正常工作。如果“服务标志”0x20000比特是透明的(未设置),那么它是一个非ifs BSP或LSP,可能是一个问题。尝试禁用这个应用程序,并让我们知道它是否工作。

Ignore the “Name Space Provider Entry” when you are looking at the text file results. They aren't the problem.

在查看文本文件结果时忽略“名称空间提供程序条目”。他们不是问题。

Below is a sample of what my clean system looks like for the output of the netsh WinSock Show Catalog file.

下面是我的clean系统输出netsh WinSock Show Catalog文件的示例。

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [TCP/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1001
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x20066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [UDP/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1002
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [RAW/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1003
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        3
Protocol:                           0
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [TCP/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1004
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x20066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [UDP/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1005
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [RAW/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1006
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        3
Protocol:                           0
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        RSVP TCPv6 Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1007
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x22066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        RSVP TCP Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1008
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x22066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        RSVP UDPv6 Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1009
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x22609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        RSVP UDP Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1010
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x22609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [TCP/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1001
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x20066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [UDP/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1002
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [RAW/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1003
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        3
Protocol:                           0
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [TCP/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1004
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x20066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [UDP/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1005
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [RAW/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1006
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        3
Protocol:                           0
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        RSVP TCPv6 Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1007
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x22066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        RSVP TCP Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1008
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x22066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        RSVP UDPv6 Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1009
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x22609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        RSVP UDP Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1010
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x22609
Protocol Chain Length:              1

Name Space Provider Entry
------------------------------------------------------
Description:                        Network Location Awareness Legacy (NLAv1) Namespace
Provider ID:                        {6642243A-3BA8-4AA6-BAA5-2E0BD71FDD83}
Name Space:                         15
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        E-mail Naming Shim Provider
Provider ID:                        {964ACBA2-B2BC-40EB-8C6A-A6DB40161CAE}
Name Space:                         37
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        PNRP Cloud Namespace Provider
Provider ID:                        {03FE89CE-766D-4976-B9C1-BB9BC42C7B4D}
Name Space:                         39
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        PNRP Name Namespace Provider
Provider ID:                        {03FE89CD-766D-4976-B9C1-BB9BC42C7B4D}
Name Space:                         38
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        Tcpip
Provider ID:                        {22059D40-7E9E-11CF-AE5A-00AA00A7112B}
Name Space:                         12
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        NTDS
Provider ID:                        {3B2637EE-E580-11CF-A555-00C04FD8D4AC}
Name Space:                         32
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        WindowsLive NSP
Provider ID:                        {4177DDE9-6028-479E-B7B7-03591A63FF3A}
Name Space:                         12
Active:                             1
Version:                            1


Name Space Provider Entry
------------------------------------------------------
Description:                        WindowsLive Local NSP
Provider ID:                        {229F2A2C-5F18-4A06-8F89-3A372170624D}
Name Space:                         19
Active:                             1
Version:                            1


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        Network Location Awareness Legacy (NLAv1) Namespace
Provider ID:                        {6642243A-3BA8-4AA6-BAA5-2E0BD71FDD83}
Name Space:                         15
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        E-mail Naming Shim Provider
Provider ID:                        {964ACBA2-B2BC-40EB-8C6A-A6DB40161CAE}
Name Space:                         37
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        PNRP Cloud Namespace Provider
Provider ID:                        {03FE89CE-766D-4976-B9C1-BB9BC42C7B4D}
Name Space:                         39
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        PNRP Name Namespace Provider
Provider ID:                        {03FE89CD-766D-4976-B9C1-BB9BC42C7B4D}
Name Space:                         38
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        Tcpip
Provider ID:                        {22059D40-7E9E-11CF-AE5A-00AA00A7112B}
Name Space:                         12
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        NTDS
Provider ID:                        {3B2637EE-E580-11CF-A555-00C04FD8D4AC}
Name Space:                         32
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        WindowsLive NSP
Provider ID:                        {4177DDE9-6028-479E-B7B7-03591A63FF3A}
Name Space:                         12
Active:                             1
Version:                            1


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        WindowsLive Local NSP
Provider ID:                        {229F2A2C-5F18-4A06-8F89-3A372170624D}
Name Space:                         19
Active:                             1
Version:                            1

#2


5  

The key to understand the problem here is the provider and in your case it is "SSL Provider" and the main problem is that connection time out. If problem was related with "TCP Provider" there could be several reasons related with network etc however in your case it is a security related issue within the connection framework.

理解这里问题的关键是提供程序,在您的示例中是“SSL提供程序”,主要问题是连接超时。如果问题与“TCP提供者”相关,那么可能有几个与网络相关的原因,但是在您的情况下,这是连接框架内的一个安全相关问题。

Next step to investigate this problem is that on the same machine, you can connect from SSMS to same SQL Database however not from IIS which means the IIS application process is not able to get proper certificate to create the SSL tunnel to create the successful connection. It is possible that you have some log written System Event log so please check there.

研究这个问题的下一步是,在同一台机器上,您可以从SSMS连接到相同的SQL数据库,但是不可以从IIS连接,这意味着IIS应用程序进程无法获得适当的证书来创建SSL隧道来创建成功的连接。您可能有一些写日志的系统事件日志,请在这里检查。

Because you are using Entity Framework and depend on EF version there are some changed in the connection string so verify if that is what you have:

因为你使用的是实体框架依赖于EF版本连接字符串中有一些变化所以验证一下你是否有:

<add name="MyDatabaseModelEntities" connectionString="metadata=res://*/MyDBModel.csdl|res://*/MyDatabaseModel.ssdl|res://*/MyDatabaseModel.msl;provider=System.Data.SqlClient;provider connection string="data source=abcdefg123.database.windows.net;initial catalog=MyDatabase;persist security info=True;user id=MyDatabaseUser@abcdefg123;password=p@$$w0rd;multipleactiveresultsets=True;Trusted_Connection=False;Encrypt=True;App=EntityFramework"" providerName="System.Data.EntityClient" /> 

Finally if you are using EF 4.3.1 and connecting to SQL Database please have a look at this article and check if you have similar configuration.

最后,如果您正在使用EF 4.3.1并连接到SQL数据库,请查看本文并检查是否有类似的配置。

#3


1  

This issue is reported in microsoft connect site here. Solution is availabel here. You need to remove non-IFS LSP installed Winsock Catalog Provider. Sometimes some software already installed on you machine may cause issue. In order to remove non-IFS LSP first run the following command on command prompt to see the application causing issue (ref)

此问题在这里的microsoft connect站点中进行了报道。这里多种解决方案。您需要删除非ifs LSP安装的Winsock目录提供程序。有时已经安装在您的机器上的某些软件可能会引起问题。为了删除非ifs LSP,首先在命令提示符上运行以下命令,查看导致问题的应用程序(ref)

netsh winsock show catalog > LSP.txt

see the output and analyze the application causing issue and uninstall it. hopefully it will resolve the issue.

查看输出并分析导致问题的应用程序并卸载它。希望它能解决这个问题。

#4


1  

In my case, after trying to repair my VS2012RC couple of times and no luck I chanced upon this link, one of the comments is to do with a third party s/w called 'sendori'. I uninstalled it and all is back to normal in my world.

在我的例子中,在我试图修复我的VS2012RC几次之后,我无意中发现了这个链接,其中一条评论是关于第三方的s/w,叫做“sendori”。我卸载了它,一切都回到了正常的世界。

#5


1  

Just another tip: SQL server could be out of memory. I had this error and when I checked SQL server computer, the SQL service was using 15G of memory, out of 16 total. So restart the service to fix.

还有一个提示:SQL server可能内存不足。我有这个错误,当我检查SQL server计算机时,SQL服务使用了15G内存,总共16个。所以重启服务来修复。

#6


0  

The problem ended up being vs11 beta.

问题最终变成了vs11 beta。

If you have this problem you need to do the following :

如果你有这个问题,你需要做以下的事情:

1) Uninstall vs11 beta and .NET 4.5 beta

1)卸载vs11测试版和。net 4.5测试版。

2) re-install .NET 4.0

2)安装。net 4.0

Watch everything work again !

再看一遍!

#7


0  

I had same issue with SSMS 2012 but all worked fine on SSMS 2008 on the same box connecting to the same remote server.

我在2012年的SSMS上也遇到了同样的问题,但在2008年的SSMS上,所有的问题都在同一个服务器上运行。

Moca.io Proxy was causing trouble for me. Uninstalled and all working fine now. ("remove non-IFS LSP")

美国华人博物馆。io代理给我带来了麻烦。卸载,现在一切正常。(“删除non-IFS LSP”)

#8


0  

had same problem. In my case uninstalling T-Mobile Web 'n Walk Manager solved problem. Its software for making mobile connection to internet via sim card Josip

有同样的问题。在我的例子中,卸载T-Mobile Web 'n Walk Manager解决了问题。它的软件通过sim卡Josip连接到互联网

#9


0  

I had this exact error. Solved by setting server not to XXXXXXXXX but to the full domain name XXXXXXXX.YYY.com

我犯了这个错误。通过将服务器设置为xxxxxxx而不是XXXXXXXXX . yyyyy.com来解决

Then a message appeared saying encryption was not supported connect without.

然后出现了一条消息,说不支持加密连接。

When I did everything worked.

当我做的时候,一切都成功了。

#10


0  

If you are using dot "." or partial name of server (without domain name) for data source, please try with actual SQL Server instance name with complete server name.

如果您正在使用点“.”或服务器的部分名称(没有域名)作为数据源,请尝试使用具有完整服务器名称的实际SQL server实例名称。

#11


0  

Error:

错误:

Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=11977; handshake=5138;

连接超时过期。在尝试使用预登录握手时超时时间失败,或者服务器无法及时响应。尝试连接此服务器的持续时间为-[预登录]初始化=11977;握手= 5138;

Resolution:

解决方法:

This issue can be resolved by modifying the connection string to set the parameter TransparentNetworkIPResolution to false.

可以通过修改连接字符串将参数设置为false来解决这个问题。

Example:

例子:

Server=myServerName;Database=myDataBase;Trusted_Connection=True; 
TransparentNetworkIPResolution = False

When we set it to false in the connection string, it will not timeout at 500ms and the connection succeed.

当我们在连接字符串中将它设置为false时,它在500ms时不会超时,连接成功。

https://blogs.msdn.microsoft.com/dataaccesstechnologies/2016/05/07/connection-timeout-issue-with-net-framework-4-6-1-transparentnetworkipresolution/

https://blogs.msdn.microsoft.com/dataaccesstechnologies/2016/05/07/connection-timeout-issue-with-net-framework-4-6-1-transparentnetworkipresolution/

#1


17  

Most likely you have some application installed on your computer that is using deprecated network protocols to intercept network traffic. The correct solution is hopefully to disable or uninstall those applications.

很可能您的计算机上安装了一些应用程序,这些应用程序正在使用废弃的网络协议来拦截网络通信。正确的解决方案是禁用或卸载这些应用程序。

Run the command line command netsh WinSock Show Catalog >> winsock.txt and then notepad winsock.txt to open the file.

运行命令行命令netsh WinSock显示目录>> WinSock。然后是记事本winsock。txt打开文件。

Look at every Winsock Catalog Provider Entry returned. If the Service Flags value has the 0x20000 bit set then the provider uses IFS handles and will work fine. If the “Service Flags” 0x20000 bit is clear (not set), then it is a non-IFS BSP or LSP and could be an issue. Try disabling this application and let us know if it then worked.

看一下返回的每个Winsock目录提供者条目。如果服务标记值设置了0x20000位,那么提供程序将使用IFS句柄并正常工作。如果“服务标志”0x20000比特是透明的(未设置),那么它是一个非ifs BSP或LSP,可能是一个问题。尝试禁用这个应用程序,并让我们知道它是否工作。

Ignore the “Name Space Provider Entry” when you are looking at the text file results. They aren't the problem.

在查看文本文件结果时忽略“名称空间提供程序条目”。他们不是问题。

Below is a sample of what my clean system looks like for the output of the netsh WinSock Show Catalog file.

下面是我的clean系统输出netsh WinSock Show Catalog文件的示例。

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [TCP/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1001
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x20066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [UDP/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1002
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [RAW/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1003
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        3
Protocol:                           0
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [TCP/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1004
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x20066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [UDP/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1005
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        MSAFD Tcpip [RAW/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1006
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        3
Protocol:                           0
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        RSVP TCPv6 Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1007
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x22066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        RSVP TCP Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1008
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x22066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        RSVP UDPv6 Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1009
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x22609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider
Description:                        RSVP UDP Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1010
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x22609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [TCP/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1001
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x20066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [UDP/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1002
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [RAW/IP]
Provider ID:                        {E70F1AA0-AB8B-11CF-8CA3-00805F48A192}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1003
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        3
Protocol:                           0
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [TCP/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1004
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x20066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [UDP/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1005
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        MSAFD Tcpip [RAW/IPv6]
Provider ID:                        {F9EAB0C0-26D4-11D0-BBBF-00AA006C34E4}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1006
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        3
Protocol:                           0
Service Flags:                      0x20609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        RSVP TCPv6 Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1007
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x22066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        RSVP TCP Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1008
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        1
Protocol:                           6
Service Flags:                      0x22066
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        RSVP UDPv6 Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1009
Version:                            2
Address Family:                     23
Max Address Length:                 28
Min Address Length:                 28
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x22609
Protocol Chain Length:              1

Winsock Catalog Provider Entry
------------------------------------------------------
Entry Type:                         Base Service Provider (32)
Description:                        RSVP UDP Service Provider
Provider ID:                        {9D60A9E0-337A-11D0-BD88-0000C082E69A}
Provider Path:                      %SystemRoot%\system32\mswsock.dll
Catalog Entry ID:                   1010
Version:                            2
Address Family:                     2
Max Address Length:                 16
Min Address Length:                 16
Socket Type:                        2
Protocol:                           17
Service Flags:                      0x22609
Protocol Chain Length:              1

Name Space Provider Entry
------------------------------------------------------
Description:                        Network Location Awareness Legacy (NLAv1) Namespace
Provider ID:                        {6642243A-3BA8-4AA6-BAA5-2E0BD71FDD83}
Name Space:                         15
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        E-mail Naming Shim Provider
Provider ID:                        {964ACBA2-B2BC-40EB-8C6A-A6DB40161CAE}
Name Space:                         37
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        PNRP Cloud Namespace Provider
Provider ID:                        {03FE89CE-766D-4976-B9C1-BB9BC42C7B4D}
Name Space:                         39
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        PNRP Name Namespace Provider
Provider ID:                        {03FE89CD-766D-4976-B9C1-BB9BC42C7B4D}
Name Space:                         38
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        Tcpip
Provider ID:                        {22059D40-7E9E-11CF-AE5A-00AA00A7112B}
Name Space:                         12
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        NTDS
Provider ID:                        {3B2637EE-E580-11CF-A555-00C04FD8D4AC}
Name Space:                         32
Active:                             1
Version:                            0


Name Space Provider Entry
------------------------------------------------------
Description:                        WindowsLive NSP
Provider ID:                        {4177DDE9-6028-479E-B7B7-03591A63FF3A}
Name Space:                         12
Active:                             1
Version:                            1


Name Space Provider Entry
------------------------------------------------------
Description:                        WindowsLive Local NSP
Provider ID:                        {229F2A2C-5F18-4A06-8F89-3A372170624D}
Name Space:                         19
Active:                             1
Version:                            1


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        Network Location Awareness Legacy (NLAv1) Namespace
Provider ID:                        {6642243A-3BA8-4AA6-BAA5-2E0BD71FDD83}
Name Space:                         15
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        E-mail Naming Shim Provider
Provider ID:                        {964ACBA2-B2BC-40EB-8C6A-A6DB40161CAE}
Name Space:                         37
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        PNRP Cloud Namespace Provider
Provider ID:                        {03FE89CE-766D-4976-B9C1-BB9BC42C7B4D}
Name Space:                         39
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        PNRP Name Namespace Provider
Provider ID:                        {03FE89CD-766D-4976-B9C1-BB9BC42C7B4D}
Name Space:                         38
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        Tcpip
Provider ID:                        {22059D40-7E9E-11CF-AE5A-00AA00A7112B}
Name Space:                         12
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        NTDS
Provider ID:                        {3B2637EE-E580-11CF-A555-00C04FD8D4AC}
Name Space:                         32
Active:                             1
Version:                            0


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        WindowsLive NSP
Provider ID:                        {4177DDE9-6028-479E-B7B7-03591A63FF3A}
Name Space:                         12
Active:                             1
Version:                            1


Name Space Provider Entry (32)
------------------------------------------------------
Description:                        WindowsLive Local NSP
Provider ID:                        {229F2A2C-5F18-4A06-8F89-3A372170624D}
Name Space:                         19
Active:                             1
Version:                            1

#2


5  

The key to understand the problem here is the provider and in your case it is "SSL Provider" and the main problem is that connection time out. If problem was related with "TCP Provider" there could be several reasons related with network etc however in your case it is a security related issue within the connection framework.

理解这里问题的关键是提供程序,在您的示例中是“SSL提供程序”,主要问题是连接超时。如果问题与“TCP提供者”相关,那么可能有几个与网络相关的原因,但是在您的情况下,这是连接框架内的一个安全相关问题。

Next step to investigate this problem is that on the same machine, you can connect from SSMS to same SQL Database however not from IIS which means the IIS application process is not able to get proper certificate to create the SSL tunnel to create the successful connection. It is possible that you have some log written System Event log so please check there.

研究这个问题的下一步是,在同一台机器上,您可以从SSMS连接到相同的SQL数据库,但是不可以从IIS连接,这意味着IIS应用程序进程无法获得适当的证书来创建SSL隧道来创建成功的连接。您可能有一些写日志的系统事件日志,请在这里检查。

Because you are using Entity Framework and depend on EF version there are some changed in the connection string so verify if that is what you have:

因为你使用的是实体框架依赖于EF版本连接字符串中有一些变化所以验证一下你是否有:

<add name="MyDatabaseModelEntities" connectionString="metadata=res://*/MyDBModel.csdl|res://*/MyDatabaseModel.ssdl|res://*/MyDatabaseModel.msl;provider=System.Data.SqlClient;provider connection string="data source=abcdefg123.database.windows.net;initial catalog=MyDatabase;persist security info=True;user id=MyDatabaseUser@abcdefg123;password=p@$$w0rd;multipleactiveresultsets=True;Trusted_Connection=False;Encrypt=True;App=EntityFramework"" providerName="System.Data.EntityClient" /> 

Finally if you are using EF 4.3.1 and connecting to SQL Database please have a look at this article and check if you have similar configuration.

最后,如果您正在使用EF 4.3.1并连接到SQL数据库,请查看本文并检查是否有类似的配置。

#3


1  

This issue is reported in microsoft connect site here. Solution is availabel here. You need to remove non-IFS LSP installed Winsock Catalog Provider. Sometimes some software already installed on you machine may cause issue. In order to remove non-IFS LSP first run the following command on command prompt to see the application causing issue (ref)

此问题在这里的microsoft connect站点中进行了报道。这里多种解决方案。您需要删除非ifs LSP安装的Winsock目录提供程序。有时已经安装在您的机器上的某些软件可能会引起问题。为了删除非ifs LSP,首先在命令提示符上运行以下命令,查看导致问题的应用程序(ref)

netsh winsock show catalog > LSP.txt

see the output and analyze the application causing issue and uninstall it. hopefully it will resolve the issue.

查看输出并分析导致问题的应用程序并卸载它。希望它能解决这个问题。

#4


1  

In my case, after trying to repair my VS2012RC couple of times and no luck I chanced upon this link, one of the comments is to do with a third party s/w called 'sendori'. I uninstalled it and all is back to normal in my world.

在我的例子中,在我试图修复我的VS2012RC几次之后,我无意中发现了这个链接,其中一条评论是关于第三方的s/w,叫做“sendori”。我卸载了它,一切都回到了正常的世界。

#5


1  

Just another tip: SQL server could be out of memory. I had this error and when I checked SQL server computer, the SQL service was using 15G of memory, out of 16 total. So restart the service to fix.

还有一个提示:SQL server可能内存不足。我有这个错误,当我检查SQL server计算机时,SQL服务使用了15G内存,总共16个。所以重启服务来修复。

#6


0  

The problem ended up being vs11 beta.

问题最终变成了vs11 beta。

If you have this problem you need to do the following :

如果你有这个问题,你需要做以下的事情:

1) Uninstall vs11 beta and .NET 4.5 beta

1)卸载vs11测试版和。net 4.5测试版。

2) re-install .NET 4.0

2)安装。net 4.0

Watch everything work again !

再看一遍!

#7


0  

I had same issue with SSMS 2012 but all worked fine on SSMS 2008 on the same box connecting to the same remote server.

我在2012年的SSMS上也遇到了同样的问题,但在2008年的SSMS上,所有的问题都在同一个服务器上运行。

Moca.io Proxy was causing trouble for me. Uninstalled and all working fine now. ("remove non-IFS LSP")

美国华人博物馆。io代理给我带来了麻烦。卸载,现在一切正常。(“删除non-IFS LSP”)

#8


0  

had same problem. In my case uninstalling T-Mobile Web 'n Walk Manager solved problem. Its software for making mobile connection to internet via sim card Josip

有同样的问题。在我的例子中,卸载T-Mobile Web 'n Walk Manager解决了问题。它的软件通过sim卡Josip连接到互联网

#9


0  

I had this exact error. Solved by setting server not to XXXXXXXXX but to the full domain name XXXXXXXX.YYY.com

我犯了这个错误。通过将服务器设置为xxxxxxx而不是XXXXXXXXX . yyyyy.com来解决

Then a message appeared saying encryption was not supported connect without.

然后出现了一条消息,说不支持加密连接。

When I did everything worked.

当我做的时候,一切都成功了。

#10


0  

If you are using dot "." or partial name of server (without domain name) for data source, please try with actual SQL Server instance name with complete server name.

如果您正在使用点“.”或服务器的部分名称(没有域名)作为数据源,请尝试使用具有完整服务器名称的实际SQL server实例名称。

#11


0  

Error:

错误:

Connection Timeout Expired. The timeout period elapsed while attempting to consume the pre-login handshake failed or the server was unable to respond back in time. The duration spent while attempting to connect to this server was - [Pre-Login] initialization=11977; handshake=5138;

连接超时过期。在尝试使用预登录握手时超时时间失败,或者服务器无法及时响应。尝试连接此服务器的持续时间为-[预登录]初始化=11977;握手= 5138;

Resolution:

解决方法:

This issue can be resolved by modifying the connection string to set the parameter TransparentNetworkIPResolution to false.

可以通过修改连接字符串将参数设置为false来解决这个问题。

Example:

例子:

Server=myServerName;Database=myDataBase;Trusted_Connection=True; 
TransparentNetworkIPResolution = False

When we set it to false in the connection string, it will not timeout at 500ms and the connection succeed.

当我们在连接字符串中将它设置为false时,它在500ms时不会超时,连接成功。

https://blogs.msdn.microsoft.com/dataaccesstechnologies/2016/05/07/connection-timeout-issue-with-net-framework-4-6-1-transparentnetworkipresolution/

https://blogs.msdn.microsoft.com/dataaccesstechnologies/2016/05/07/connection-timeout-issue-with-net-framework-4-6-1-transparentnetworkipresolution/