473,513 Members | 2,595 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

User Control and Namespace question

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.CodeDom DesignerLoader.EnsureDocument(IDesignerSerializati onManager
manager)
at
System.ComponentModel.Design.Serialization.CodeDom DesignerLoader.PerformLoad(IDesignerSerializationM anager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDo m.VSCodeDomDesignerLoader.PerformLoad(IDesignerSer ializationManager
serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.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


Jan 12 '06 #1
2 6524
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" <bd*****@sgiims.com> wrote in message
news:%2***************@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.CodeDom DesignerLoader.EnsureDocument(IDesignerSerializati onManager
manager)
at
System.ComponentModel.Design.Serialization.CodeDom DesignerLoader.PerformLoad(IDesignerSerializationM anager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDo m.VSCodeDomDesignerLoader.PerformLoad(IDesignerSer ializationManager
serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.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

Jan 12 '06 #2
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

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:%2****************@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" <bd*****@sgiims.com> wrote in message
news:%2***************@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.CodeDom DesignerLoader.EnsureDocument(IDesignerSerializati onManager
manager)
at
System.ComponentModel.Design.Serialization.CodeDom DesignerLoader.PerformLoad(IDesignerSerializationM anager
manager)
at
Microsoft.VisualStudio.Design.Serialization.CodeDo m.VSCodeDomDesignerLoader.PerformLoad(IDesignerSer ializationManager
serializationManager)
at
System.ComponentModel.Design.Serialization.BasicDe signerLoader.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


Jan 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
6644
by: Tom Rowton | last post by:
This one has me a bit confused and I'm not finding what I need in the MSDN or by searching these forums, so here goes... I have a rather large, complex code-in-page WebForm (don't ask) and a...
1
1022
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
2
3206
by: tshad | last post by:
This is related to my other Hiding datalistitems problem that I can't seem to solve. I have tried different methods which all seem to work only partially. I decided to try to use a User...
1
1178
by: ABC | last post by:
I write a Base Web User Control which contains several public properties and a Inherited Web User Control which only have some codes in new method. When I use the Inherited Web User Control on Web...
5
1509
by: Paul Bromley | last post by:
Can someone give me a very simple example on how to do this? As an example I have a commaned button in a user control. Once this user control is placed on a form I want to be able to respond in the...
1
1995
by: tony | last post by:
Hello! I just want to find out how the system find the name to set on a assembly User control dll. I have done this. 1. Create a user control - Here the namespace was set by the system to...
2
4805
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
3
3139
by: XJ | last post by:
Hi Expert, i'm doing some program for my project which using WPF, to create my application more managible i would apply "user control" concept for my project for each section of my workspace. ...
4
2465
by: =?Utf-8?B?UmljaEI=?= | last post by:
I am trying to create a project using the ASP.NET AJAX accordion control. I would like to dynamically add panes to the control with a form template added when the pane is added. I have tried...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5685
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
456
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.