Skip to content

Add Microsoft.Data.SqlClient support for SqlServer storage #607

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

Closed
ixtreon opened this issue Jun 21, 2022 · 1 comment
Closed

Add Microsoft.Data.SqlClient support for SqlServer storage #607

ixtreon opened this issue Jun 21, 2022 · 1 comment

Comments

@ixtreon
Copy link

ixtreon commented Jun 21, 2022

We have recently been migrating from the older System.Data.SqlClient provider to the new Microsoft.Data.SqlClient. While these are mostly compatible, there are some keywords only recognized by the new provider. This becomes an issue if one is using the new driver's ConnectionStringBuilder and then passes the resulting CS to code that still uses the old provider. There is a workaround posted a bit later in the thread linked above but it involves modifying the CS after it's been generated which is not great.

I think ideally MiniProfiler should be able to make use of the new provider (possibly in addition to the old one?). Are there any plans to add support for this at a future date (or am I otherwise missing something)?

One solution would be to allow passing a Func<DbConnection> instead of explicitly new-ing the SqlConnection in the SqlServerStorage class but this may be problematic since its base class keeps a reference to the connection string itself. Another solution would be to release separate packages using the old and new providers - but this seems like a much bigger effort.

@ixtreon
Copy link
Author

ixtreon commented Mar 24, 2025

This doesn't seem to a be a problem after updating to version 4.5.4 and keywords such as "multiple active result sets" are now accepted.

@ixtreon ixtreon closed this as completed Mar 24, 2025
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

No branches or pull requests

1 participant