fix: native support when using Mono on Windows - #2842
Open
bitsandfoxes wants to merge 1 commit into
Open
Conversation
Native crash capture never worked on Windows with the Mono scripting
backend. Mono probes the calling assembly's own folder first, so
`DllImport("sentry")` from `Sentry.Unity.Native.dll` resolved to the
managed `Sentry.dll` sitting beside it in `Managed/` on a
case-insensitive file system. That load succeeds, the C entry point is
missing, and native support dies with an `EntryPointNotFoundException`
that only surfaces when the diagnostic logger is enabled.
The desktop library now ships renamed. `native-sdks.targets` writes it
out as `sentry-native.dll`, `libsentry-native.so` and
`libsentry-native.dylib` while the SDK is built, so the package already
carries the new names and the post-build step stays a plain copy. Debug
sidecars keep the names their binaries record.
Android cannot follow. Its `libsentry.so` comes from the
sentry-android-ndk AAR and sentry-java loads it by name from Java, so it
gets its own `Sentry.Unity.Native.Android.dll`, built from the same
sources with a define the way the console variants already are.
Closes #2818
Co-authored-by: Lou Garczynski <louis.roc@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01A1tV2g8KkFQGYdCGLWSay6
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2818, continues #2819
Native crash capture never worked on Windows with the Mono scripting backend. Mono probes the calling assembly's own folder first, so
DllImport("sentry")fromSentry.Unity.Native.dllresolved to the managedSentry.dllsitting beside it inManaged/on a case-insensitive file system. That load succeeds, the C entry point is missing, and native support dies with anEntryPointNotFoundExceptionthat only surfaces when the diagnostic logger is enabled.The desktop library now ships renamed.
native-sdks.targetswrites it out assentry-native.dll,libsentry-native.soandlibsentry-native.dylibwhile the SDK is built, so the package already carries the new names and the post-build step stays a plain copy. Debug sidecars keep the names their binaries record.Android cannot follow. Its
libsentry.socomes from the sentry-android-ndk AAR and sentry-java loads it by name from Java, so it gets its ownSentry.Unity.Native.Android.dll, built from the same sources with a define the way the console variants already are.