-
Notifications
You must be signed in to change notification settings - Fork 169
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
3.x Release: net8.0 and Microsoft.Data.SqlClient support #222
3.x Release: net8.0 and Microsoft.Data.SqlClient support #222
Conversation
6713db7
to
cd4f6c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this - it's overdue and this is great! There's a few things we'd need to do to make this happen with such major version bumps though:
- Some people are still using System.Data.SqlClient, and by changing it we make IntelliSense everywhere say "...which SqlConnection?" and fun like that.
- We should probably bump the version to signify this, I guess a 3.x (version.json in root).
For the first, I just never got around to it but do not want to break people. I think what needs to happen is .Shared depends on neither SQL client, and instead we have 2 new packages: StackExchange.Exceptional.SqlClient
and StackExcahnge.Exceptional.SystemDataSqlClient
(naming suggestions welcome). IIRC the split only got tricky because there's one place we hook up SQL exception handlers to get more information automatically on SQL errors and we wouldn't want to lose that. Perhaps it happens in some static initializer that registers a global default or...something. I don't think we need reflection (and it'd be hosting to AOT), but need some thoughts.
Any chance you thought about the above already? Suggestions?
tests/StackExchange.Exceptional.Tests/StackExchange.Exceptional.Tests.csproj
Show resolved
Hide resolved
Ok, I tried to extract store + default handler method to two packages (one for each SqlClient). Btw, I noticed that the packages were not shipped with deterministic build. I've tuned a little build props. Is it ok for you ? Marking the PR draft meanwhile. |
699524a
to
cbc077d
Compare
@NatMarchand last visiting this simply predates deterministic being a thing - absolutely welcome that improvement <3 |
Okay, quite naive implementation but seems to work : I've made a static ctor in both SQLErrorStore which adds the sqlexception action |
@NatMarchand I gotta switchover to work stuff but can try to poke at this likely tomorrow (kiddo birthday!). The current problems looking at this local are:
I think what I'm imagining here is an actual static dictionary for defaults that we register to, and that collection is used in the existing |
bbc180a
to
8c583ad
Compare
Ok, meanwhile, I've fixed the github action build.
For the module initializer thing, I tried it but couldn't make it work on netstandard target (nor netframework) maybe only working on net ? |
@NatMarchand I think calling the add to the default dictionary in the static constructor is fine too, can tweak after if needed - no need for extension class though, can just inline it there IMO. |
5f37f82
to
0013e26
Compare
As agreed yesterday, I made some changes : added back the redis action, changed and moved the assemblies to a path without "Client" |
0013e26
to
63b69f4
Compare
63b69f4
to
93b3f2d
Compare
Hi there! |
any update on this :) ? |
@NickCraver any changes here? have some vulnerable warning for the latest version of StackExchange.Exceptional.AspNetCore |
Any updates on this? |
We have been using the lib in dotnet 8 successfully for a while. Based on the blog post below system.data.sqlclient is supported in dotnet 8 but will be deprecated and no longer supported starting with dotnet 9. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the effort here - I've been heads down on some other stuff for far too long here, trying to catch up during a few off days here and get releases out.
Hey there!
I've made a PR to upgrade dependencies mainly to switch to Microsoft.Data.SqlClient (solves #193) and took the opportunity to upgrade other dependencies.
Among other stuffs I've also used centralized nuget packages versions.
Please note that, although I've made my best to be non breaking, in order to do this I've changed the required framework version from net461 to net462 and removed the target net461 from aspnetcore projet (as aspnetcore on net framework has not been supported for a long time).
I've thought about supporting Microsoft.Data.SqlClient and System.Data.SqlClient side by side by moving the mssql store to another assembly and using reflection for catching SqlException (like it's done for the redis exception) but I'm afraid of the perf penalty which could occur.
I'd be happy to talk to you if you need :)