dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.36k stars 965 forks source link

Winforms designer exception with my custom control #3316

Closed cadilhac closed 2 years ago

cadilhac commented 4 years ago

Problem description: I'm the developer of Smart PropertyGrid.Net (VisualHint company) and I am trying to port my component to .net core 3. It works well but I was unable to use the forms designer so far. I was happy to read this morning that the winforms designer could now be used with custom controls so I updated VS2019 to the latest 16.7.0 preview 1. When I try to open a form containing my custom PropertyGrid, I get this error from the designer: "Unable to find method 'SendRequestAsync/2' on {no object} for the following reasons: An argument was not supplied for a required parameter.

Here is the call stack:


at StreamJsonRpc.JsonRpc.d__116`1.MoveNext()

--- End of  stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.WinForms.Protocol.WinFormsServer.d__31`1.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.<>c__DisplayClass54_0.<b__0>d.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1 asyncMethod,  JoinableTaskCreationOptions creationOptions)
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1  asyncMethod)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.Run[T](Func`1 func)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.InitializeRootComponent(CodeTypeDeclaration  typeDeclaration)
at  Microsoft.VisualStudio.WinForms.RemoteClient.Loader.RemoteCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  manager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
--- End of stack trace from previous location where  exception was thrown ---
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32  fReload) | 
at StreamJsonRpc.JsonRpc.d__116`1.MoveNext()
--- End of  stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.WinForms.Protocol.WinFormsServer.d__31`1.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.<>c__DisplayClass54_0.<b__0>d.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1 asyncMethod,  JoinableTaskCreationOptions creationOptions)
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1  asyncMethod)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.Run[T](Func`1 func)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.InitializeRootComponent(CodeTypeDeclaration  typeDeclaration)
at  Microsoft.VisualStudio.WinForms.RemoteClient.Loader.RemoteCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  manager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
--- End of stack trace from previous location where  exception was thrown ---
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32  fReload) | 
at StreamJsonRpc.JsonRpc.d__116`1.MoveNext()
--- End of  stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.WinForms.Protocol.WinFormsServer.d__31`1.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.<>c__DisplayClass54_0.<b__0>d.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1 asyncMethod,  JoinableTaskCreationOptions creationOptions)
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1  asyncMethod)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.Run[T](Func`1 func)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.InitializeRootComponent(CodeTypeDeclaration  typeDeclaration)
at  Microsoft.VisualStudio.WinForms.RemoteClient.Loader.RemoteCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  manager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
--- End of stack trace from previous location where  exception was thrown ---
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32  fReload)
-- | -- | --
at StreamJsonRpc.JsonRpc.d__116`1.MoveNext()
--- End of  stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.WinForms.Protocol.WinFormsServer.d__31`1.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.<>c__DisplayClass54_0.<b__0>d.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1 asyncMethod,  JoinableTaskCreationOptions creationOptions)
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1  asyncMethod)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.Run[T](Func`1 func)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.InitializeRootComponent(CodeTypeDeclaration  typeDeclaration)
at  Microsoft.VisualStudio.WinForms.RemoteClient.Loader.RemoteCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  manager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
--- End of stack trace from previous location where  exception was thrown ---
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32  fReload) | 
at StreamJsonRpc.JsonRpc.d__116`1.MoveNext()
--- End of  stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.WinForms.Protocol.WinFormsServer.d__31`1.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.<>c__DisplayClass54_0.<b__0>d.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1 asyncMethod,  JoinableTaskCreationOptions creationOptions)
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1  asyncMethod)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.Run[T](Func`1 func)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.InitializeRootComponent(CodeTypeDeclaration  typeDeclaration)
at  Microsoft.VisualStudio.WinForms.RemoteClient.Loader.RemoteCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  manager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
--- End of stack trace from previous location where  exception was thrown ---
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32  fReload)
at StreamJsonRpc.JsonRpc.d__116`1.MoveNext()
--- End of  stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.WinForms.Protocol.WinFormsServer.d__31`1.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.<>c__DisplayClass54_0.<b__0>d.MoveNext()
---  End of stack trace from previous location where exception was thrown ---
at  System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at  System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task  task)
at  Microsoft.VisualStudio.Threading.JoinableTask.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTask`1.CompleteOnCurrentThread()
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1 asyncMethod,  JoinableTaskCreationOptions creationOptions)
at  Microsoft.VisualStudio.Threading.JoinableTaskFactory.Run[T](Func`1  asyncMethod)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.Run[T](Func`1 func)
at  Microsoft.VisualStudio.Design.Remote.DesignerSession.InitializeRootComponent(CodeTypeDeclaration  typeDeclaration)
at  Microsoft.VisualStudio.WinForms.RemoteClient.Loader.RemoteCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  manager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
--- End of stack trace from previous location where  exception was thrown ---
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager  serializationManager)
at  Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.DeferredLoadHandler.Microsoft.VisualStudio.TextManager.Interop.IVsTextBufferDataEvents.OnLoadCompleted(Int32  fReload)

Expected behavior: Form should open and show my custom controls.

Minimal repro: For an exact repro, you need to download the product trial, open the sample and then the form. I read that you work with product vendors (the main ones). I am not a "big one" but if you need to contact me to fix this issue, don't hesitate to do so.

OliaG commented 4 years ago

@cadilhac, thanks for reporting this issue. We just started our work on third-party controls, so it is in progress and some things may not work yet.

That being said, is it possible you are having issues with licensing of your controls because LICX is not supported in .NET Core? Also have you tried running portability analyzer on your code to ensure you don't have any dependencies on APIs that are not supported in .NET Core https://devblogs.microsoft.com/dotnet/are-your-windows-forms-and-wpf-applications-ready-for-net-core-3-0/

Tanya-Solyanik commented 4 years ago

@cadilhac - Your trial version is targeting .Net Framework, and it has licensing implemented. Licensing is not fully done in Core yet, so this is not expected to work. I also guess that you have some design time components, ControlDesigners, UITypeEditors, TypeConverters, Serializers, these should be re-implemented and should take dependency on our new set of base classes, we are still working of the specific guidelines and on our re-distributable package. Could you please describe your design time support in more details.

merriemcgaw commented 4 years ago

We're working with third party control vendors to make things work in the new designer. We've been making progress and will be releasing guidance to vendors in the not too distant future. There will necessarily be a new paradigm for creating control designers in Visual Studio due to the fact that VS runs in .NET Framework and you control will be running in Core. We'll work with several vendors to vet our instructions and how-to guides once all of our APIs are nailed down.

cadilhac commented 4 years ago

Thanks for all this information.

  1. I'm not worried about design time components. I don't have any of the ones you mention. So the issue is not related to that.
  2. My test was done without any licensing, though I'm interested to learn how this will work if there is no LICX file management. How will licensing work? So again, my issue is not related to that.
  3. About the portability analyzer, I didn't run it. It already works perfectly under .Net Core at runtime.

@Tanya-Solyanik You're right, I'm sorry. I was wrong by saying that the trial could be used for a repro. It's not .net core ready. Only what I have on my dev machine is testable.

Tanya-Solyanik commented 4 years ago

I'm not worried about design time components. I don't have any of the ones you mention. So the issue is not related to that.

Then your scenario should work after we completely enable support for user controls, i.e. controls that are not defined in the current project. This should be available in the Preview channel within a month or two. At this point designer works with custom controls that are defined in your current project. How do you plan to distribute your library? We will recommend using nuget packages, and will be enabling nuget scenarios next.

paul1956 commented 4 years ago

@Tanya-Solyanik I have noticed that in 16.7 Preview 1, the designer add the namespace before User Controls defined in the current project on every save or run is the designer is open.

        ' Form1.Designer
        Me.LineNumbers_For_RichTextBoxInput = New LineNumbersForRichTextBox()

becomes after every save

        ' Form1.Designer
        Me.LineNumbers_For_RichTextBoxInput = New RootNamespace.LineNumbersForRichTextBox()

And then you get 7 errors until you delete "RootNamespace." Should I open a new issue of is this know?

kirsan31 commented 3 years ago

Any updates / tips for user controls? For example, currently V.S. 16.8 P. 3.2-5 doesn't see DataVisualization.Charting.Chart in designer. And will remove all code related to it from *.Designer.cs after changing some thing. It doesn't matter how the link to the chart is added - through a project or a library.

paul1956 commented 3 years ago

@kirsan31 This may be a duplicate of #4023 or at least should be combined. It happens without licensing.

paul1956 commented 3 years ago

Also the comment above talks about control in separate process, for me the controls are all in the same project as the forms then are inserted in. Though at some point I want to move them each to a separate project because they are very reusable and address common WinForms requests.

cadilhac commented 3 years ago

@cadilhac, thanks for reporting this issue. We just started our work on third-party controls, so it is in progress and some things may not work yet.

That being said, is it possible you are having issues with licensing of your controls because LICX is not supported in .NET Core? Also have you tried running portability analyzer on your code to ensure you don't have any dependencies on APIs that are not supported in .NET Core https://devblogs.microsoft.com/dotnet/are-your-windows-forms-and-wpf-applications-ready-for-net-core-3-0/

I tried this again with the latest VS preview and I'm happy to see that I can now drag my control from the toolbox to a design surface and set its properties from the PropertyGrid.

I would like to ask @Tanya-Solyanik or someone else knowledgeable: what about licensing now? You told me that LICX is not supported. I am using CryptoLicensing as a 3rd party tool for licensing and I can see they now have a version that works with .net core. So is LICX now supported? Some other mechanism?

I went ahead and tried to drag my component onto the design surface. I can confirm that no LICX file is created. Also, if I add it manually, I then get this error when compiling:

LC : error LC0000: 'Could not load file or assembly 'System.ComponentModel.Primitives, Version=4.2.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Reference assemblies should not be loaded for execution. They can only be loaded in the Reflection-only loader context. (Exception from HRESULT: 0x80131058)'

cadilhac commented 3 years ago

Note also that when I try to add my component into the toolbox, I get this error:

formsbug

The difference with my previous comment is that I'm trying here in a fresh winforms app that does not reference the assembly of my component yet. In the previous comment, I was in my component sample exe project where the component assembly is already referenced and used. In that case, VS automatically added my component in the toolbox.

dreddy-work commented 3 years ago

Note also that when I try to add my component into the toolbox, I get this error:

formsbug

The difference with my previous comment is that I'm trying here in a fresh winforms app that does not reference the assembly of my component yet. In the previous comment, I was in my component sample exe project where the component assembly is already referenced and used. In that case, VS automatically added my component in the toolbox.

This specific work is not yet done for the Net core Winforms projects. you can always get them by referencing the nuget package in the project for now. this work is planned for Visual studio 16.9.

kirsan31 commented 3 years ago

@cadilhac

I tried this again with the latest VS preview and I'm happy to see that I can now drag my control from the toolbox to a design surface and set its properties from the PropertyGrid.

How do you achieve this?

I have this problem? more details here.

May be it's offtopic here and I need to create a new issue, but once again, we have big lack of info / feedback about new designer :(

cadilhac commented 3 years ago

@cadilhac

I tried this again with the latest VS preview and I'm happy to see that I can now drag my control from the toolbox to a design surface and set its properties from the PropertyGrid.

How do you achieve this?

I have this problem? more details here.

May be it's offtopic here and I need to create a new issue, but once again, we have big lack of info / feedback about new designer :(

I guess a separate topic would be better yes, because for me, when my component's project is in the solution, I can drag it from the toolbox (where it's automatically put) to a form and get/keep its code in the designer generated code.

cadilhac commented 3 years ago

This specific work is not yet done for the Net core Winforms projects. you can always get them by referencing the nuget package in the project for now. this work is planned for Visual studio 16.9.

Does 16.9 Preview already has the feature (trying to add a component in the toolbox)?

And what is the status of licensing? How do some other component vendors do it already?

cadilhac commented 3 years ago

16.9 is ready and there is no word/docs about how to license a component. Seems like licx file support has been dropped. I'm clueless about how to go ahead.

dreddy-work commented 3 years ago

@cadilhac , we have been granting access to our private repo on designer for control vendors on case by case based on NDA. Component vendors are currently building against the designer SDK . But for individual users, we are not there yet. If you are looking to gain such access we would need your organization details.

dreddy-work commented 3 years ago

This specific work is not yet done for the Net core Winforms projects. you can always get them by referencing the nuget package in the project for now. this work is planned for Visual studio 16.9.

Does 16.9 Preview already has the feature (trying to add a component in the toolbox)?

Adding components to toolbox using this explorer is on low pri for us at the moment. But we have implemented finish scanning toolbox items from nuget packages when that nuget package is referenced or if nuget package exist in Visual studio fallback folders.

MindfusionSoftware commented 3 years ago

Dear @dreddy-work,

We are developing diagramming SDKs for Microsoft platforms (e.g. https://www.nuget.org/packages/MindFusion.Diagramming/) and found this issue while researching how to enable our original custom designers and UI editors in .NET Core / 5.

we have been granting access to our private repo on designer for control vendors on case by case based on NDA. Component vendors are currently building against the designer SDK .

The designer SDK link above (https://github.com/dotnet/winforms-designer/blob/master/docs/sdk-package-information.md) seems broken. Could you let us know how vendors can apply for access to that SDK?

Thank you, Iva MindFusion

Tanya-Solyanik commented 3 years ago

@merriemcgaw , @OliaG - Is it possible to give this software vendor access to the designer SDK?

cadilhac commented 2 years ago

.Net 6 and VS2022 are here. So I'm asking the question again. Knowing that the licx file mechannism has gone, how to license my commercial winforms component? My customers are waiting for it.

merriemcgaw commented 2 years ago

There are no plans to implement the licx file mechanism for licensing. The current thinking internally is that most software vendors are creating their own licensing mechanism, and that the licx file method was not adequate for most modern scenarios. The recommendation is to either invest in a cloud-based licensing approach or create a system specific to your component and your component needs. Microsoft does not have plans to invest in a licensing model provided by Microsoft in .NET. If you have any questions, you can reach out to me or @OliaG directly, and we'd be happy to pass along feedback up our management chain.

merriemcgaw commented 2 years ago

My bad - I saw the licensing question and didn't note the original source of this issue.

Custom Controls are much more fully supported in VS2022 and we are working on getting demo blog posts and documentation about how to get your custom controls onto the ToolBox via a NuGet package, how to create custom controls, and when do customers need to take a dependency on our new SDK to allow their control to communicate directly with VS when necessary. I'm going to keep this issue open and assigned to me so I can circle back once the blogs are posted and as new docs come up on the docs site.

Rewriting the WinForms Designer has evolved to something much more than "porting to Core", we've had to rearchitect the entire premise of design time communication between custom controls and Visual Studio. Our platform has dramatically improved and stabilized enough that we are ready to share it with everyone. Thanks for your patience, it's been a journey (but a phenomenally exciting one).

~Merrie

cadilhac commented 2 years ago

@merriemcgaw Your 2 messages puzzle me a bit and I'm not sure if there will be some sort of integration mechanism so that 3rd party licensing managers can plug into the designer. So far it was possible with the licx file mechanism. When I asked the question in this same thread, someone answered by:

Licensing is not fully done in Core yet, so this is not expected to work.

But you now seem to indicate that licensing will never be implemented again. Implementing a complete licensing solution is out of my reach. So far, I was using a 3rd party tool named CryptoLicensing which was using the licx file to make VS embed the runtime part of the license into the final executable. I guess that its author does not know how to port his tool to .Net 5/6.

Your second post does not help me envision how I can solve my problem. So, more details would be appreciated. Thanks.

merriemcgaw commented 2 years ago

But you now seem to indicate that licensing will never be implemented again.

That is currently the plan of record. Perhaps the CryptoLicensing tool can be convinced to port to .NET 6. Are they using .NET Core otherwise?

Your second post does not help me envision how I can solve my problem. So, more details would be appreciated. Thanks.

My second post was not necessarily directed at your situation. The original problem that was raised in this issue was that there were issues with the WinForms designer and custom controls. We've done a lot of work to solve these issues, and everything should be good to go for developers wanting to create custom controls either for internal use or distribution. If they have a complex control that needs to interact with Visual Studio for their design time experience, they will need to use our new WinForms Designer Extensibility SDK. That's the reason I reopened the ticket - I wanted to make sure I posted the links as the docs become available describing how to create custom controls. Sorry for the confusion!

RussKie commented 2 years ago

@cadilhac it's been a while since you're reported the issue. I'd like to check if it still repos in the latest VS 2022? I.e., "Unable to find method 'SendRequestAsync/2' on {no object} for the following reasons: An argument was not supplied for a required parameter.

If it still repos - can we get a repro sample? If the issue is gone - can we close this?

cadilhac commented 2 years ago

The original issue is definitely fixed.