-
Notifications
You must be signed in to change notification settings - Fork 982
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
The application crashes when trying to get data about the DropDownList in the PropertyGrid through the Inspect #6165
Comments
…DownList in the PropertyGrid through the Inspect dotnet#6165 The issue is reproduced because we throw an NotSupportedException when user tries to get the "RuntimeId" properties for the base AccessibleObject. Added return of Array.Empty for base class
…DownList in the PropertyGrid through the Inspect dotnet#6165 The issue is reproduced because we throw an NotSupportedException when user tries to get the "RuntimeId" properties for the base AccessibleObject. Added return of Array.Empty for base class Remove "AccessibleObjectRuntimeIdNotSupported" from string resources
Fixes dotnet#6165. `AccessibleObject.RuntimeId` was previously changed to assert and throw an excepton to avoid subclasses with non-overriden `RuntimeId` property (see dotnet#5638 for details). But it was overlooked that `AccessibleObject` is also used to wrap system accessible objects. Because of that you may get a crash or hit an assertion (with debugger attached) when running a debug version of the code. This doesn't affect users of WinForms since the SDK is compiled in release mode. To fix the issue a separate subclass of `AccessibleObject` may be created. But this will probably be a big and complex change. Instead of that we just can add a branch for system wrapper to `RuntimeId` property. An empty array can be used as a `RuntimeId` value for system wrappers. This will cause the UIAutomationCore to perform field-by-field comparison instead of `RuntimeId` comparison. It doesn't look as a good option since field-by-field comparison may be bad for performance and also it will be better to not rely on the UIAutomationCore internal behavior. Hash code value was applied as a valid `RuntimeId` for system wrappers. It is better than an empty array since it doesn't cause any performance penalties and is explicit so we don't rely on UIAutomationCore behavior.
It is crashing because you're running application without debugger attached. Otherwise it will pause at |
…6192) Fixes #6165. `AccessibleObject.RuntimeId` was previously changed to assert and throw an excepton to avoid subclasses with non-overriden `RuntimeId` property (see #5638 for details). But it was overlooked that `AccessibleObject` is also used to wrap system accessible objects. Because of that you may get a crash or hit an assertion (with debugger attached) when running a debug version of the code. This doesn't affect users of WinForms since the SDK is compiled in release mode. To fix the issue a separate subclass of `AccessibleObject` may be created. But this will probably be a big and complex change. Instead of that we just can add a branch for system wrapper to `RuntimeId` property. An empty array can be used as a `RuntimeId` value for system wrappers. This will cause the UIAutomationCore to perform field-by-field comparison instead of `RuntimeId` comparison. It doesn't look as a good option since field-by-field comparison may be bad for performance and also it will be better to not rely on the UIAutomationCore internal behavior. Hash code value was applied as a valid `RuntimeId` for system wrappers. It is better than an empty array since it doesn't cause any performance penalties and is explicit so we don't rely on UIAutomationCore behavior.
I don't agree with this view angle - an app must never crash in Debug or Release mode unless it is a developer-originated error that the developer can fix. And it is never ok to accept crashes in Debug because we don't in Release - by doing this we are ignoring the root cause. |
.NET Core Version:
Have you experienced this same bug with .NET Framework?:
RuntimeId
property type #5638)Repro steps:
PropertyGrid
and button.Button
asSelectedObject
property ofPropertyGrid
.Accessible Role
dropdown list.Actual behavior:
The Application crashes:
Expected behavior:
The application should not crash.
The text was updated successfully, but these errors were encountered: