-
Notifications
You must be signed in to change notification settings - Fork 286
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
Microsoft.Data.SqlClient not backward compatible with System.Data.Client, Error: Keyword not supported: 'trust server certificate'. #2762
Comments
This is a duplicate of #1407 |
Thank you for reporting this issue. As we are unable to reproduce the issue you reported, could you provide a source code in a Visual Studio Solution that reproduces the issue, please? Once we received the repro code, we would be able to identify the root cause of the issue. |
Hi @arellegue, added in description how to reproduce the error. Please take a look and let me know if any other information is required. |
@ashutoshsuman99 this breaking change was introduced by PR #534 and announced in the release note for version 2.0.0-preview4. |
@JRahnama Thanks for the reply, but since our dependencies (for which we don't control the code) are using System.Data.SqlClient we have to find a way to have |
Be aware that mixing M.D.SqlClient and S.D.SqlClient is not advisable, as it could lead to various exceptions. |
I am closing this issue as it is by design, but you can keep commenting here and get responses back. |
Yepp, but we don't have much choice on the piece of code used by our partners. Any suggestions how to tackle the above mentioned problem? |
Not really. |
Connection string manipulation.. (seen in some MS products) |
Pretending the two libraries work the same is a bad idea. If your customers don't want to upgrade, then you can't either. |
@ajcvickers Maybe you should address that with the MS products doing this? (Looking at you, EF6 Tools 😄 ) |
@ErikEJ Do you really think I didn't make my concerns well-known at the time? 😆 |
@ajcvickers No! 😆 |
Describe the bug
A clear and concise description of what the bug is.
We have recently moved to
Microsoft.Data.SqlClient
fromSystem.Data.SqlClient
to build our connection strings and use it to connect to our backend database as well as to the customer database. But we are getting the following error.Looks like the library
Microsoft.Data.SqlClient
adds spaces toTrustServerCertificate
and makes the final string as:Where as
System.Data.SqlClient
creates the connection string in the following format:We have to use
Microsoft.Data.SqlClient
to support few other types of authentications as well like and work with services which that use this library, and we also work with services that useSystem.Data.SqlClient
. And this interservice communication with connection string having spaces inTrustServerCertificate
causes error when used withSystem.Data.SqlClient
.Is there any way for us to have a connection string without spaces in TrustServerCertificate using
Microsoft.Data.SqlClient
library?Code to reproduce the error
Further technical details
Microsoft.Data.SqlClient version: (found on the nuget or Microsoft.Data.SqlClient.dll): 5.2.1
.NET target: (e.g. Framework 4.7.1, Core 2.2.2): .NET Framework 4.7.2
Operating system: (e.g. Windows 2019, Ubuntu 18.04, macOS 10.13, Docker container): Windows
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: