Updating the Default Settings file in a WinForms .NET 5 Visual Basic app fails.
See original GitHub issueVisual Studio Version: >=16.8 Summary: Attempting to save after changing a value in the Default Settings file of a WinForms .NET 5 Visual Basic app fails.
Steps to Reproduce:
- Create a new .NET 5 WinForms App.
- Insert a new App.Config to the project by chosing Add/New Items and General/Application Configuration File.
- Show All Files in the Solution Explorer and select the My Project branch.
- Insert a new Settings file to the project by choosing Add/New Items and General/Settings File. Make sure to rename the Name to Settings.settings.
- In the Settings editor, which appears now, add a value and try to save the settings.
Expected Behavior:
Settings file should be written, settings designer code be generated.
Actual Behavior:
Exception: ‘An error occurred creating the configuration section handler for userSettings/VbWinForms5EventTest.Settings: Could not load file or assembly ‘System.Configuration.ConfigurationManager, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51’ or one of its dependencies. The system cannot find the file specified.’
User Impact: Interactively using the settings designer in a .NET 5 VB WinForms App is not possible.
Stack Trace:
at System.Configuration.BaseConfigurationRecord.FindAndEnsureFactoryRecord(String configKey, Boolean& isRootDeclaredHere)
at System.Configuration.BaseConfigurationRecord.GetSectionRecursive(String configKey, Boolean getLkg, Boolean checkPermission, Boolean getRuntimeObject, Boolean requestIsHere, Object& result, Object& resultRuntimeObject)
at Microsoft.VisualStudio.Shell.Design.Serialization.ConfigurationHelperService.GetConfigSection(Configuration config, String sectionName, Boolean isUserScoped, Boolean declare)
at Microsoft.VisualStudio.Shell.Design.Serialization.ConfigurationHelperService.ReadSettings(ExeConfigurationFileMap fileMap, ConfigurationUserLevel userLevel, DocData appConfigDocData, String sectionName, Boolean isUserScoped, SettingsPropertyCollection settings)
at Microsoft.VisualStudio.Editors.SettingsDesigner.AppConfigSerializer.SynchronizeUserConfig(String SectionName, IVsHierarchy Hierarchy, ConfigurationHelperService ConfigHelperService, Dictionary`2 SettingsTheDesignerKnownsAbout, DocData AppConfigDocData) in D:\Git\project-system\src\Microsoft.VisualStudio.Editors\SettingsDesigner\AppConfigSerializer.vb:line 402
at Microsoft.VisualStudio.Editors.SettingsDesigner.AppConfigSerializer.SynchronizeUserConfig(String SectionName, IVsHierarchy Hierarchy, ConfigurationHelperService ConfigHelperService, DesignTimeSettings Settings, DocData AppConfigDocData) in D:\Git\project-system\src\Microsoft.VisualStudio.Editors\SettingsDesigner\AppConfigSerializer.vb:line 347
at Microsoft.VisualStudio.Editors.SettingsDesigner.AppConfigSerializer.Serialize(DesignTimeSettings Settings, SettingsTypeCache typeCache, SettingsValueCache valueCache, String SectionName, DocData AppConfigDocData, IVsHierarchy Hierarchy, Boolean ShouldSynchronizeUserConfig) in D:\Git\project-system\src\Microsoft.VisualStudio.Editors\SettingsDesigner\AppConfigSerializer.vb:line 320
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (11 by maintainers)
Top Results From Across the Web
WinForms Application Settings changes don't appear to be ...
In my C# WinForm I have a settings window that allows the user to change database connection settings. At design time I set...
Read more >Can't create Settings file in Windows Forms .Net Core ...
NET, when I go to Project > Properties > Settings, Visual Studio says that my project doesn't have a default settings file.
Read more >Troubleshoot .NET Framework targeting errors
Open Solution Explorer. · Select Show All Files, and then edit the app.config file in the XML editor of Visual Studio. · Change...
Read more >Visual Studio 2022 - Fix Errors with Renaming Form1 - YouTube
myapp. the fix show here editing the Application.Designer will only solve it temporarily once you do a clean rebuild it will show up...
Read more >Form Settings Not Working
Hi I'm using Visual Studio Community 2019 on Windows 10 and I'm having a major problem with Form Settings (in My Project window)....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Change missing here is removing the
system.diagnostics
content from the VB AppConfiguration template. Closing this in favor of #7448 which needs the same change.The PR https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/403807 should handle the issue in
system.diagnostics