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

System.NullReferenceException: 'Object reference not set to an instance of an object.' occurs when click the help button in TreeView smarttag in the DemoConsole application #11640

Closed
MelonWang1 opened this issue Jul 9, 2024 · 8 comments · Fixed by #11656
Assignees
Labels
💥 regression-preview Regression from a preview release
Milestone

Comments

@MelonWang1
Copy link
Contributor

MelonWang1 commented Jul 9, 2024

.NET version

.Net 9.0: Main branch of Winforms repo

Did it work in .NET Framework?

Not tested/verified

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Yes, it has different behavior. In .Net 8.0 from Release/8.0 branch of Winforms repo, no response after clicking the help button in TreeView smarttag in the DemoConsole application.

More info:
This issue also repro in propertygrid control binding the TreeView.
image

StackTrace.txt

Issue description

Actual result in DemoConsole test app:
System.NullReferenceException: 'Object reference not set to an instance of an object.' occurs when click the help button in TreeView smarttag in the DemoConsole application.

Call Stack:
System.NullReferenceException
HResult=0x80004003
Message=Object reference not set to an instance of an object.
Source=System.Windows.Forms.Design
StackTrace:
at System.Windows.Forms.Design.TreeNodeCollectionEditor.TreeNodeCollectionForm.TreeNodeCollectionEditor_HelpButtonClicked(Object sender, CancelEventArgs e) in C:\Users\v-melonwang\Desktop\New folder\winforms\src\System.Windows.Forms.Design\src\System\Windows\Forms\Design\TreeNodeCollectionEditor.cs:line 705

image

actual.mp4

Expected result:
The TreeNode Editor MSDN should open in broswer when click he help button in TreeView smarttag.

expected.mp4

Steps to reproduce

Test sample: DemoConsole in Winforms repo.

@MelonWang1 MelonWang1 added 💥 regression-preview Regression from a preview release untriaged The team needs to look at this issue in the next triage labels Jul 9, 2024
@MelonWang1
Copy link
Contributor Author

No response after clicking the help button in controls smarttag(except TreeView control) in the DemoConsole application. It should open the help website.

@lonitra
Copy link
Member

lonitra commented Jul 9, 2024

Looks like there was a typo when setting _editor
https://github.com/dotnet/winforms/blob/main/src/System.Windows.Forms.Design/src/System/Windows/Forms/Design/TreeNodeCollectionEditor.cs#L57
but even after this fix no website pops up.
@MelonWang1 You mentioned in issue that in .NET 8, there is no response after clicking help button. For your expected behavior video is that from another .NET core version?

@lonitra lonitra added the 📭 waiting-author-feedback The team requires more information from the author label Jul 9, 2024
@MelonWang1
Copy link
Contributor Author

@lonitra The expected result is from design time form designer. eg: add a treeview control to from designer -> open smarttag -> Edit Nodes... -> click help button.

@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Jul 10, 2024
@MelonWang1
Copy link
Contributor Author

but even after this fix no website pops up.

Maybe it's a correct behavior. In .NET 8.0 and .NET Framework, no response after clicking help button use propertygrid control binding the TreeView.

framework.mp4

@merriemcgaw merriemcgaw assigned lonitra and LeafShi1 and unassigned lonitra Jul 10, 2024
@merriemcgaw
Copy link
Member

assigning to @LeafShi1 to do the fix.

@merriemcgaw merriemcgaw removed the untriaged The team needs to look at this issue in the next triage label Jul 10, 2024
@John-Qiao
Copy link
Member

John-Qiao commented Jul 18, 2024

Verified the issue on the latest DemoConsole test app of Winforms repo from main branch, it was fixed: no exception occurs when click the help button in TreeView smarttag in the DemoConsole application now.

11640-testresult.mp4

And we will test it with the TreeView control in a new WinForms project once the PR: 11656 updates sync to latest .NET 9.0 P7 SDK build.

@MelonWang1 MelonWang1 added this to the 9.0 Preview7 milestone Jul 18, 2024
@John-Qiao
Copy link
Member

John-Qiao commented Jul 22, 2024

Verified this issue in the latest .NET 9.0 Preview7 SDK build: 9.0.100-preview.7.24371.4, it was fixed: no exception occurs when click the help button in TreeNode Editor dialog.

11640-testresult2.mp4

@MelonWang1
Copy link
Contributor Author

Verified the issue with .NET 9.0.100-preview7.24402.8 test pass build that the issue has been fixed, which have the same results as above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 regression-preview Regression from a preview release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants