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

Fix ComponentDocumentDesigner references in DesignerAttribute to include right base type #44774

Merged
merged 3 commits into from
Nov 18, 2020

Conversation

safern
Copy link
Member

@safern safern commented Nov 17, 2020

Fixes: #31428

@ghost
Copy link

ghost commented Nov 17, 2020

Tagging subscribers to this area: @safern
See info in area-owners.md if you want to be subscribed.

Issue Details
Description:

Fixes: #31428

Author: safern
Assignees: -
Labels:

area-System.ComponentModel

Milestone: -

@@ -181,7 +181,7 @@ public sealed partial class EventHandlerList : System.IDisposable
public void RemoveHandler(object key, System.Delegate? value) { }
}
[System.ComponentModel.DesignerAttribute("System.ComponentModel.Design.ComponentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.DesignerAttribute("System.Windows.Forms.Design.ComponentDocumentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
[System.ComponentModel.DesignerAttribute("System.Windows.Forms.Design.ComponentDocumentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.ComponentModel.Design.IRootDesigner))]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need the fully qualified name for this one. It lives in TypeConverter on core. It lived in System on .NETFramework. Let's use the .NETFramework identity.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I fixed this and also fixed another instance of this in another DesignerAttribute that used this designer.

@ericstj
Copy link
Member

ericstj commented Nov 17, 2020

We should make sure to test this. @DustinCampbell suggested

The repro would be to create an IComponent instance and call TypeDescriptor.CreateDesigner(...) with the base type as typeof(IDesigner) and then again with typeof(IRootDesigner). Today, both calls will return ComponentDesigner, but the second should return ComponentDocumentDesigner.

We'd need changes to our test infra to do that in a our unit tests, since it'd require a windows desktop shared framework, but we should make sure we at least manually verify this.

@safern
Copy link
Member Author

safern commented Nov 17, 2020

Sounds good. I'll test this locally.

@safern safern changed the title Fix IComponent Designer attribute that was missing base designer type Fix ComponentDocumentDesigner references in DesignerAttribute to include right base type Nov 18, 2020
@@ -1,8 +1,18 @@
Compat issues with assembly System.Diagnostics.Process:
Compat issues with assembly netstandard:
CannotChangeAttribute : Attribute 'System.ComponentModel.DesignerAttribute' on 'System.ComponentModel.IComponent' changed from '[DesignerAttribute("System.ComponentModel.Design.ComponentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]' in the contract to '[DesignerAttribute("System.ComponentModel.Design.ComponentDesigner, System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]' in the implementation.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that we're catching this now as a diff with past release. Does API compat flag the original issue as a diff with netfx? If so are there any other similar diffs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it didn't catch it. I don't know why. Based on reading these errors, it seems like APICompat is not catching the right "Diff" the diff is in the DesignerAttribute that specifies a ComponentDocumentDesigner.

This is the only diff I get on my local build and on CI.

@safern
Copy link
Member Author

safern commented Nov 18, 2020

I tested this locally using the local runtime pack we build in dotnet/runtime and I can see the issue no longer repros. I reproed and then applied the fix and it is no longer showing up. Merging this.

@safern safern merged commit a60137c into dotnet:master Nov 18, 2020
@safern safern deleted the FixIComponentDesigner branch November 18, 2020 21:37
@safern
Copy link
Member Author

safern commented Nov 18, 2020

/backport to release/5.0

@github-actions
Copy link
Contributor

Started backporting to release/5.0: https://github.com/dotnet/runtime/actions/runs/371087316

@github-actions
Copy link
Contributor

@safern backporting to release/5.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Fix IComponent Designer attribute that was missing base designer type
Applying: Fix IRootDesigner references to use assembly qualified name
Applying: Fix build failures
error: sha1 information is lacking or useless (src/libraries/System.ComponentModel.TypeConverter/ref/System.ComponentModel.TypeConverter.cs).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0003 Fix build failures
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

safern added a commit to safern/runtime that referenced this pull request Nov 18, 2020
…ude right base type (dotnet#44774)

* Fix IComponent Designer attribute that was missing base designer type

* Fix IRootDesigner references to use assembly qualified name

* Fix build failures
safern added a commit that referenced this pull request Nov 24, 2020
…ude right base type (#44774) (#44899)

* Fix IComponent Designer attribute that was missing base designer type

* Fix IRootDesigner references to use assembly qualified name

* Fix build failures
@ghost ghost locked as resolved and limited conversation to collaborators Dec 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

IComponent is missing designer attributes
3 participants