-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
IComponent is missing designer attributes #31428
Comments
We would have to push DesignerAttribute down from System.ComponentModel.TypeConverter into System.ComponentModel.Primitives (or lower, like System.ObjectModel) in order to do this. We don't normally make such changes in servicing. How critical is this? Should we be rushing to get this in 3.1 (it's effectively done) or do you have a workaround / not need this for 3.x? |
I'm working around it in the WinForms designer, so we don't need it for 3.1. We'll need it eventually as runtime |
Got it, we can fix in 5.0. We should also push the EditorAttribute down (and potentially any other related attributes) so that we can address these and related issues. |
I'm betting there's other DesignerAttributes missing too (e.g. Process?), but I only found this one as we've started working on the component tray. |
Have a look here to see if any of these look important: https://github.com/dotnet/corefx/blob/df40a0d4b44d1666971504c8e87379abe7242610/eng/DefaultGenApiDocIds.txt#L3-L8 |
Serializers, Editor, and typeDescriptionProvider are definitely important if any runtime scenario is using property grid or design time serialization. For the toolbox we are using a different approach than what was used in the .NET designer, and I don't know about the runtime uses for it. Maybe devexpress reports use it. |
I'm pretty sure that |
@DustinCampbell is this still important or are you OK with your workarounds? Fixing this requires moving types around which is not something we like to do unless there is a very strong need. |
So the following attributes need to be applied to all the types that had them in desktop:
These types should be pushed down as low as necessary to apply them in all cases. In places where these attributes depend on other types, like here Line 23 in 0e23ef4
We should avoid that dependency by using type name, as is done here: Line 40 in 0e23ef4
cc @Anipik since this is related to work he's doing WRT attributes in references. |
@DustinCampbell -- thanks for the heads up. Will re-open, and will move to 5.0.x so that we can fix that on the first servicing release. |
Also, |
Thanks @safern! Is |
You're right... somehow I can't read anymore and read |
@DustinCampbell is this important to service in 5.0? Does it need to be serviced in the reference assemblies as well? |
I do think it's important to service in 5.0, but I don't think it's required in the reference assemblies? Typically, the designer acquires information like attributes from the runtime types or component instances. |
Do you think you could share a repro that demonstrates the bug so that we can both validate the fix is working and determine if reference update is necessary? I'm a bit surprised the designer has access to runtime assemblies, for instance in the case where the app is targeting |
The repro would be to create an 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
Everything is done via reflection using In the .NET Core designer, we construct a server process (much like WPF does) using a runtimeconfig.json and deps.json that matches up with the user's project. That way, the process runs using the runtime, NuGet references, etc. that the user's app targets. So, the designer will be running on the same RID that the user is targeting. So, the runtime assemblies that it needs are in the default |
Opening to track porting it to 5.0 |
Port is merged. |
In particular,
IComponent
is missing the following two attributes, which were defined on .NET Framework:This affects both designer and runtime
IDesignerHost
scenarios. cc @ericstj.While we've worked around this in our designer by hard-coding knowledge of
IComponent
's missing attributes in our ownIDesignerHost
implementation, third-parties would be hard-pressed to do the same for runtime scenarios where the designer is hosted in an application at runtime. An example of such a scenario is DevExpress's Reporting library where they allow a report designer based on CodeDom serialization to embedded directly into an end user application. This is a very meaningful for certain line-of-business apps.The text was updated successfully, but these errors were encountered: