User Control and Namespace question

B

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
 
K

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
 
B

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top