Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blazor client debugger incorrectly reading object values as null #77031

Closed
1 task done
bensmith009988 opened this issue Oct 13, 2022 · 1 comment · Fixed by #78651
Closed
1 task done

Blazor client debugger incorrectly reading object values as null #77031

bensmith009988 opened this issue Oct 13, 2022 · 1 comment · Fixed by #78651
Assignees

Comments

@bensmith009988
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

While running a Blazor Web Assembly (Hosted) project, I am running into a problem while debugging (on visual studio enterprise 2022) in the client project. Newly instantiated objects with duplicate names as other objects, in the method, appear null while debugging. If they were truly null, then null reference exceptions would be thrown when calling methods on the object. They return the correct data to the UI, so there is no way for the objects to actually be null.

Expected Behavior

When stepping through a project, I would expect to see the debugger highlight and display values as it should. Instead, I am seeing the object value as null, even after value assignment. Setting a default constructor with a breakpoint and debugging shows the constructor being hit, but the object value still shows null.

Steps To Reproduce

The README file in the repository here includes startup instructions to launch and run the sample project. Additionally, it includes instructions to find specific debugging steps that give line-by-line instructions for breakpoints while debugging to replicate the bug.

Exceptions (if any)

Changing the names of objects in a method to be unique, (meaning no other objects in that method or class file have the same name) makes the bug disappear.

.NET Version

6.0.402

Anything else?

Here is a screenshot, while mid-debugging, in a code-block that should have thrown an exception but didn't because the value is not actually null. It only appears as such.

image

@TanayParikh TanayParikh transferred this issue from dotnet/aspnetcore Oct 13, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Oct 13, 2022
@ghost
Copy link

ghost commented Oct 13, 2022

Tagging subscribers to this area: @thaystg
See info in area-owners.md if you want to be subscribed.

Issue Details

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

While running a Blazor Web Assembly (Hosted) project, I am running into a problem while debugging (on visual studio enterprise 2022) in the client project. Newly instantiated objects with duplicate names as other objects, in the method, appear null while debugging. If they were truly null, then null reference exceptions would be thrown when calling methods on the object. They return the correct data to the UI, so there is no way for the objects to actually be null.

Expected Behavior

When stepping through a project, I would expect to see the debugger highlight and display values as it should. Instead, I am seeing the object value as null, even after value assignment. Setting a default constructor with a breakpoint and debugging shows the constructor being hit, but the object value still shows null.

Steps To Reproduce

The README file in the repository here includes startup instructions to launch and run the sample project. Additionally, it includes instructions to find specific debugging steps that give line-by-line instructions for breakpoints while debugging to replicate the bug.

Exceptions (if any)

Changing the names of objects in a method to be unique, (meaning no other objects in that method or class file have the same name) makes the bug disappear.

.NET Version

6.0.402

Anything else?

Here is a screenshot, while mid-debugging, in a code-block that should have thrown an exception but didn't because the value is not actually null. It only appears as such.

image

Author: bensmith009988
Assignees: -
Labels:

area-Debugger-mono

Milestone: -

@thaystg thaystg removed the untriaged New issue has not been triaged by the area owner label Oct 14, 2022
@thaystg thaystg self-assigned this Oct 14, 2022
@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Nov 21, 2022
@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Nov 29, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Dec 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants