首页 > 解决方案 > ASP.NET CORE 中“TransparentNetworkIPResolution”的替代方法是什么

问题描述

我在 SQL 连接字符串中的 ASP.NET MVC 中使用了“ TransparentNetworkIPResolution ”这个关键字。我的代码如下

<add name="LocalString" connectionString="Data Source=Server;Initial Catalog=LocalDBName;User ID=User;Password=****;TransparentNetworkIPResolution=false" providerName="System.Data.SqlClient" />

这给了我一个错误 ASP.NET CORE 错误消息"Keyword doesn't support"

那么任何人都可以帮我解决这个问题吗?

标签: asp.net-coreasp.net-core-mvcasp.net-core-2.0asp.net-core-webapiasp.net-core-2.1

解决方案


专注于新的 SqlClient 功能改进正在移动到新的 Microsoft.Data.SqlClient 包

请参阅https://github.com/dotnet/SqlClient/issues/99

SqlClient 包的 Github 存储库是:https ://github.com/dotnet/SqlClient

为了反映 API 的当前状态,以下是 .NET Framework 中 System.Data.SqlClient 中存在的类、枚举和成员的列表,而 .NET Core 的 Microsoft.Data.SqlClient 版本中缺少这些类、枚举和成员:

Class SqlDataSourceEnumerator       
Class SqlAuthenticationInitializer      
Class SqlAuthenticationParameters       
Class SqlAuthenticationProvider     
Class SqlAuthenticationToken        
Class SqlClientLogger       
Class SQLDebugging       
Enum    SqlAuthenticationMethod 

Property    SqlBulkCopyOptions  AllowEncryptedValueModifications    
Property    SqlCommand  NotificationAutoEnlist  
Property    SqlConnectionStringBuilder  AsynchronousProcessing  
Property    SqlConnectionStringBuilder  Authentication  
Property    SqlConnectionStringBuilder  NetworkLibrary  
Property    SqlConnectionStringBuilder  TransparentNetworkIPResolution  
Property    SqlParameterCollection  IsSynchonized

推荐阅读