WFDEV002: DomainUpDownAccessibleObject should not be used

Any reference to System.Windows.Forms.DomainUpDown.DomainUpDownAccessibleObject will result in warning WFDEV002. This warning states that DomainUpDown.DomainUpDownAccessibleObject is no longer used to provide accessible support for DomainUpDown controls. The DomainUpDown.DomainUpDownAccessibleObject type was never intended for public use.

Note

This warning was promoted to an error starting in .NET 8, and you can no longer suppress the error. For more information, see WFDEV002 obsoletion is now an error.

Workarounds

Suppress a warning (.NET 7 only)

If you must use the obsolete API, 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 WFDEV002

// Code that uses obsolete API.
// ...

// Re-enable the warning.
#pragma warning restore WFDEV002

To suppress all the WFDEV002 warnings in your project, add a <NoWarn> property to your project file.

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
   ...
   <NoWarn>$(NoWarn);WFDEV002</NoWarn>
  </PropertyGroup>
</Project>

For more information, see Suppress warnings.