runtime: Children could not evaluated in Blazor Web Assembly.

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

Getting the response as JSON from the API correctly but whenever trying to deserialize the JSON it’s saying Children could not be evaluated while trying to debug as follows:

 string countriesJson = await httpResponseMessage.Content.ReadAsStringAsync();
 JsonSerializerOptions options = new JsonSerializerOptions()
 {
     PropertyNameCaseInsensitive = true,
 };

 Country[] countries = JsonSerializer.Deserialize<Country[]>(countriesJson, options); // If try to see the countries it says : Children could not be evaluated

Then I have checked with the following code:

 List<string> items = new List<string> { "Tanvir", "Ahamad" };
 Console.WriteLine(items); // Here items says : Children could not be evaluated 

Expected Behavior

The item should be seen in debugging.

.NET Version

6.0.3

Anything else?

Visual Studio Version: 2022 17.2.0 Preview 1.0

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 25 (17 by maintainers)

Most upvoted comments

This case we don’t need more information. We know how to reproduce. The way to reproduce is: install .net7 locally and try to create a new blazor wasm app targetting .net6. I think Larry has a plan to fix it.

this problem is caused by building a net6 app with a net7 sdk. the preview1 sdk appears to have 6.0.1 specfied as the net6 runtime