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) #44899

Merged
merged 1 commit into from
Nov 24, 2020

Conversation

safern
Copy link
Member

@safern safern commented Nov 18, 2020

Fixes #31428

Backport of #44774 to release/5.0

Customer Impact

This blocks designer scenarios where the user opens a component or control as a root designer. When the user drops some component on a form designer, the designer host will already had a root component. So, it'll ask to create a designer with a base type of IDesigner. However, if the user double-clicks a component or control in the Solution Explorer, it'll be opened as the root component. So, the designer host will ask to create a designer with a base type of IRootDesigner. Without this change, the latter case is broken. I can work around it in the new designer, but'll still be broken from runtime designer hosting scenarios.

Testing

I manually tested this by creating a winforms app with the fix and follwing:

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.

and now ComponentDocumentDesigner is returned correctly when using typeof(IRootDesigner).

Risk

I believe the risk is low as it is just updating an attribute that is used by the winforms designer.

cc: @danmosemsft @DustinCampbell

…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 safern added the Servicing-consider Issue for next servicing release review label Nov 18, 2020
@safern safern requested a review from ericstj November 18, 2020 21:52
@ghost
Copy link

ghost commented Nov 18, 2020

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

Issue Details
Description:

Fixes #31428

Backport of #44774 to release/5.0

Customer Impact

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.

This blocks designer scenarios where the user opens a component or control as a root designer. When the user drops some component on a form designer, the designer host will already had a root component. So, it'll ask to create a designer with a base type of IDesigner. However, if the user double-clicks a component or control in the Solution Explorer, it'll be opened as the root component. So, the designer host will ask to create a designer with a base type of IRootDesigner. Without this change, the latter case is broken. I can work around it in the new designer, but'll still be broken from runtime designer hosting scenarios.

Testing

I manually tested this by creating a winforms app with the fix and follwing:

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.

and now ComponentDocumentDesigner is returned correctly when using typeof(IRootDesigner).

Risk

I believe the risk is low as it is just updating an attribute that is used by the winforms designer.

cc: @danmosemsft @DustinCampbell

Author: safern
Assignees: -
Labels:

Servicing-consider, area-System.ComponentModel

Milestone: -

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

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

LGTM, assuming manual tests pass. Thank you for fixing!

@leecow leecow added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Nov 24, 2020
@leecow leecow added this to the 5.0.1 milestone Nov 24, 2020
@safern safern merged commit 3700448 into dotnet:release/5.0 Nov 24, 2020
@safern safern deleted the PortDesignerAttributeFix branch November 24, 2020 20:28
RussKie added a commit to dotnet/winforms that referenced this pull request Nov 26, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Dec 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants