-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Comments
Tagging subscribers to this area: @thaystg Issue DetailsIs there an existing issue for this?
Describe the bugWhile 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 BehaviorWhen 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 ReproduceThe 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 Version6.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.
|
Is there an existing issue for this?
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.
The text was updated successfully, but these errors were encountered: