Skip to content
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

Assembly Alias causes System.Text.Json exception #1777

Open
bitsandfoxes opened this issue Aug 27, 2024 · 3 comments
Open

Assembly Alias causes System.Text.Json exception #1777

bitsandfoxes opened this issue Aug 27, 2024 · 3 comments
Labels
Bug Something isn't working Editor

Comments

@bitsandfoxes
Copy link
Contributor

bitsandfoxes commented Aug 27, 2024

Steps to reproduce:

  1. Build the SDK with TFM netstandard2.1 (i.e. using Unity 2022 or newer)
  2. Run the aliasing tool
  3. Attempt to capture an error, session, transaction
  4. Observe the following error while the SDK attempts to serialize an envelope
TypeLoadException: VTable setup of type System.Text.Json.Utf8JsonWriter failed

This does not happen when skipping the aliasing step.

@bitsandfoxes bitsandfoxes added the Bug Something isn't working label Aug 27, 2024
@bitsandfoxes
Copy link
Contributor Author

As workarounds:

  1. Use version Unity 2021 or older to build the SDK - and that's how CI does it
  2. Disable aliasing when packing/repacking the SDK

@sambonfire
Copy link

Workaround #1 won't work for us, so I attempted workaround #2. It worked in editor, but when I did a player build, it crashes with a new error:

System.Text.Json.Utf8JsonWriter doesn't implement interface System.IAsyncDisposable

@bruno-garcia
Copy link
Member

bruno-garcia commented Sep 11, 2024

Since we're SOL on this one, I'll try my luck and see if @xoofx has any idea what might be going on 🙏

tl;dr: Same code base, if we build with netstandard2.1 (i.e. using Unity 2022 or newer) it crashes. Works if we build with ns2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Editor
Projects
Status: Blocked
Status: No status
Development

No branches or pull requests

3 participants