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

TypeLoadException: VTable setup of type System.Text.Json #28

Open
Fregnen opened this issue Dec 12, 2024 · 2 comments
Open

TypeLoadException: VTable setup of type System.Text.Json #28

Fregnen opened this issue Dec 12, 2024 · 2 comments

Comments

@Fregnen
Copy link

Fregnen commented Dec 12, 2024

Hello,

I get the following error:
System.TypeLoadException: VTable setup of type System.Text.Json.Utf8JsonWriter failed
image

When using Needle Console alongside LaunchDarkly ClientSdk which has dependency to the following the error occurs.
image

When Needle is removed from the project, everything functions correctly. I have noticed some (Demystify-)System dependencies within Needle - could this be the issue? I'm unsure how to resolve this issue and would appreciate your assistance.

We are targeting .Net Standard 2.1.

BR,
Linnea

@marwie
Copy link
Member

marwie commented Dec 13, 2024

Hi, i dont have much time for investigation at the moment, do you have further information around the problem?

Is this a runtime only problem?
Which unity version are you using?
Do you own a license for Needle Console?

@Fregnen
Copy link
Author

Fregnen commented Dec 13, 2024

Hi again,

Thank you for a quick response!

It is during runtime, yes.
I am using 6000.0.5f1
Yes, I have a license.

I did ask Unity about this, and this is what support wrote (edited to shorter version):

[...] our .net team suspect that the cause is likely due to a duplication of dlls within the project. They pointed out that some of the dlls that System.Text.Json depends upon may resolve to different things depending on if Net Standard 2.0 or Net Standard 2.1 is targeted. For Net Standard 2.0, those assemblies contain implementations, but for Net Standard 2.1 they contain compatibility shims that forward their calls to code that now exists within the 2.1 runtime. This means that including the Net Standard 2.0 dependencies when targeting 2.1 in Unity can cause duplicate implementations which would lead to the vtable error you are seeing.

System.Text.Json does point to Standard 2.0, while we're targeting 2.1.

Hope this helps. Otherwise, let me know if I can do anything.
BR,
Linnea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants