Sometimes (not always), when I edit a setting in the "My Project" page, when I add one or edit a value from there, I get an error : 'Settings is ambiguous between declaration in Modules '<project>.My.MySettingsProperty' and '<project>.My.MySettingsProperty'
Visual Studio creates a duplicate of My Project\Settings.Designer.vb
, and registers both of them in the .vbproj
file.
When this happens, I need to delete Settings.Designer.vb, remove the "1" in Settings1.Designer.vb, and remove the references to it in the vbproj file.
It also happens when I edit a Telerik ORM model (a designer.vb file copied to designer1.vb), with the added problem that in that case, the designer.vb file is empty afterwards.
Here is another description of the problem, by somebody else (who doesn't have an answer since 2009 except mine) : http://social.msdn.microsoft.com/Forums/en-AU/vbide/thread/29e7b9ff-5cdc-456b-9d2f-bc85145e8eaf
Can you think of a possible source, but more importantly, of a possible fix ?
I'm using Visual Studio 2008 Standard, and this problem did not happen a few months ago.
Thanks
I suffered from this too, with Visual Studio 2008, when messing around too much with the application settings. The fix is described here.
In short, in the project file, there is a LastGenOutput
XML element inside the XML element of the .settings
file. If Visual Studio decides to add a 1
to the generated .Designer.cs
file name, this will be persisted to the LastGenOutput
XML element. As long as you don't revert this change in the project file, Visual Studio will continue to use the new .Designer.cs
file whatever you try.
Update
A reproduction with Visual Studio 2008, 2010 and 2013 Update 1