skip to Main Content

Why missing $type when serialize generic with JsonDerivedType?

Here are my codes: public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); Debug.WriteLine(JsonSerializer.Serialize<TestModel>(new TestModel() { Name = "123", Time = DateTime.Now })); Debug.WriteLine(JsonSerializer.Serialize<TestModelWithGeneric<int>>(new TestModelWithGeneric<int>() { Name = "123", Time = DateTime.Now ,Value=1})); Debug.WriteLine(JsonSerializer.Serialize<TestModelWithGeneric<string>>(new TestModelWithGeneric<string>() { Name =…

VIEW QUESTION

Visual Studio, docker container->container call: Connection Refused

Edit: Problem reduced to appearing when changing from .Net6 to .Net8. Changing from .Net6 to .Net7 works fine. But why? I've tried to follow this tutorial. https://learn.microsoft.com/en-us/visualstudio/containers/tutorial-multicontainer?view=vs-2022 The have pushed their code to https://github.com/MicrosoftDocs/vs-tutorial-samples/tree/master/docker/ComposeSample I download and it works. I…

VIEW QUESTION
Back To Top
Search