-
-
Notifications
You must be signed in to change notification settings - Fork 220
InvalidCastException when trying to add device context #1695
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
Comments
Upon further experimentation, if i cast the object when i add it to the contexts, it works.
|
this is an anonymous type so i am not surprised it fails. i think we need some type checking in |
as an alternative is you can do this via
|
@jaisonass - Thanks for reporting this issue with the FYI - We are working on adding first-class support for both MAUI (#1651) and for Android ( This will include device information like you are doing here, so some of your work will be redundant. You might just want to wait. |
@jaisonass closing this one. the better exception message will ship in the next release. |
@SimonCropp Yep, thank you both for your time! |
Please mark the type framework used:
Please mark the type of the runtime used:
Please mark the NuGet packages used:
Steps to reproduce the issue or link to a repository with a small reproducible code.
Add sentry to a maui or probably even a .net project. I don't think thats a maui related issue tbh.
I've got this piece of code in my Main which worked fine until i decided i also needed to add device info
"os" and "user" are working just fine on their own, however "device" returns this exception
I should note that all of these are strings and do have values.
If i try to add the device context as something else (ex:
scope.Contexts["deviceinfo"]
) it works just fine.Is there any way to get around this error?
The text was updated successfully, but these errors were encountered: