I was reading Shawn’s comments and found an answer that explains another problem with the VS IDE. The trouble comes when creating a custom user control and adding it to a test form. If you modify the code in the user control and then there is a problem with the next build of your application - your control might disappear from the test form.
Quote from Shawn Burke
Lance — actually that’s a different issue. That was (stupid and wrong) design decision we made back early in the development of VS 2002. I remember talking about it but just can’t believe we did that, you’re complaining to the right guy, so my apologies there. Basically what’s happening is that you rebuild. The build of the control fails. The designer in the other project can’t know that, it just sees that the assembly that has the control is no longer valid. It asks the project system for the WindowsControlLibrary.UserControl1 type, and the project system says "sorry, don’t have it." So the designer (and this was the mistake; we should have just failed the load right then and there) shrugs its shoulders, and goes about its business. The net result is that the control is just plain gone, and if you make a change and save, it’s gone for good.
If you see this happen, you need to close the designer, answer "NO" when it asks to save changes, fix your build problems, then reopen it, and you should be okay.
In VS 2005 we do the *right* thing and fail the load with a "could not find type ‘WindowsControlLibrary.UserControl1′.
Comments
re: More on Disappearing Controls (User Controls) 5/19/2005 4:51 AM Terje Sandstrom
I’ve seen posts on this for at least the beta 1, so IS the problem really fixed, as you say ?
See f.ex. http://www.gamedev.net/community/forums/topic.asp?topic_id=315898
Terje
re: 2/20/2006 1:44 AM Burt
"The net result is that the control is just plain gone, and if you make a change and save, it’s gone for good."
Just great :s