question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Updating the Default Settings file in a WinForms .NET 5 Visual Basic app fails.

See original GitHub issue

Visual 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:

  1. Create a new .NET 5 WinForms App.
  2. Insert a new App.Config to the project by chosing Add/New Items and General/Application Configuration File.
  3. Show All Files in the Solution Explorer and select the My Project branch.
  4. 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.
  5. 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: image

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:closed
  • Created 3 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
melytccommented, May 4, 2022

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.

0reactions
ocallespcommented, Jun 21, 2022

The PR https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/403807 should handle the issue in system.diagnostics

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found