-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
Adding Sentry to global usings breaks compilation all over the place in 4.0.0 #3105
Comments
Hm, maybe we jumped the gun a bit on this. @bitsandfoxes / @bruno-garcia should we revert to opt-in rather than opt-out for global usings? |
Got the same issue two years ago in 3.14, where it was reverted. The decision back then was to rename potentially conflicting names - but seeing conflicts on very generic names like I still think that adding Sentry to the global usings by default is a bad idea, as probably 90% of the users of this lib call it exactly once - when configuring it. The workaround for now is by opting out of the global usings, as noted in the release notes:
|
Agree. Indeed, I do not think any library should pollute its users' global namespaces by default (with, perhaps, the exception of some core BCL namespaces). Offer the option, if you want, but do not make it the default. That said, I am not really sure what a Seems like the wrong solution to a non-problem. |
The idea was to minimize any friction between installation and initialization and make it ready to inspect the API from the get-go.
Fair enough. Sorry about that. |
Believe it or not we've received support tickets in the past with "I get an error SentrySdk isnt' found" etc. For that reason we add to the docs everywhere the True that we missed some types very likely to clash here and worth addressing this asap but before rolling it back a second time, worth taking a stab at just fixing the conflicts.
It allows you to quickly disable this change and avoid the breakage we introduced to you. Ideally no one would be aware of this unless needed to adopt the package and avoid conflicts (which could come in handy now). |
Hey @frankbuckley, @jhartmann123. |
We still have issues with 4.0.1. This time it is Request class. |
Yup, still got that one with 4.0.1:
|
|
4.0.2 is out with those types renamed. Thanks again for raising this and for bearing with us folks. |
|
My sincerest apologies and thanks for pointing these out. I missed those, that's on me. |
Package
Sentry
.NET Flavor
.NET
.NET Version
8.0.1
OS
Any (not platform specific)
SDK Version
4.0.0
Self-Hosted Sentry Version
No response
Steps to Reproduce
Upgrade to 4.0.0. Try to compile.
Expected Result
Compilation succeeds. Maybe a couple of tweaks for a version change.
Actual Result
Compilation errors all over the place.
This clashes all over the place for me (Request, Session, Attachment,...) - and let alone our own types, obvious core library types - e.g.:
and...
It is a huge assumption to think that library users want
using Sentry
injected into every source file in their projects!Can you explain the thinking here?
We usually only ever interact with Sentry types in startup/configuration code (1 or 2 source files in a solution). It is difficult to see why
using Sentry;
is being equated with the prevalence ofusing System.Collections.Generic;
?The text was updated successfully, but these errors were encountered: