I am using VS2003 and have a VB solution with several assemblies. One of them
contains several forms and it seems that randomly, a few of those forms will "forget"
that they are forms and display in the solution view as though they were classes. I
am unable to view them with the form designer, since VS apparently is convinced these
are classes and not forms.
If I inspect the project file "offline", I can see in the <files> section that the
subtype of the offending forms has been mysteriously changed to "Code". If I
manually edit the project file and change this back to "Form" like the others in the
assembly, all appears well, at least for a while until the forms revert back. It
seems that it is always the same few forms that exhibit this behavior. I am unable
to say for certain what I may be doing that causes this - it appears to be random.
I also notice that if I do things like rebuild the solution, exit VS and re-enter and
then rebuild (sometimes more than once) the problem will also go away for a while,
but eventually it will return.
Anybody seen this behavior or have an explanation, and more importantly, a way to
make it stop doing this??
Thanks for any help...
Marc Bernard - 28 May 2004 17:45 GMT
> I am using VS2003 and have a VB solution with several assemblies. One of them
> contains several forms and it seems that randomly, a few of those forms will "forget"
[quoted text clipped - 8 lines]
> seems that it is always the same few forms that exhibit this behavior. I am unable
> to say for certain what I may be doing that causes this - it appears to be random.
I see this all the time in C# projects. The culprit seems to be inherited
forms (and usercontrols).
The easiest way to fix this is to either edit the project file and change
"Code" to "Form" in the SubType, or you can try cutting and pasting the base
class name in the IDE.
For example, where you have:
public class MyClass : MyBaseClass
cut "MyBaseClass" and paste it right back. I find this fixes the solution
explorer (and the project, I guess).
Marc