Skip to content

[wasm][debugger] Properties in the watch window show "𝑓 <Property>" instead of the value of the property #49144

Closed
@RobertBouillon

Description

@RobertBouillon

Describe the bug

Watch window does not show the value of properties for Blazor WASM projects, requiring you instead to navigate to and expand each property to see its value.

To Reproduce

  1. Create a new Blazor WASM project
  2. Add a new .NET library project to the solution
  3. Add the Foo class to the library with the code below
  4. Add a reference to the .NET library project from the WASM project
  5. Update the FetchData.razor page with the code below.
  6. Add a breakpoint in the Bar property
  7. Start debugging
  8. Click on the "Fetch Data" link in the window
  9. The program should break in the Foo class. Open the locals Window

Expected Results

this.Bar will show the value sample-data/weather.json
image
(Image shown is the locals window when the same value is viewed from a console project)

Actual Results

this.Bar shows 𝑓 Bar() {} and requires you to expand the property to view the value
image

Foo.cs

using System;

namespace BlazorBugsLib
{
  public class Foo
  {
    public string Bar => "sample-data/weather.json";
    public string Lorem { get; set; } = "Safe";
    public string Ipsum { get; set; } = "Side";
    public Something What { get; } = new Something();
  }

  public class Something
  {
    public string Name { get; set; }
    public Something() => Name = "Name of something";
    public override string ToString() => Name;
  }
}

FetchData.razor

  protected override async Task OnInitializedAsync()
  {
    forecasts = await Http.GetFromJsonAsync<WeatherForecast[]>(new BlazorBugsLib.Foo().Bar);
  }

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions