-
-
Notifications
You must be signed in to change notification settings - Fork 226
Fix UWP Net Native compilation #4085
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4085 +/- ##
==========================================
- Coverage 75.73% 73.65% -2.08%
==========================================
Files 357 444 +87
Lines 13466 15995 +2529
Branches 2671 3152 +481
==========================================
+ Hits 10198 11781 +1583
- Misses 2593 3400 +807
- Partials 675 814 +139 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks for the PR @jdswcz ! I'm happy to get this to go green in CI. However ideally I'd also like to confirm the code fixes the problem and to do that I need to be able to reproduce the problem. It looks like to reproduce it static analysis needs to be enabled for .NET Native. How are you doing that? I tried adding |
These are our Release build settings that produce this error. Edit: In the past, I was reporting this support and was sending minimum reproducible sample. But I am worried I don't have it now (it's two years ago). |
|
Thanks @jdswcz - if I use those build setting in Visual Studio then I get an error from gatekeeper when trying to run the app in release mode... but it's not clear what the error is:
I'm wondering how you got the more detailed/actionable error message? |
Apologies for later response. You probably figured out, however, you can just open command line and run the command mentioned in error. Something like:
Then, in the output.txt, you'll see the gatekeeper log. You may see some warnings and info messages. However, only line marked as 'Error' cause compilation to fail. |
|
Just tested Sentry nuget package v 5.5.1 and I can confirm the issue was resolved. Thank you very much for your effort. |
|
Awesome, thanks @jdswcz for raising this and for making the PR! 🙏🏻 |

Sentry DotNet since version 5.2.0 (and until the most recent 5.5.0) can't be used in UWP projects because they fail to compile with following error:
Sentry : Gatekeeper error GK0018 : GK0018 Value type 'Sentry.Internal.FnvHash' has an explicit default constructor which is unsupported. Use an initialization function instead.This happens with .NET Native compilation and static analysis enabled. Versions 5.1.1 and older aren't producing this issue as they don't contain FnvHash struct.
Similar error was solved in the past with other objects: #2415
Please test my changes before merging. As a customer, I want this issue quickly fixed, so I am helping you. However, I don't want to spend hours getting compilation of sentry working and testing it within my package. 💯 Thank you for your understanding.