A set of .NET Framework managed libraries for developing graphical user interfaces.
Hi @James Buss ,
You've actually already spotted the real culprit yourself. That second Resources1.Designer.vb file is the whole problem. Both it and the original Resources.Designer.vb are generating their properties into the same My.Resources namespace, so every image (Folder_New_48 and the rest) ends up defined twice. When the compiler hits the line in MainForm.Designer.vb that sets a button's Image, it sees two identical Folder_New_48 members and can't decide which one to use, hence the "Overload resolution failed... is most specific" error. And since the designer file no longer compiles cleanly, the Form Designer just throws up its hands with that "cannot process unknown name 'Image'" message. So the designer error is really just a side effect of the duplicate resource class.
As for how it snuck in: adding the TableAdapter made Visual Studio re-run its "make sure the default project resources exist" step, it didn't recognize your existing My Project\Resources.resx, and quietly added a duplicate (Resources1.resx) wired up with the same custom tool and namespace. That .resx is what keeps regenerating Resources1.Designer.vb on you, which is why deleting the generated file alone never sticks. You have to remove the source .resx, not the generated output.
Here's the clean way to get rid of it for good:
- Close Visual Studio first, so nothing regenerates mid-edit.
- In Solution Explorer, turn on Show All Files and find
Resources1.resx(usually at the project root or under My Project). It'll contain the same images as your real one. - As long as your original
My Project\Resources.resxstill has all your images (it almost certainly does), delete bothResources1.resxandResources1.Designer.vb. If for some reason the images only live in the duplicate, copy them back into the original first, then delete the pair. - Open the
.vbprojin a text editor and remove any leftover entries pointing atResources1.resx/Resources1.Designer.vb. You want exactly oneEmbeddedResource(the original) generating intoMy.Resources. - Delete the
binandobjfolders to clear out any stale build artifacts. - Reopen the project, do a Clean Solution, then a Rebuild. With only one
Folder_New_48in scope now, the designer file compiles and the Form Designer opens right up.
One tip to keep it from happening again: only ever let a single .resx generate into the My.Resources namespace. If you deliberately add another resource file down the road, give it its own Custom Tool Namespace so the names can't collide.
Hope this helps. If you found my response helpful or informative, I would greatly appreciate it if you could follow this guidance or provide feedback.
Thank you.