Open jespersh opened 9 months ago
@Olina-Zhang is there already an internal designer issue for this?
I didn't find similar error in our internal designer issues, It's better that we can get some specific repro steps from @jespersh.
I'm getting the same error, no way to find which toolbox caused this.
I'm getting the same error, no way to find which toolbox caused this. Perhaps this may help : When I try to add one of my UserControl in a new Form, I got this error message :
@Olina-Zhang - I really don't know how to reproduce it besides me opening the toolbox in our rather big solution. Best I can probably do is attach a debugger+disassembler to the winforms designer and catch the error
@Olina-Zhang let's go ahead and replicate this internally and assign to @KlausLoeffelmann . If anyone has more details - like are you migrating from Framework, do you have 3rd party control suites installed or anything along those lines would help us narrow it down. But the feedback is taken loud and clear that we need a better message that tells you what precisely failed to load in the ToolBox.
Thank you Merrie, Here are some more details :
[07:09:01.016342] fail: Request failures: DesignerHosts/CreateComponent.
Microsoft.DotNet.DesignTools.Client.DesignToolsServerException:
An error occurred creating the configuration section handler for connectionStrings: Type 'System.Configuration.ConnectionStringsSection' does not inherit from 'System.Configuration.IConfigurationSectionHandler'.
(C:\Users\XXXXXXXX\AppData\Local\Microsoft\VisualStudio\17.0_ef0840bb\WinFormsDesigner\0glga22x.vot\Config\machine.config line 4) ---> Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: Type 'System.Configuration.ConnectionStringsSection' does not inherit from 'System.Configuration.IConfigurationSectionHandler'.
--- End of inner exception stack trace ---
Hope this can help
Thank you Merrie, Here are some more details :
- The solution is an old one which I migrated from .Net Framework 4.5 to .Net 8.0
- The error message is displayed only with one of several user controls
- Here is the complete stack trace of the exception thrown when I add the user control
[07:09:01.016342] fail: Request failures: DesignerHosts/CreateComponent. Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: An error occurred creating the configuration section handler for connectionStrings: Type 'System.Configuration.ConnectionStringsSection' does not inherit from 'System.Configuration.IConfigurationSectionHandler'. (C:\Users\XXXXXXXX\AppData\Local\Microsoft\VisualStudio\17.0_ef0840bb\WinFormsDesigner\0glga22x.vot\Config\machine.config line 4) ---> Microsoft.DotNet.DesignTools.Client.DesignToolsServerException: Type 'System.Configuration.ConnectionStringsSection' does not inherit from 'System.Configuration.IConfigurationSectionHandler'. --- End of inner exception stack trace ---
Hope this can help
I don't think you're getting the same error. Yours is that you have some code in a control constructor that fails. That's one of the easier ones to resolve
The typeName throwing by ToolDataObject
Microsoft.WinForms.Utilities.VisualStudio.dll!Microsoft.WinForms.Utilities.Desktop.Toolbox.ToolDataObject.ToolDataObject(string typeName, bool isInternal, System.Reflection.AssemblyName assemblyName, string creationToolName, string targetFrameworks) Line 58 C#
in my case here is:
MigraDoc.Rendering.Forms.DocumentPreview
From the assembly:
{MigraDoc.Rendering-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb}
Leading us to where it logs this: UpdateToolboxItemsAsync()
catch (Exception ex) when (!ClientUtils.IsCriticalException(ex))
{
Logger.LogException(ex, SR.Unable_to_update_toolbox_with_item);
}
I would assume that SR.Unable_to_update_toolbox_with_item
needs to be formatted with the item
Another one is:
PdfSharp.Forms.ColorComboBox
From:
{PdfSharp-gdi, Version=1.50.5147.0, Culture=neutral, PublicKeyToken=f94615aa0424f9eb}
I forgot to check where the assembly was loaded from, but if I had to guess: https://www.nuget.org/packages/PDFsharp-MigraDoc-GDI/1.50.5147
They've made a 6.0 version that I'll try out. I think that the error message should still be improved to tell what toolbox item and if possible from what assembly failed to be added
Environment
Version 17.9.0 Preview 5.0 Version 17.10.0 Preview 2.0
.NET version
6.0
Did this work in a previous version of Visual Studio and/or previous .NET release?
No response
Issue description
While loading the toolbox in our solution, a toolbox caused an exception in the designer. Seems like the value should have been in '{0}' of the attached diagnostics log from the designer.
Steps to reproduce
Unknown what toolbox item causes this.
Diagnostics