.NET Core Version:
3.1.300-preview-015135
Have you experienced this same bug with .NET Framework?:
No
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.
@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/
@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.
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.
Thanks for all this information.
@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.
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.
@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?
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.
@kirsan31 This may be a duplicate of #4023 or at least should be combined. It happens without licensing.
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, 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)'
Note also that when I try to add my component into the toolbox, I get this error:

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.
Note also that when I try to add my component into the toolbox, I get this error:
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.
@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
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.