VS 2010 Creates extra Settings.Designer file

1.7k Views Asked by At

I am working on a VB WinForms app in VS 2010. I have one setting in my settings.settings file, a DB connection string. I am trying to correct an error in my setting, but each time I make a correction, VS creates a 2nd Settings.Designer.vb file (Settings1.Designer.vb), instead of saving to Settings.Designer.vb.

I have Settings.Designer.vb checked out from TFS, and I have checked the file to make sure it is writeable. I have deleted both the Settings.Designer.vb and Settings1.Designer.vb files, then saved my settings again. This should have created a new Settings.Designer.vb file, and it does, but it doesn't save the correct settings. Also, I have removed any references to "Settings1.Designer.vb" from my vbproj file.

Has anyone seen this hokey behavior? Have you got any ideas?

1

There are 1 best solutions below

0
On

Figured it out. Since the connection string I had in my settings is an application-level setting, it was copied to app.config. To fix the issue, I had to:

  1. Make sure Settings.Designer.vb and app.config agreed
  2. Delete any other Settings.Designer.vb files, such as Settings1.Designer.vb
  3. Delete any mention of Settings1.Designer.vb in the vbproj file
  4. In TFS (Source Control Explorer), make sure that when you check it in, you don't check in the new Settings1.Designer.vb that TFS thinks you want to add. Find the Settings1.Designer.vb file in Source Control Explorer, right-click it, and Undo Changes. This will make TFS forget you need to add the new file.