winforms icon indicating copy to clipboard operation
winforms copied to clipboard

Removed obsolete `DomainUpDownAccessibleObject` usage

Open vladimir-krestov opened this issue 3 years ago • 6 comments

Fixes #7587

Proposed changes

  • Remove DomainUpDownAccessibleObject usage as an accessible object for DomainUpDown because this class is obsolete now

Customer Impact

  • No

Regression?

  • No

Risk

  • Minimal

Test environment(s)

  • .NET 7.0 RC1
  • Windows 11
Microsoft Reviewers: Open in CodeFlow

vladimir-krestov avatar Aug 12 '22 15:08 vladimir-krestov

@vladimir-krestov , may be i missed context. Which class is obsolete now? and how obsolete class makes removal of accessibility object? people may still use obsolete class .

dreddy-work avatar Aug 12 '22 19:08 dreddy-work

@vladimir-krestov , may be i missed context. Which class is obsolete now? and how obsolete class makes removal of accessibility object? people may still use obsolete class .

nevermind, i am following discussion on original thread.

dreddy-work avatar Aug 12 '22 19:08 dreddy-work

Closed this according to https://github.com/dotnet/winforms/pull/7330#discussion_r944772133

vladimir-krestov avatar Aug 12 '22 21:08 vladimir-krestov

Re-opening for .NET 8. I also suggest changing warnings to errors

Tanya-Solyanik avatar Aug 13 '22 02:08 Tanya-Solyanik

I think that we either need to take this in .NET 7 or undo this obsoletion https://github.com/dotnet/winforms/blob/01abac5b35616f182267222da1976d429e1eab19/src/System.Windows.Forms/src/System/Windows/Forms/DomainUpDown.DomainUpDownAccessibleObject.cs#L11-L17

RussKie avatar Aug 15 '22 08:08 RussKie

We obsoleted that type as a compile time warning, applications still can use it. This gives developers time to re-write applications if needed.

Tanya-Solyanik avatar Aug 16 '22 05:08 Tanya-Solyanik

Removing this would be binary breaking which we don't want to do. We should mark it as Obsolete as Error.

merriemcgaw avatar Oct 18 '22 23:10 merriemcgaw

We still can remove the CreateAccessibleObject override. Error message should specify how to fix the error, i.e. "use the base class instead" I think the public base class is ControlAccessibleObject and AccessibleObject for items, but please verify that.

Tanya-Solyanik avatar Oct 19 '22 00:10 Tanya-Solyanik

Once the PR is merged, I will create a request issue in https://github.com/dotnet/docs to add a breaking change and update existing page for WFDEV002 obsoletion.

dmitrii-drobotov avatar Nov 09 '22 15:11 dmitrii-drobotov

@dmitrii-drobotov Verified on latest .NET 8.0.100-alpha.1.22567.28 build + private dll, this issue still reproduces. Error message does not contain this line "Use ControlAccessibleObject instead". Screenshot as below: Screenshot 2022-11-18 003300

MelonWang1 avatar Nov 18 '22 08:11 MelonWang1

@dmitrii-drobotov Verified on latest .NET 8.0.100-alpha.1.22567.28 build + private dll, this issue still reproduces. Error message does not contain this line "Use ControlAccessibleObject instead". Screenshot as below: Screenshot 2022-11-18 003300

@MelonWang1 Looks like you also need to replace System.Windows.Forms.dll in C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref\[version]\ref\net8.0 folder: image I believe this is where VS takes this info from.

dmitrii-drobotov avatar Nov 18 '22 16:11 dmitrii-drobotov

@dmitrii-drobotov Thank you, verified on latest .NET 8.0.100-alpha.1.22567.28 build + private dll + replace System.Windows.Forms.dll in C:\Program Files\dotnet\packs\Microsoft.WindowsDesktop.App.Ref[version]\ref\net8.0 folder, this issue was fixed. Error message contain this line "Use ControlAccessibleObject instead". Screenshot as below: Screenshot 2022-11-20 174219

MelonWang1 avatar Nov 21 '22 01:11 MelonWang1