Home All Groups Group Topic Archive Search About

User Control and Namespace question

Author
12 Jan 2006 9:44 PM
Bob
Just new at this, Vs 2005 Vb.net
Created a new Windows control library User control project.

Only 1 file UserControl1.vb No code or object in it at all yet except what
was placed by default when created.
Public Class UserControl1

end class.

Can open file in designer and see user Control on which I can place other
controls OK.

Now I just add
Namespace AnyNamespace
Public Class UserControl1

End Class


end Namespace

So that's what I get. Immediately as I do that the icon for the vb module
UserControl1.vb changes to an ordinary vb code file icon and I can't open
that file in the designer any more. I get the following error in the
designer pane

      One or more errors encountered while loading the designer. The errors
are listed below. Some errors can be fixed by rebuilding your project, while
others may require code changes.

      The class UserControl1 can be designed, but is not the first class in
the file. Visual Studio requires that designers use the first class in the
file. Move the class code so that it is the first class in the file and try
loading the designer again.
      Hide

      at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager
manager)
      at
System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
manager)
      at
Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
serializationManager)
      at
System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
host)

      as soon as I comment out the namespace lines, alls back to normal.

      Can anyone tell me what I'm doing wrong?

      Bob

Author
12 Jan 2006 10:34 PM
Ken Tucker [MVP]
Hi,

        You should submit a bug in the msdn product feed back center.  To
get around this issue change the default namespace in the controls
properties-> Applications tab -> Root namespace textbox.

Ken
------------------------
Show quoteHide quote
"Bob" <bduf***@sgiims.com> wrote in message
news:%23tb4lF8FGHA.216@TK2MSFTNGP15.phx.gbl...
> Just new at this, Vs 2005 Vb.net
> Created a new Windows control library User control project.
>
> Only 1 file UserControl1.vb No code or object in it at all yet except what
> was placed by default when created.
> Public Class UserControl1
>
> end class.
>
> Can open file in designer and see user Control on which I can place other
> controls OK.
>
> Now I just add
> Namespace AnyNamespace
> Public Class UserControl1
>
> End Class
>
>
> end Namespace
>
> So that's what I get. Immediately as I do that the icon for the vb module
> UserControl1.vb changes to an ordinary vb code file icon and I can't open
> that file in the designer any more. I get the following error in the
> designer pane
>
>      One or more errors encountered while loading the designer. The errors
> are listed below. Some errors can be fixed by rebuilding your project,
> while others may require code changes.
>
>      The class UserControl1 can be designed, but is not the first class in
> the file. Visual Studio requires that designers use the first class in the
> file. Move the class code so that it is the first class in the file and
> try loading the designer again.
>      Hide
>
>      at
> System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager
> manager)
>      at
> System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
> manager)
>      at
> Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
> serializationManager)
>      at
> System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
> host)
>
>      as soon as I comment out the namespace lines, alls back to normal.
>
>      Can anyone tell me what I'm doing wrong?
>
>      Bob
>
>
>
>
Author
12 Jan 2006 11:35 PM
Bob
Thanks Ken
I set the Root namespace  textbox to AnyNameSpace, but the problem stays the
same
Anything else needs to be done that you might think of?

Thanks for the help,
Bob

Show quoteHide quote
"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%235Rnjh8FGHA.2040@TK2MSFTNGP14.phx.gbl...
> Hi,
>
>        You should submit a bug in the msdn product feed back center.  To
> get around this issue change the default namespace in the controls
> properties-> Applications tab -> Root namespace textbox.
>
> Ken
> ------------------------
> "Bob" <bduf***@sgiims.com> wrote in message
> news:%23tb4lF8FGHA.216@TK2MSFTNGP15.phx.gbl...
>> Just new at this, Vs 2005 Vb.net
>> Created a new Windows control library User control project.
>>
>> Only 1 file UserControl1.vb No code or object in it at all yet except
>> what was placed by default when created.
>> Public Class UserControl1
>>
>> end class.
>>
>> Can open file in designer and see user Control on which I can place other
>> controls OK.
>>
>> Now I just add
>> Namespace AnyNamespace
>> Public Class UserControl1
>>
>> End Class
>>
>>
>> end Namespace
>>
>> So that's what I get. Immediately as I do that the icon for the vb module
>> UserControl1.vb changes to an ordinary vb code file icon and I can't open
>> that file in the designer any more. I get the following error in the
>> designer pane
>>
>>      One or more errors encountered while loading the designer. The
>> errors are listed below. Some errors can be fixed by rebuilding your
>> project, while others may require code changes.
>>
>>      The class UserControl1 can be designed, but is not the first class
>> in the file. Visual Studio requires that designers use the first class in
>> the file. Move the class code so that it is the first class in the file
>> and try loading the designer again.
>>      Hide
>>
>>      at
>> System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.EnsureDocument(IDesignerSerializationManager
>> manager)
>>      at
>> System.ComponentModel.Design.Serialization.CodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
>> manager)
>>      at
>> Microsoft.VisualStudio.Design.Serialization.CodeDom.VSCodeDomDesignerLoader.PerformLoad(IDesignerSerializationManager
>> serializationManager)
>>      at
>> System.ComponentModel.Design.Serialization.BasicDesignerLoader.BeginLoad(IDesignerLoaderHost
>> host)
>>
>>      as soon as I comment out the namespace lines, alls back to normal.
>>
>>      Can anyone tell me what I'm doing wrong?
>>
>>      Bob
>>
>>
>>
>>
>
>