Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Help: Don't know how interpret this AOT problem #52

Answered by applejag
SwingWren asked this question in Q&A
Discussion options

You must be logged in to vote

I love this issue ❤ because the error roots so far down in the IL, and I rarely get to analyse that deep.

What's going on is that since Json .NET 12.0.3 it actually includes the NullableAttribute and NullableContextAttribute for C# 8's nullable ref types.

The High stripping level for some reason removes the NullableAttribute:.ctor(byte) constructor, even though it's clearly referenced in the JObject.set_Item method (used in the item["oneKey"] = line).

That IL declaration is the equivalent to the following C# code:

public void set_Item(string propertyName, [Nullable((byte)2)] JToken value) {}

Workaround

This is what you actually asked for. Adding the NullableAttribute to your link.xml wil…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by applejag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #52 on December 10, 2020 11:16.