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

Visual Studio crashes when calling the ShowToolTip at Design Time #12895

Open
ElavazhaganSF4422 opened this issue Feb 7, 2025 · 3 comments
Open
Labels
area-VSDesigner Windows Forms out-of-proc designer related issues waiting-author-feedback The team requires more information from the author

Comments

@ElavazhaganSF4422
Copy link

Environment

Edition - Windows 11 Enterprise
Version - 23H2
OS build - 22631.4751
Visual Studio version -17.13.0 Preview 1.0

.NET version

.Netcore 6 , 7, 8 and 9

Did this work in a previous version of Visual Studio and/or previous .NET release?

No it doesn't work on previous Netcore releases.

Issue description

I am attempting call the ShowToolTip() method within a custom control's property setter. When I try to change the property value in the property window at DesignTime, Visual Studio crashes.

For your reference, I have attached a simple sample that replicates the issue.
Sample - RecorNavigationControlShowToolTip.zip

Steps to reproduce

1.Drag and Drop the CustomControl from the toolbox.
2.Change the value of the NativeCheck property to true.

Expected Behavior : - ToolTip show on the control
Observed Behavior : - VS crashes

Diagnostics


@ElavazhaganSF4422 ElavazhaganSF4422 added the untriaged The team needs to look at this issue in the next triage label Feb 7, 2025
@Olina-Zhang
Copy link
Member

@Olina-Zhang
Copy link
Member

Workaround: ensures that the ShowToolTip() method is only called at runtime, preventing Visual Studio from crashing when you change the property value in the property window at design-time.

[Browsable(true)]
public bool NativeCheck
{
get { return nativeCheck; }
set
{
if (value && !this.DesignMode)
ShowToolTip();
nativeCheck = value;
}
}

@JeremyKuhne JeremyKuhne removed the untriaged The team needs to look at this issue in the next triage label Feb 10, 2025
@JeremyKuhne
Copy link
Member

@ElavazhaganSF4422 because the designer now runs in another process you need to use design mode checks in more places than you used to with .NET Framework where it ran in process with VS.

@JeremyKuhne JeremyKuhne added waiting-author-feedback The team requires more information from the author area-VSDesigner Windows Forms out-of-proc designer related issues labels Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-VSDesigner Windows Forms out-of-proc designer related issues waiting-author-feedback The team requires more information from the author
Projects
None yet
Development

No branches or pull requests

3 participants