Skip to content

How to reference System.Design #221

Closed

Description

@livarcocc

@jnm2 commented on Thu Sep 13 2018

When converting the project to netcoreapp3.0 and keeping the System.Design reference, the compiler doesn't seem to see the reference:

CS0012 The type 'ComponentDesigner' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
    <!-- ... -->
  </PropertyGroup>

  <ItemGroup>
    <Reference Include="System.Design" />
    <!-- ... -->
    <FrameworkReference Include="Microsoft.DesktopUI" />
  </ItemGroup>

</Project>

How will this work in the future?

(edit) This gets it to build:

    <Reference Include="System.Design" HintPath="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Design.dll" />

But since System.Design is heavily used at runtime, I'm doubtful that the .NET Framework's System.Design will work.


@OliaG commented on Mon Sep 17 2018

Hi Joseph,
Thanks for reaching out! The types you mentioned are not added in Core 3.0, we are still finalizing the list of the APIs for Core 3.0, so we'd like to know more about your scenarios. Could you tell us how you are using these types in your app?

Also if you haven't done it yet, I would suggest running Portability Analyzer that will show all APIs in your app that are not yet included in .NET Core 3.0.


@jnm2 commented on Tue Sep 18 2018

Hi Olia,

Our applications depend on DevExpress's End User Report Designer (docs). DevExpress built it on top of the System.ComponentModel/IDesignerHost/CodeDOM set of abstractions, very much like the Windows Forms designer itself.

This designer ships for our users at runtime (as the name suggests). We've written custom reporting elements that integrate with it. Since DevExpress based the designer heavily on System.Design, our integrations with the report designer are also tied to System.Design. We're hoping that this doesn't keep us from moving to .NET Core.

In this report, see especially DevExpress.XtraReports.v17.2.Extensions.dll which houses their End User Report Designer: Portability report for DevExpress dependencies.xlsx

That's what DevExpress's code needs. Our code, which merely integrates with DevExpress's report designer, ends up directly using these types:

Details
T:System.ComponentModel.Design.CollectionEditor
T:System.ComponentModel.Design.CollectionEditor.CollectionForm
T:System.ComponentModel.Design.ComponentDesigner
T:System.ComponentModel.Design.DesignerActionItem
T:System.ComponentModel.Design.DesignerActionItemCollection
T:System.ComponentModel.Design.DesignerActionList
T:System.ComponentModel.Design.DesignerActionListCollection
T:System.ComponentModel.Design.DesignerActionMethodItem
T:System.ComponentModel.Design.DesignerActionPropertyItem
T:System.ComponentModel.Design.DesignerActionTextItem
T:System.ComponentModel.Design.DesignerActionUIService
T:System.ComponentModel.Design.DesignerActionUIStateChangeEventArgs
T:System.ComponentModel.Design.DesignerActionUIStateChangeEventHandler
T:System.ComponentModel.Design.DesignerActionUIStateChangeType
T:System.ComponentModel.Design.MultilineStringEditor
T:System.ComponentModel.Design.Serialization.CodeDomSerializer
T:System.ComponentModel.Design.Serialization.CodeDomSerializerBase
T:System.ComponentModel.Design.Serialization.DesignerSerializationManager
T:System.Drawing.Design.IToolboxService
T:System.Drawing.Design.ToolboxItem
T:System.Drawing.Design.ToolboxItemCollection
T:System.Windows.Forms.Design.AnchorEditor
T:System.Windows.Forms.Design.Behavior.Behavior
T:System.Windows.Forms.Design.Behavior.BehaviorService
T:System.Windows.Forms.Design.Behavior.ControlBodyGlyph
T:System.Windows.Forms.Design.Behavior.GlyphSelectionType
T:System.Windows.Forms.Design.ControlDesigner
T:System.Windows.Forms.Design.ParentControlDesigner
T:System.Windows.Forms.Design.ScrollableControlDesigner
T:System.Windows.Forms.Design.SelectionRules

And these members:

Details
M:System.ComponentModel.Design.CollectionEditor.#ctor(System.Type)
M:System.ComponentModel.Design.CollectionEditor.CollectionForm.#ctor(System.ComponentModel.Design.CollectionEditor)
M:System.ComponentModel.Design.CollectionEditor.CollectionForm.OnEditValueChanged
M:System.ComponentModel.Design.CollectionEditor.CollectionForm.get_Items
M:System.ComponentModel.Design.CollectionEditor.CollectionForm.set_Items(System.Object[])
M:System.ComponentModel.Design.CollectionEditor.get_Context
M:System.ComponentModel.Design.ComponentDesigner.#ctor
M:System.ComponentModel.Design.ComponentDesigner.GetService(System.Type)
M:System.ComponentModel.Design.ComponentDesigner.InitializeNewComponent(System.Collections.IDictionary)
M:System.ComponentModel.Design.ComponentDesigner.PostFilterAttributes(System.Collections.IDictionary)
M:System.ComponentModel.Design.ComponentDesigner.PostFilterProperties(System.Collections.IDictionary)
M:System.ComponentModel.Design.ComponentDesigner.get_Component
M:System.ComponentModel.Design.ComponentDesigner.get_Verbs
M:System.ComponentModel.Design.DesignerActionItemCollection.#ctor
M:System.ComponentModel.Design.DesignerActionItemCollection.Add(System.ComponentModel.Design.DesignerActionItem)
M:System.ComponentModel.Design.DesignerActionList.#ctor(System.ComponentModel.IComponent)
M:System.ComponentModel.Design.DesignerActionList.GetService(System.Type)
M:System.ComponentModel.Design.DesignerActionList.get_Component
M:System.ComponentModel.Design.DesignerActionList.set_AutoShow(System.Boolean)
M:System.ComponentModel.Design.DesignerActionListCollection.#ctor(System.ComponentModel.Design.DesignerActionList[])
M:System.ComponentModel.Design.DesignerActionListCollection.Insert(System.Int32,System.ComponentModel.Design.DesignerActionList)
M:System.ComponentModel.Design.DesignerActionListCollection.get_Item(System.Int32)
M:System.ComponentModel.Design.DesignerActionMethodItem.#ctor(System.ComponentModel.Design.DesignerActionList,System.String,System.String)
M:System.ComponentModel.Design.DesignerActionMethodItem.#ctor(System.ComponentModel.Design.DesignerActionList,System.String,System.String,System.String)
M:System.ComponentModel.Design.DesignerActionPropertyItem.#ctor(System.String,System.String)
M:System.ComponentModel.Design.DesignerActionTextItem.#ctor(System.String,System.String)
M:System.ComponentModel.Design.DesignerActionUIService.HideUI(System.ComponentModel.IComponent)
M:System.ComponentModel.Design.DesignerActionUIService.Refresh(System.ComponentModel.IComponent)
M:System.ComponentModel.Design.DesignerActionUIService.ShowUI(System.ComponentModel.IComponent)
M:System.ComponentModel.Design.DesignerActionUIService.add_DesignerActionUIStateChange(System.ComponentModel.Design.DesignerActionUIStateChangeEventHandler)
M:System.ComponentModel.Design.DesignerActionUIService.remove_DesignerActionUIStateChange(System.ComponentModel.Design.DesignerActionUIStateChangeEventHandler)
M:System.ComponentModel.Design.DesignerActionUIStateChangeEventArgs.get_ChangeType
M:System.ComponentModel.Design.DesignerActionUIStateChangeEventHandler.#ctor(System.Object,System.IntPtr)
M:System.ComponentModel.Design.Serialization.CodeDomSerializer.#ctor
M:System.ComponentModel.Design.Serialization.CodeDomSerializer.Deserialize(System.ComponentModel.Design.Serialization.IDesignerSerializationManager,System.Object)
M:System.ComponentModel.Design.Serialization.CodeDomSerializer.Serialize(System.ComponentModel.Design.Serialization.IDesignerSerializationManager,System.Object)
M:System.ComponentModel.Design.Serialization.CodeDomSerializerBase.DeserializeExpression(System.ComponentModel.Design.Serialization.IDesignerSerializationManager,System.String,System.CodeDom.CodeExpression)
M:System.ComponentModel.Design.Serialization.CodeDomSerializerBase.GetExpression(System.ComponentModel.Design.Serialization.IDesignerSerializationManager,System.Object)
M:System.ComponentModel.Design.Serialization.CodeDomSerializerBase.SerializeToExpression(System.ComponentModel.Design.Serialization.IDesignerSerializationManager,System.Object)
M:System.ComponentModel.Design.Serialization.DesignerSerializationManager.#ctor
M:System.ComponentModel.Design.Serialization.DesignerSerializationManager.CreateSession
M:System.ComponentModel.Design.Serialization.DesignerSerializationManager.get_Errors
M:System.Drawing.Design.IToolboxService.AddToolboxItem(System.Drawing.Design.ToolboxItem)
M:System.Drawing.Design.IToolboxService.GetToolboxItems
M:System.Drawing.Design.IToolboxService.RemoveToolboxItem(System.Drawing.Design.ToolboxItem)
M:System.Drawing.Design.ToolboxItem.get_TypeName
M:System.Windows.Forms.Design.AnchorEditor.#ctor
M:System.Windows.Forms.Design.Behavior.Behavior.#ctor(System.Boolean,System.Windows.Forms.Design.Behavior.BehaviorService)
M:System.Windows.Forms.Design.Behavior.Behavior.FindCommand(System.ComponentModel.Design.CommandID)
M:System.Windows.Forms.Design.Behavior.BehaviorService.GetNextBehavior(System.Windows.Forms.Design.Behavior.Behavior)
M:System.Windows.Forms.Design.Behavior.BehaviorService.PopBehavior(System.Windows.Forms.Design.Behavior.Behavior)
M:System.Windows.Forms.Design.Behavior.BehaviorService.PushBehavior(System.Windows.Forms.Design.Behavior.Behavior)
M:System.Windows.Forms.Design.Behavior.BehaviorService.get_CurrentBehavior
M:System.Windows.Forms.Design.Behavior.ControlBodyGlyph.#ctor(System.Drawing.Rectangle,System.Windows.Forms.Cursor,System.ComponentModel.IComponent,System.Windows.Forms.Design.ControlDesigner)
M:System.Windows.Forms.Design.ControlDesigner.#ctor
M:System.Windows.Forms.Design.ControlDesigner.OnDragDrop(System.Windows.Forms.DragEventArgs)
M:System.Windows.Forms.Design.ControlDesigner.OnDragEnter(System.Windows.Forms.DragEventArgs)
M:System.Windows.Forms.Design.ControlDesigner.OnDragLeave(System.EventArgs)
M:System.Windows.Forms.Design.ControlDesigner.OnDragOver(System.Windows.Forms.DragEventArgs)
M:System.Windows.Forms.Design.ControlDesigner.OnGiveFeedback(System.Windows.Forms.GiveFeedbackEventArgs)
M:System.Windows.Forms.Design.ControlDesigner.OnSetCursor
M:System.Windows.Forms.Design.ControlDesigner.get_Control
M:System.Windows.Forms.Design.ControlDesigner.get_ParticipatesWithSnapLines
M:System.Windows.Forms.Design.ControlDesigner.get_SelectionRules
M:System.Windows.Forms.Design.ControlDesigner.set_AutoResizeHandles(System.Boolean)
M:System.Windows.Forms.Design.ParentControlDesigner.#ctor
M:System.Windows.Forms.Design.ParentControlDesigner.Dispose(System.Boolean)
M:System.Windows.Forms.Design.ParentControlDesigner.Initialize(System.ComponentModel.IComponent)
M:System.Windows.Forms.Design.ParentControlDesigner.InitializeNewComponent(System.Collections.IDictionary)
M:System.Windows.Forms.Design.ParentControlDesigner.OnDragDrop(System.Windows.Forms.DragEventArgs)
M:System.Windows.Forms.Design.ParentControlDesigner.OnDragEnter(System.Windows.Forms.DragEventArgs)
M:System.Windows.Forms.Design.ParentControlDesigner.OnDragLeave(System.EventArgs)
M:System.Windows.Forms.Design.ParentControlDesigner.OnDragOver(System.Windows.Forms.DragEventArgs)
M:System.Windows.Forms.Design.ParentControlDesigner.OnPaintAdornments(System.Windows.Forms.PaintEventArgs)
M:System.Windows.Forms.Design.ScrollableControlDesigner.#ctor

@OliaG commented on Tue Sep 18 2018

Thank you, Joseph! I'll get our engineers to look at it and follow up with you.


@filipnavara commented on Tue Sep 18 2018

We have similar dependencies for our custom WinForms controls too. The missing API set is nearly identical. In our case they are design-time only and we have a build option to strip them out of release builds, so we are still able to run our application on .NET Core 3 alpha today (with some additional fixes discussed in the CoreFX repository issues).

I suspect this will come up quite often and it has to be addressed in one way or another. I was hoping that this will eventually come later when the WinForms design-time support is brought in later preview. I'm taking a wait-and-see approach on this one, but wanted to express some support that the scenario is probably common.


@OliaG commented on Tue Sep 18 2018

Thank you Filip!
@Tanya-Solyanik


@lextm commented on Thu Dec 06 2018

I think <Reference Include="System.Design" /> should not work by design. There is no GAC for .NET Core, so there is no place to resolve such assemblies.

Ideally such should come in Windows Compatibility Pack for .NET Core, or Microsoft.WindowsDesktop.App.


@jnm2 commented on Thu Dec 06 2018

@lextm I was thinking System.Design should be part of <FrameworkReference Include="Microsoft.DesktopUI" />.


@damageboy commented on Sat Dec 08 2018

Same here...
Trying to test our WinForms stuff in .NET Core 3.0 and hitting up on these missing APIs as part of property-grid related runtime support.

In my case the missing types are:

  • CollectionEditor
  • ObjectSelectorEditor

@dreddy-work commented on Sat Dec 08 2018

We will be taking a look at porting these editors soon.


@livarcocc commented on Sun Dec 09 2018

@dreddy-work should we move this issue to dotnet/winforms?


@dreddy-work commented on Sun Dec 09 2018

@livarcocc , yes please. we will be looking into these coming week.


@damageboy commented on Sun Dec 09 2018

Just to be completely clear. My current issue is simply compiling custom property grid editors that inherit from the said *Editor base classes as I have a property grid that presents custom editors @ runtime (not at design time).

This is not a VS designer issue, at least as far as I am concerned..


@dreddy-work commented on Sun Dec 09 2018

@damageboy , I understand. When we were porting editors to netcore, our analysis was, the above said editors will be used mostly at the design time and hence prioritized that way. Now that we see runtime usage for these editors, we are discussing to port these editors to net core in the coming weeks.

Activity

  1. zsd4yr commented on Dec 10, 2018

    @zsd4yr
    Contributor

    Can you not reference the facades in source?

  2. dreddy-work commented on Dec 10, 2018

    @dreddy-work
    Member

    @zsd4yr, we need to port these editors to core. This is issue is ported from core to here.

  3. added
    tenet-compatibility
    on Dec 10, 2018
  4. jnm2 commented on Dec 10, 2018

    @jnm2
    Contributor

    Just to clarify, more types than just CollectionEditor and ObjectSelectorEditor are needed at runtime by our customers. Types such as DesignerActionList (full list) are also used by our customers at runtime because we integrate with DevExpress's end user report designer.

  5. zsd4yr commented on Dec 10, 2018

    @zsd4yr
    Contributor

    I believe we initially did not port these because we expected that they were primarily used / only used in design-time scenarios. I see that this supposition is not the case, so we need ot get moving on porting these.

  6. added this to the milestone on Dec 10, 2018
  7. zsd4yr commented on Jan 10, 2019

    @zsd4yr
    Contributor

    @dreddy-work, this is still WIP, correct?

  8. wjk commented on Jan 24, 2019

    @wjk
    Contributor

    Is there any reason why the Windows Forms designer hosting code is intended to remain usable on .NET Framework only? This seems to me like a strange decision. Even though VS is the main consumer of the designer hosting classes, and VS must remain on Framework for compatibility reasons, it is entirely possible for other projects to want to host a Forms designer.

    Furthermore, I know of one project (AeroWizard) that includes extensive custom designer integration that references these classes. Would the lack of usable designer classes result in a NotImplementedException being thrown at runtime?

  9. AraHaan commented on Jan 26, 2019

    @AraHaan
    Member

    Also for the fact that others (like me) would like to hack on some modifications to the forms designer as well for reasons stated in #147 and would like to use those experiments to that and possibly experiments to roslyn inside of Visual Studio as well (like if they wanted the forms designer to stop making background compilations and then use reflection and instead load the things needed for the component (like resources, api calls, etc) and display it like normal).

    I remember fileing a issue before on it on the Visual Studio sugesstions as well. I would just like if it was possible to experiment with the original code.

  10. self-assigned this
    on Feb 7, 2019
  11. modified the milestones: , 3.0 - Preview 8 on Apr 20, 2019
  12. merriemcgaw commented on Apr 23, 2019

    @merriemcgaw
    Contributor

    We've ported all the types we are aware of people needing, please file new issues if you run into something that isn't there and you expect it. We will add tests as time permits.

  13. ericoporto commented on Jul 26, 2019

    @ericoporto

    Hey, I am hitting this at Dotnet core 3.0 Preview 7, checking the above, it seems it will be only on 3.0 Preview 8 (from the milestone). Is this it, or I was supposed to be able to get System.Design on Preview 7?

  14. RussKie commented on Jul 26, 2019

    @RussKie
    Contributor

    @ericoporto please open a new issue and provide all necessary information.

  15. jnm2 commented on Jul 26, 2019

    @jnm2
    Contributor

    @ericoporto You aren't reading the (confusing) GitHub message correctly; the removed milestones are listed before the added ones. You can verify by looking in the sidebar that the current milestone is Preview 6:

    image

  16. ghost locked as resolved and limited conversation to collaborators on Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

tenet-compatibility

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions