WFDEV003: DomainItemAccessibleObject should not be used
Any reference to System.Windows.Forms.DomainUpDown.DomainItemAccessibleObject will result in warning WFDEV003
. This warning states that DomainUpDown.DomainItemAccessibleObject is no longer used to provide accessible support for items in DomainUpDown controls. This type was never intended for public use.
Previously, objects of this type were served to accessibility tools that navigated the hierarchy of a DomainUpDown control. In .NET 7 and later versions, instances of type AccessibleObject are used to represent items in a DomainUpDown control for accessibility tools.
Workarounds
Remove invocations of the public constructor for the DomainUpDown.DomainItemAccessibleObject type. Use System.Windows.Forms.AccessibleObject instead.
Suppress a warning
If you must use the obsolete APIs, you can suppress the warning in code or in your project file.
To suppress only a single violation, add preprocessor directives to your source file to disable and then re-enable the warning.
// Disable the warning.
#pragma warning disable WFDEV003
// Code that uses obsolete API.
// ...
// Re-enable the warning.
#pragma warning restore WFDEV003
To suppress all the WFDEV003
warnings in your project, add a <NoWarn>
property to your project file.
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<NoWarn>$(NoWarn);WFDEV003</NoWarn>
</PropertyGroup>
</Project>
For more information, see Suppress warnings.
.NET Desktop feedback
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for