_From @asiergonzalezgorordo on June 7, 2018 14:16_
There is a missing method when targeting UWP Windows10, version 1803

Exception message:
Method not found: 'Boolean System.String.Contains(Char)'.
Stack trace:
at System.Data.SqlClient.SNI.DataSource.InferNamedPipesInformation()
at System.Data.SqlClient.SNI.DataSource.ParseServerName(String dataSource)
at System.Data.SqlClient.SNI.SNIProxy.CreateConnectionHandle(Object callbackObject, String fullServerName, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Byte[]& instanceName, Byte[]& spnBuffer, Boolean flushCache, Boolean async, Boolean parallel, Boolean isIntegratedSecurity)
at System.Data.SqlClient.SNI.TdsParserStateObjectManaged.CreatePhysicalSNIHandle(String serverName, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Byte[]& instanceName, Byte[]& spnBuffer, Boolean flushCache, Boolean async, Boolean parallel, Boolean isIntegratedSecurity)
at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)
at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)
at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)
at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, Boolean applyTransientFaultHandling)
at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection)
at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
at System.Data.SqlClient.SqlConnection.Open()
at App3.MainPage.Page_Loaded(Object sender, RoutedEventArgs e)
Create a UWP project
Add reference to Microsoft.EntityFrameworkCore.SqlServer (this will add also a update reference of System.Data.SqlClient)
In main xaml add following code using a sql server:
```c#
SqlConnection con = new SqlConnection("Data Source=jackson;Initial Catalog=Database;user id=;password=;");
con.Open();
Same error appears when EFcore is used with SQL server in UWP projects. The project is that SqlClient reference has been updated and missingfunction is launched.
```c#
#region Assembly System.Data.SqlClient, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
// C:\Users\agonzalezgorordo\.nuget\packages\system.data.sqlclient\**4.5.0**\ref\netstandard2.0\System.Data.SqlClient.dll
#endregion
EF Core version: 2.1
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows10
IDE: Visual Studio 2017 15.7.3
_Copied from original issue: aspnet/EntityFrameworkCore#12276_
_From @ajcvickers on June 8, 2018 20:35_
@asiergonzalezgorordo This could be an issue with the combination of packages and versions being used. Can you post your csproj file?
_From @edoust on June 9, 2018 9:37_
I get the same error message, this is reproducable, just create a new empty project and add these package references (see screenshot)
Upgrading to .NET Standard library v2.0.3 also makes no difference...
@edoust - Can you upgrade NETStandard.Library to 2.0.3 and see if it still happens? UWP 6.1.5 release says that it upgraded it but if you reference 2.0.1 explicitly you are causing a downgrade which may not be compatible and cause errors.
_From @edoust on June 9, 2018 19:40_
@smitpatel I have tried that already, it makes no difference...
_From @asiergonzalezgorordo on June 10, 2018 8:38_
The problem is with system.data.sqlclient reference because it is updated
to version 4.5.0 when adding sqlserver reference.
If you create a new project and just add that reference it throws same
error.
See screenshot:

_From @asiergonzalezgorordo on June 10, 2018 18:16_
Hi again.
I have been investigating a bit...
The problem is in following function of SNIProxy.cs of System.Data.SqlClient reference in if (!_dataSourceAfterTrimmingProtocol.Contains(BackSlashSeparator)) code.
private bool InferNamedPipesInformation()
{
// If we have a datasource beginning with a pipe or we have already determined that the protocol is Named Pipe
if (_dataSourceAfterTrimmingProtocol.StartsWith(PipeBeginning) || ConnectionProtocol == Protocol.NP)
{
// If the data source is "np:servername"
if (!_dataSourceAfterTrimmingProtocol.Contains(BackSlashSeparator))
{
PipeHostName = ServerName = _dataSourceAfterTrimmingProtocol;
InferLocalServerName();
PipeName = SNINpHandle.DefaultPipePath;
return true;
}
...
System.String.Contains method in UWP does not implement contains with a char, this can be checked by adding following code in an UWP project.
const char BackSlashSeparator = '\\';
string s = string.Empty;
s.Contains(BackSlashSeparator);
It will try to add a Linq reference.
Maybe it helps
@keeratsingh - Looking at your comment https://github.com/dotnet/corefx/issues/29870#issuecomment-391893548
Here is the customer report who is seeing the same exception as you. We might have a bug here.
/cc @divega Looks like either a packaging issue, or another case where UWP doesn't fully implement .NET Standard 2.0.
@smitpatel
As confirmed, no exception is seen for System.Data.SqlClient versions 4.5.0-rc1/4.5.0 stable with Microsoft.NETCore.UniversalWindowsPlatform versions 6.1.4/6.15/6.2.0-Preview1-26502-02 while using the Min Target Version: Windows 10 Fall Creators Update (10.0; Build 16299)
The exception is only seen when the Min Target Version is updated to Windows 10, version 1803(10; Build 17134)
@karelz Since this is not directly related to 'System.Data.SqlClient', could you kindly update the label to the responsible team.
@keeratsingh Can you explain why this is not a SqlClient issue?
@ajcvickers As per my observations commented above the exception is seen only while updating the Min Target Version is updated to Windows 10, version 1803 irrespective of System.Data.SqlClient version.
I was of the understanding that the method itself is missing in the newer version which needs to be fixed as it worked in the previous version Windows 10 Fall Creators Update and there is nothing to be done from SqlClient perspective. Am I misunderstanding this ?
@tommcdon @weshaggard @ericstj any idea why higher min target version would start throwing MissingMethodException in UWP?
@keeratsingh I guess I don't have that level of insight into the way SqlClient and UWP interact and which teams are responsible technically for each change. To me, this is a SqlClient issue on UWP, which I think is what the tags say.
String.Contains(char) is _not_ a .NET Standard API and is not expected to be available in UWP. It was added in .NET Core 2.1
https://apisof.net/catalog/System.String.Contains(Char)
What this means is that somehow the UWP app is including a copy of System.Data.SqlClient.dll that was built for .NET Core 2.1.
I will need help from @weshaggard to determine why that is happening.
This is significant
The exception is only seen when the Min Target Version is updated to Windows 10, version 1803(10; Build 17134)
In System.Data.SqlClient.csproj (in master anyway) I see
<IsUAPAssembly Condition="'$(TargetGroup)' == 'uap' OR '$(TargetGroup)' == 'uap10.0.16299'">true</IsUAPAssembly>
but in Tools\configuration\configuration.props I see
<When Condition="$(_parse_Configuration.Contains('-uapvnext-'))">
<PropertyGroup>
<TargetGroup>uapvnext</TargetGroup>
<NuGetTargetMoniker>UAP,Version=v10.0.16300</NuGetTargetMoniker>
<NuGetTargetMonikerShort>uap10.0.16300</NuGetTargetMonikerShort>
<UWPCompatible>true</UWPCompatible>
</PropertyGroup>
Note it's post 16299. I don't know whether that is relevant. @joperezr
This sounds a lot like https://github.com/dotnet/corefx/pull/29970 which is being fixed in the current 2.1.1 servicing event. The underlying issue is that we shipped a newer version of the UAP assets that requires a higher underlying UWP meta-package which hasn't shipped yet. To address this we removed those assets from the packages for now.
With last nuget update it has been solved
Closing issue, as confirmed by @asiergonzalezgorordo and myself, this issue is resolved with the System.Data.SqlClient version 4.5.1, published on date Monday, June 18, 2018 (6/18/2018).

Most helpful comment
Closing issue, as confirmed by @asiergonzalezgorordo and myself, this issue is resolved with the
System.Data.SqlClientversion4.5.1, published on dateMonday, June 18, 2018 (6/18/2018).