question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug: RepoDb.SqlServer v1.1.5 breaks System.Data.SqlClient support

See original GitHub issue

Bug Description

After updating the RepoDb.SqlServer package reference from v1.1.4 (which worked fine) to v1.1.5, I get errors about “no database helper mapping found”, as if the bootstrapper has not been run. No code was changed, only the package reference.

Exception Message:

There is no database helper mapping found for 'System.Data.SqlClient.SqlConnection'. Make sure to install the correct extension library and call the bootstrapper method. You can also visit the library’s installation page (https://repodb.net/tutorial/installation).

Solution

I checked RepoDb.SqlServerBootstrap at the time of the exception, and IsInitialized is true, so this is not a case of the initializer not running. Just in case, I tried, and adding an explicit call to RepoDb.SqlServerBootstrap.Initialize(), but that did not change anything.

On a hunch, I changed package dependencies from System.Data.SqlClient to Microsoft.Data.SqlClient and return a Microsoft.Data.SqlClient.SqlConnection. With that the errors are gone.

A little digging in the recent changes to RepoDB brings up these:

The issue mentions:

We are afraid that we might affect some of the users if we are to remove this without the proper acceptance from the community.

Suggestion

I don’t mind support for System.Data.SqlClient being dropped. However it is strange that this is done without a clear mention in the release notes, and without a major version change. That leads me to believe this might be an unintended side-effect.

When this breaking change is on purpose, please bump the major package version, and put a clear message in the the changelog.

Library Version:

Example: RepoDb v1.12.10 and RepoDb.SqlServer v1.1.5

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mikependoncommented, Feb 22, 2022

Just to give you more insights, this has been Tweeted AFAIK and we even placed a special section into our main README page.

0reactions
mikependoncommented, Feb 23, 2022

FYI: We have updated our installation page as per this request.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SQL Server | RepoDB
SqlServer (v1.1.5-beta1). Enhancement: Remove System.Data.SqlClient reference from RepoDb.SqlServer #857 - this is a breaking changes; Removed both the ...
Read more >
Releases · mikependon/RepoDB
Fixed the issues when writing the records into the database via System.DataTable object using the BinaryBulkImport, when an Enum-based property is present.
Read more >
RepoDB throwing SqlConnection Exception - net core
{"There is no database setting mapping found for 'System.Data.SqlClient.SqlConnection'. Make sure to install the correct extension library and ...
Read more >
SqlBulkHelpers 2.3.0
A library for easy, efficient and high performance bulk insert and update of data, into a Sql Database, from .Net applications. By leveraging...
Read more >
Can't restore databse on Microsoft SQL server ...
System.Data.SqlClient.SqlError: The database was backed up on a server ... Either restore the database on a server that supports the backup, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found