-
Notifications
You must be signed in to change notification settings - Fork 853
Npgsql: don't create more than one DataSource #2045
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
Conversation
…on : Could not load type 'System.Data.Common.DbDataSource' from assembly 'Npgsql, Version=7.0.6.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7'." thrown for .NET 7 test runner
Codecov Report
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. @@ Coverage Diff @@
## master #2045 +/- ##
==========================================
- Coverage 66.72% 65.78% -0.94%
==========================================
Files 262 174 -88
Lines 8439 4142 -4297
Branches 594 404 -190
==========================================
- Hits 5631 2725 -2906
+ Misses 2656 1325 -1331
+ Partials 152 92 -60
Flags with carried forward coverage won't be shown. Click here to find out more.
|
|
Current fix looks like more a hack than general-purpose solution. |
I agree, that is why I wrote:
Related: #2096 |
3 out of 4 DI extension methods are now ensuring that the
DataSourceis created only once (in a thread-safe way), and when it's possible they reuse the instance registered in the DI.It's not an ideal fix, because the current design still allows the users to have more than one
NpgsqlDataSourceper their app. Example:@unaizorrilla it's the fix I propose for 7.0.
For 8.0 we need to introduce a breaking change similar to what I did for the Azure clients in #2040
Contributes to #1993.