VB 2019 project settings empty

0

I want to store startup settings for my project. When I go to the project Properties/Settings, it's empty except for a link that says, "This project does not have a default settings file. Click here to create one." When I click the link to add one, it says "The system cannot find the file specified. (Exception from HRESULT: 0x80070002." So, how do I add a default settings file?

vb.net
visual-studio-2019
asked on Stack Overflow Jan 1, 2021 by Rev3d

1 Answer

1

As mentioned in my comments, this seems to be a bug in VS and ought to be reported to Microsoft. As a temporary workaround, you can actually copy the settings files from a .NET Framework project into a .NET Core project. As far as I can tell from examining various VB and C# projects targeting .NET Framework and .NET Core, the settings files are the same in each case, so there's no issue copying between them. Here's what I did:

  1. Added a VB WinForms app project targeting .NET Framework to the same solution.
  2. Clicked the Show All Files button in the Solution Explorer for both projects.
  3. Expanded the My Project node for both projects.
  4. Dragged the Settings.settings item from the .NET Framework project to the .NET Core project.

It seemed to work as expected after that.

answered on Stack Overflow Jan 2, 2021 by jmcilhinney

User contributions licensed under CC BY-SA 3.0