Skip to content
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

Use Microsoft.Data.SqlClient for all platforms except net452 #287

Merged
merged 1 commit into from
May 21, 2020

Conversation

mungk
Copy link

@mungk mungk commented May 20, 2020

Replaced System.Data.SqlClient with Microsoft.Data.SqlClient for all platforms except net452 (Microsoft.Data.SqlClient does not support net452).

Only the references and the namespaces needed to be changed in order to accommodate this. However, in order to support both packages in the same code base (again, due to net452), I had to add #if directives around the using statements to use the correct SqlClient library.

Resolves #208

… platforms except net452. using statements wrapped with preprocessor if to pull in appropriate namespace.
@ckadluba
Copy link
Member

Nice work @mungk! Thank you very much for the contribution!

@ckadluba ckadluba merged commit 1070e30 into serilog-mssql:dev May 21, 2020
@benmccallum
Copy link

Note for anyone else Googling for:
Unable to write 21 log events to the database due to following error: Keyword not supported: 'multiple active result sets'.

Upgrading to this version fixes the issue if you're using the newer connection string attribute names, described further here (dotnet/SqlClient#811) as this PR means Microsoft.Data.SqlClient's SqlConnection will be used which knows about the newer attribute names (in my case MARS with spaces).

Thanks for this ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Always Encrypted - Microsoft.Data.SqlClient
4 participants