User Profile
Happymade
Copper Contributor
Joined Oct 29, 2022
User Widgets
Recent Discussions
.net6 ,How to use JsonSerializerContext in VB.net Project
In the C# project(.net6), I can run the following code and successfully output the serialized content. public class Test { public string AA { get; set; } = "A"; public string BB { get; set; } = "B"; } [JsonSerializable(typeof(Test))] public partial class TestContext : JsonSerializerContext { } var T = new Test(); var utf8Json = JsonSerializer.SerializeToUtf8Bytes(T, TestContext.Default.Test); var s = Encoding.UTF8.GetString(utf8Json); Console.WriteLine(s); //{"AA":"A","BB":"B"} But how can I achieve this in vb.net project(.net6/7)? Please help me, please post the vb sample code. thanks!803Views0likes1Comment
Recent Blog Articles
No content to show