-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
netstandard2.0: SqlDataReader doesn't implement GetSchemaTable() #21696
Comments
@danmosemsft another example where we missed overrides in .NET Core 2.0 - I start to worry ... IMO we need to boost the tooling and scan for all missing implemented interfaces and overrides, then review them all. [UPDATE] Created special tooling issue dotnet/corefx#19749 |
+1. Found this problem too while migrating my lib to netstarndard2.0 . |
I have a branch with the code ported from Framework sitting at https://github.com/saurabh500/corefx/tree/datareaderSchema |
@saurabh500 My time is very limited and building is usually a mess - if you can get me a |
@NickCraver If you can tell me how to execute the Dapper Tests selectively, that would be great. |
Running Dapper tests with my changes to SqlClient Before changes After changes I don't see any more stack traces with the following.
I will add tests with my changes and send out a PR. PS: @NickCraver It would still be helpful to know the filters for Dapper tests so that I can execute them selectively. |
@saurabh500 absolutely, starting at the repo root, here's how to run a single test:
|
@NickCraver Thanks |
@saurabh500 Yep! |
@NickCraver Thanks for the confirmation :) I was wondering if there is a different mechanism that you use. |
I have i project who target the Net Framework 4.7.1 it use a project who target Net Standard 2.0. In the project Net Standard 2.0, i use an SqlDataReader and when i tried to use the GetColumnSchema() it throws an exception (Not supported). What i'm missing, isn't supported to work ? I tried something else and finally make work what i wanted, but it really same strange that it work. |
There's a disconnect between the
netstandard2.0
intent and actual implementations here, resulting in runtime errors on things that call.GetSchemaTable()
.The way ADO.NET is setup,
DbDataReader
has added some methods over time (since adding to interfaces is bad), of these.GetSchemaTable()
is one brought back innetstandard2.0
. It's a virtual that each implementation needs to override.Here's the Core FX
DbDataReader.GetSchemaTable()
:The problem is
SqlDataReader
never overrides this.For comparison, here's reference source for .NET 4.x where this does happen.
In the current state, the result is a
NotSupportedException
when actually calling the method:Note that this wasn't calling it directly, it was trying to use
DataTable
much further away. So there's quite a few places this is used.I think this was just an oversight after
DataTable
and truckloads of other things were brought back fornetstandard2.0
. Can we please get this in so it's usable?Past issues for context on more usages (for prioritization):
Related concern: this isn't listed in dotnet/SqlClient#17 because it compiles and doesn't have a
PlatformNotSupportedException
, but it's obviously missing. I think we need a separate API call for ADO.NET for things that aren't overridden in CoreFX, that's the superset of items we need to narrow down and fill the gaps on. Not everything should be overridden, but that's likely the easiest list to generate and quickly narrow down.The text was updated successfully, but these errors were encountered: