I have a project that creates a DLL. It's been around for many years and through several iterations, so some of the history has been lost, but I'm now seeing something very odd. The forms work fine, but the .designer.vb file isn't under the form in the project, but off on it's own node in Solution Manager, rather than being a sub-node beneath the form. Since the forms work fine, the partial class in the designer.vb file is clearly being seen correctly. The one issue is that the designer doesn't work. That's not much of an issue, because I don't need to change the design, but I'd still like to correct it.

InitializeComponents in the constructor still goes to the right place, which is the implementation in the .designer.vb file, so the controls that are on the form do show up right, it's just the designer that seems to have lost track of them.

Out of curiosity, I tried adding a button onto the form, which appears to be blank in the designer. That worked, so I clicked on the button to generate the click event handler, which took me to a reasonably right place in the .vb file behind the form, but right above there was a new InitializeComponents implementation. So, the designer couldn't find the existing .designer.vb file (though the compiler clearly can), and created a new one to position that button. The button was added as a form level member, as well.

Back before partial classes were added in VS2005, this is how all forms worked. The designer code lived in the same code file as everything else. I didn't realize that the designer was still willing to do that. I knew it COULD, because code is just code, but I didn't realize the designer would say, "hmmm, I can't find a .designer.vb file to work with, I guess I'll just put the code in the file I do have." It's a surprising choice.

Is there a way to get the designer to recognize the .designer.vb file again?