By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,870 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

Type 'TypeName' has no constructors

P: n/a
Hi, if anyone can help on this, please! This is driving me crazy.

I have a user control hierarchy several levels deep that derive for
UserControl (windows).

The class that is at the top level, has the following constructor (generated
by VS.NET)
Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call

End Sub

Sometimes (about half the time), when I recompile my solution (which
contains a project with this class, and a project with a form tester trying
out this user control), I get the error I put in the subject of this post.

Now, clearly, this class has a constructor.
If I change the code by removing the word 'Public', and recompile everything
is great.

Next time I need to recompile, I get this error again. In this case, I just
put the word 'Public' back in, and recompile - all is well again.

So I spend half my time removing 'Public' and then adding it back in - just
to get the compiler to change its mind.

Now, it doesn't do this all the time. Sometimes it recompiles OK.

I've checked the project build order - and the project with the user control
is compiled first.

I've tried manually compiling the first project - and then the second. And
the second always fails, because it thinks there is no constructor available
for the user control. Until that is, I take away or remove the 'Public'
keyword off of the constructor - in which case its fine.

Is this some ridiculous VB compiler problem? Some VS.NET bug. Anything I can
do about it?

Thanks
Nov 20 '05 #1
Share this Question
Share on Google+
19 Replies


P: n/a
If you don't put an accessor on there doesn't it default it to Friend? In
which case doesn't your project B (second compiled) need to be in the same
namespace in order for that to work?

So therefore you contructor must be declared public or it doesn't think that
a constructor is avalible for it to use.

Someone correct me if I'm wrong.
"Marina" <so*****@nospam.com> wrote in message
news:uz**************@TK2MSFTNGP11.phx.gbl...
Hi, if anyone can help on this, please! This is driving me crazy.

I have a user control hierarchy several levels deep that derive for
UserControl (windows).

The class that is at the top level, has the following constructor (generated by VS.NET)
Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call

End Sub

Sometimes (about half the time), when I recompile my solution (which
contains a project with this class, and a project with a form tester trying out this user control), I get the error I put in the subject of this post.

Now, clearly, this class has a constructor.
If I change the code by removing the word 'Public', and recompile everything is great.

Next time I need to recompile, I get this error again. In this case, I just put the word 'Public' back in, and recompile - all is well again.

So I spend half my time removing 'Public' and then adding it back in - just to get the compiler to change its mind.

Now, it doesn't do this all the time. Sometimes it recompiles OK.

I've checked the project build order - and the project with the user control is compiled first.

I've tried manually compiling the first project - and then the second. And
the second always fails, because it thinks there is no constructor available for the user control. Until that is, I take away or remove the 'Public'
keyword off of the constructor - in which case its fine.

Is this some ridiculous VB compiler problem? Some VS.NET bug. Anything I can do about it?

Thanks

Nov 20 '05 #2

P: n/a
I don't think you carefully read my post, but just skimmed for some key
words.

The constructor was declared public. And that caused an error. Taking away
'Public' would then compile fine.

Next time I made a change, it woudln't compile again. So I would put the
'Public' back in. Then it was fine again.

The point being, that I kept needing to add and remove the word 'Public'
every other change in order to get the project to compile.

In fact, I believe that the default for a constructor is 'Public', else
taking 'Public' away, would never have compiled the tester application, as
then it definitely would not have had a constructor.

So again, the question is, why is the compiler complaining constantly about
not finding a constructor, making me place and remove the word 'Public'
every other compile time, in order to make it work?

Note: There may be other ways that work in getting the compiler to work
other then this trick with 'Public', I don't know. I just found an easy one.

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
If you don't put an accessor on there doesn't it default it to Friend? In
which case doesn't your project B (second compiled) need to be in the same
namespace in order for that to work?

So therefore you contructor must be declared public or it doesn't think that a constructor is avalible for it to use.

Someone correct me if I'm wrong.
"Marina" <so*****@nospam.com> wrote in message
news:uz**************@TK2MSFTNGP11.phx.gbl...
Hi, if anyone can help on this, please! This is driving me crazy.

I have a user control hierarchy several levels deep that derive for
UserControl (windows).

The class that is at the top level, has the following constructor

(generated
by VS.NET)
Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call

End Sub

Sometimes (about half the time), when I recompile my solution (which
contains a project with this class, and a project with a form tester

trying
out this user control), I get the error I put in the subject of this post.
Now, clearly, this class has a constructor.
If I change the code by removing the word 'Public', and recompile

everything
is great.

Next time I need to recompile, I get this error again. In this case, I

just
put the word 'Public' back in, and recompile - all is well again.

So I spend half my time removing 'Public' and then adding it back in -

just
to get the compiler to change its mind.

Now, it doesn't do this all the time. Sometimes it recompiles OK.

I've checked the project build order - and the project with the user

control
is compiled first.

I've tried manually compiling the first project - and then the second. And the second always fails, because it thinks there is no constructor

available
for the user control. Until that is, I take away or remove the 'Public'
keyword off of the constructor - in which case its fine.

Is this some ridiculous VB compiler problem? Some VS.NET bug. Anything I

can
do about it?

Thanks


Nov 20 '05 #3

P: n/a
Hi Marina,

I do not know this problem, however did you try it already with a new
application and only the most needed things in it.

Just an idea.

Cor
Nov 20 '05 #4

P: n/a
Hi CJ,

Marina is my fighting mate not a new one.

Cor
Nov 20 '05 #5

P: n/a
My apologies. I did misread the post.

Wow...

Wierd question, but how many projects are in your solution... I ran into
some weird compiler errors when I had a lot of projects. I'm just pulling
straws right now I hope you know.. just trying to help.

-CJ

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I don't think you carefully read my post, but just skimmed for some key
words.

The constructor was declared public. And that caused an error. Taking away 'Public' would then compile fine.

Next time I made a change, it woudln't compile again. So I would put the
'Public' back in. Then it was fine again.

The point being, that I kept needing to add and remove the word 'Public'
every other change in order to get the project to compile.

In fact, I believe that the default for a constructor is 'Public', else
taking 'Public' away, would never have compiled the tester application, as
then it definitely would not have had a constructor.

So again, the question is, why is the compiler complaining constantly about not finding a constructor, making me place and remove the word 'Public'
every other compile time, in order to make it work?

Note: There may be other ways that work in getting the compiler to work
other then this trick with 'Public', I don't know. I just found an easy one.
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
If you don't put an accessor on there doesn't it default it to Friend? In
which case doesn't your project B (second compiled) need to be in the same namespace in order for that to work?

So therefore you contructor must be declared public or it doesn't think

that
a constructor is avalible for it to use.

Someone correct me if I'm wrong.
"Marina" <so*****@nospam.com> wrote in message
news:uz**************@TK2MSFTNGP11.phx.gbl...
Hi, if anyone can help on this, please! This is driving me crazy.

I have a user control hierarchy several levels deep that derive for
UserControl (windows).

The class that is at the top level, has the following constructor

(generated
by VS.NET)
Public Sub New()
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call

End Sub

Sometimes (about half the time), when I recompile my solution (which
contains a project with this class, and a project with a form tester

trying
out this user control), I get the error I put in the subject of this post.
Now, clearly, this class has a constructor.
If I change the code by removing the word 'Public', and recompile

everything
is great.

Next time I need to recompile, I get this error again. In this case, I just
put the word 'Public' back in, and recompile - all is well again.

So I spend half my time removing 'Public' and then adding it back in -

just
to get the compiler to change its mind.

Now, it doesn't do this all the time. Sometimes it recompiles OK.

I've checked the project build order - and the project with the user

control
is compiled first.

I've tried manually compiling the first project - and then the second. And the second always fails, because it thinks there is no constructor

available
for the user control. Until that is, I take away or remove the
'Public' keyword off of the constructor - in which case its fine.

Is this some ridiculous VB compiler problem? Some VS.NET bug. Anything

I can
do about it?

Thanks



Nov 20 '05 #6

P: n/a
There are only 2 projects. One of the projects has about a dozen classes -
but not all are in this hierarchy I am talking about. The other is just the
tester app.

I will see if I can reproduce this with just a minimal # of files and code.

I am having trouble believing that adding/removing a modifier keyword can
have this effect, if not for the fact that I am the one having to add and
remove it all the time....

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:OJ**************@TK2MSFTNGP10.phx.gbl...
My apologies. I did misread the post.

Wow...

Wierd question, but how many projects are in your solution... I ran into
some weird compiler errors when I had a lot of projects. I'm just pulling
straws right now I hope you know.. just trying to help.

-CJ

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I don't think you carefully read my post, but just skimmed for some key
words.

The constructor was declared public. And that caused an error. Taking away
'Public' would then compile fine.

Next time I made a change, it woudln't compile again. So I would put the
'Public' back in. Then it was fine again.

The point being, that I kept needing to add and remove the word 'Public'
every other change in order to get the project to compile.

In fact, I believe that the default for a constructor is 'Public', else
taking 'Public' away, would never have compiled the tester application, as
then it definitely would not have had a constructor.

So again, the question is, why is the compiler complaining constantly

about
not finding a constructor, making me place and remove the word 'Public'
every other compile time, in order to make it work?

Note: There may be other ways that work in getting the compiler to work
other then this trick with 'Public', I don't know. I just found an easy

one.

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
If you don't put an accessor on there doesn't it default it to Friend? In which case doesn't your project B (second compiled) need to be in the same namespace in order for that to work?

So therefore you contructor must be declared public or it doesn't think that
a constructor is avalible for it to use.

Someone correct me if I'm wrong.
"Marina" <so*****@nospam.com> wrote in message
news:uz**************@TK2MSFTNGP11.phx.gbl...
> Hi, if anyone can help on this, please! This is driving me crazy.
>
> I have a user control hierarchy several levels deep that derive for
> UserControl (windows).
>
> The class that is at the top level, has the following constructor
(generated
> by VS.NET)
> Public Sub New()
> MyBase.New()
>
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
>
> End Sub
>
> Sometimes (about half the time), when I recompile my solution (which
> contains a project with this class, and a project with a form tester
trying
> out this user control), I get the error I put in the subject of this

post.
>
> Now, clearly, this class has a constructor.
> If I change the code by removing the word 'Public', and recompile
everything
> is great.
>
> Next time I need to recompile, I get this error again. In this
case, I just
> put the word 'Public' back in, and recompile - all is well again.
>
> So I spend half my time removing 'Public' and then adding it back
in - just
> to get the compiler to change its mind.
>
> Now, it doesn't do this all the time. Sometimes it recompiles OK.
>
> I've checked the project build order - and the project with the user
control
> is compiled first.
>
> I've tried manually compiling the first project - and then the
second. And
> the second always fails, because it thinks there is no constructor
available
> for the user control. Until that is, I take away or remove the
'Public' > keyword off of the constructor - in which case its fine.
>
> Is this some ridiculous VB compiler problem? Some VS.NET bug.
Anything I can
> do about it?
>
> Thanks
>
>



Nov 20 '05 #7

P: n/a
Ok, here is the reproduceable code (at least over here). The controls are in
one project, Form1.vb is in a separate project (one solution).

The key is, there has to be a change in the controls dll (such as adding a
Protected method to BaseInputControl.vb), that will trigger this. Not all
changes cause this behavior - so it doesn't happen with every change - but
very frequently.

BaseInputControl.vb:

Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Public Class BaseInputControl
Inherits UserControl
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Protected WithEvents inputCtl As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.inputCtl = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'inputCtl
'
Me.inputCtl.Location = New System.Drawing.Point(0, 0)
Me.inputCtl.Name = "inputCtl"
Me.inputCtl.Size = New System.Drawing.Size(89, 20)
Me.inputCtl.TabIndex = 0
Me.inputCtl.Text = ""
'
'BaseInputControl
'
Me.Controls.Add(Me.inputCtl)
Me.Name = "BaseInputControl"
Me.Size = New System.Drawing.Size(89, 20)
Me.ResumeLayout(False)
End Sub
#End Region
Private s As String
Protected Sub AdjustBackgroundColor()
End Sub
End Class

BaseFormInputControl.vb:
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Public Class BaseFormInputControl
Inherits BaseInputControl
#Region " Windows Form Designer generated code "
'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
'
'inputCtl
'
Me.inputCtl.AcceptsReturn = True
Me.inputCtl.Name = "inputCtl"
'
'BaseFormInputControl
'
Me.Name = "BaseFormInputControl"
End Sub
#End Region
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
Public Sub test()
End Sub
Private Sub inputCtl_Validating(ByVal sender As Object, ByVal e As
System.EventArgs) Handles inputCtl.Validated
AdjustBackgroundColor()
End Sub
End Class
Form1.vb:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents BaseFormInputControl1 As
TestControlLibrary.BaseFormInputControl
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.BaseFormInputControl1 = New TestControlLibrary.BaseFormInputControl
Me.SuspendLayout()
'
'BaseFormInputControl1
'
Me.BaseFormInputControl1.Location = New System.Drawing.Point(192, 80)
Me.BaseFormInputControl1.Name = "BaseFormInputControl1"
Me.BaseFormInputControl1.Size = New System.Drawing.Size(89, 20)
Me.BaseFormInputControl1.TabIndex = 0
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(448, 266)
Me.Controls.Add(Me.BaseFormInputControl1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
End Class
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:OJ**************@TK2MSFTNGP10.phx.gbl...
My apologies. I did misread the post.

Wow...

Wierd question, but how many projects are in your solution... I ran into
some weird compiler errors when I had a lot of projects. I'm just pulling
straws right now I hope you know.. just trying to help.

-CJ

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I don't think you carefully read my post, but just skimmed for some key
words.

The constructor was declared public. And that caused an error. Taking away
'Public' would then compile fine.

Next time I made a change, it woudln't compile again. So I would put the
'Public' back in. Then it was fine again.

The point being, that I kept needing to add and remove the word 'Public'
every other change in order to get the project to compile.

In fact, I believe that the default for a constructor is 'Public', else
taking 'Public' away, would never have compiled the tester application, as
then it definitely would not have had a constructor.

So again, the question is, why is the compiler complaining constantly

about
not finding a constructor, making me place and remove the word 'Public'
every other compile time, in order to make it work?

Note: There may be other ways that work in getting the compiler to work
other then this trick with 'Public', I don't know. I just found an easy

one.

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
If you don't put an accessor on there doesn't it default it to Friend? In which case doesn't your project B (second compiled) need to be in the same namespace in order for that to work?

So therefore you contructor must be declared public or it doesn't think that
a constructor is avalible for it to use.

Someone correct me if I'm wrong.
"Marina" <so*****@nospam.com> wrote in message
news:uz**************@TK2MSFTNGP11.phx.gbl...
> Hi, if anyone can help on this, please! This is driving me crazy.
>
> I have a user control hierarchy several levels deep that derive for
> UserControl (windows).
>
> The class that is at the top level, has the following constructor
(generated
> by VS.NET)
> Public Sub New()
> MyBase.New()
>
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
>
> End Sub
>
> Sometimes (about half the time), when I recompile my solution (which
> contains a project with this class, and a project with a form tester
trying
> out this user control), I get the error I put in the subject of this

post.
>
> Now, clearly, this class has a constructor.
> If I change the code by removing the word 'Public', and recompile
everything
> is great.
>
> Next time I need to recompile, I get this error again. In this
case, I just
> put the word 'Public' back in, and recompile - all is well again.
>
> So I spend half my time removing 'Public' and then adding it back
in - just
> to get the compiler to change its mind.
>
> Now, it doesn't do this all the time. Sometimes it recompiles OK.
>
> I've checked the project build order - and the project with the user
control
> is compiled first.
>
> I've tried manually compiling the first project - and then the
second. And
> the second always fails, because it thinks there is no constructor
available
> for the user control. Until that is, I take away or remove the
'Public' > keyword off of the constructor - in which case its fine.
>
> Is this some ridiculous VB compiler problem? Some VS.NET bug.
Anything I can
> do about it?
>
> Thanks
>
>



Nov 20 '05 #8

P: n/a
Marina,
VS.NET 2002 or VS.NET 2003?

Are you referencing the Project or the generated DLL?

Does 'Build - Rebuild Solution' take care of the problem? (instead of
modifing the source file).

Hope this helps
Jay

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Ok, here is the reproduceable code (at least over here). The controls are in one project, Form1.vb is in a separate project (one solution).

The key is, there has to be a change in the controls dll (such as adding a
Protected method to BaseInputControl.vb), that will trigger this. Not all
changes cause this behavior - so it doesn't happen with every change - but
very frequently.

BaseInputControl.vb:

Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Public Class BaseInputControl
Inherits UserControl
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Protected WithEvents inputCtl As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.inputCtl = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'inputCtl
'
Me.inputCtl.Location = New System.Drawing.Point(0, 0)
Me.inputCtl.Name = "inputCtl"
Me.inputCtl.Size = New System.Drawing.Size(89, 20)
Me.inputCtl.TabIndex = 0
Me.inputCtl.Text = ""
'
'BaseInputControl
'
Me.Controls.Add(Me.inputCtl)
Me.Name = "BaseInputControl"
Me.Size = New System.Drawing.Size(89, 20)
Me.ResumeLayout(False)
End Sub
#End Region
Private s As String
Protected Sub AdjustBackgroundColor()
End Sub
End Class

BaseFormInputControl.vb:
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Public Class BaseFormInputControl
Inherits BaseInputControl
#Region " Windows Form Designer generated code "
'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() '
'inputCtl
'
Me.inputCtl.AcceptsReturn = True
Me.inputCtl.Name = "inputCtl"
'
'BaseFormInputControl
'
Me.Name = "BaseFormInputControl"
End Sub
#End Region
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
Public Sub test()
End Sub
Private Sub inputCtl_Validating(ByVal sender As Object, ByVal e As
System.EventArgs) Handles inputCtl.Validated
AdjustBackgroundColor()
End Sub
End Class
Form1.vb:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents BaseFormInputControl1 As
TestControlLibrary.BaseFormInputControl
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() Me.BaseFormInputControl1 = New TestControlLibrary.BaseFormInputControl
Me.SuspendLayout()
'
'BaseFormInputControl1
'
Me.BaseFormInputControl1.Location = New System.Drawing.Point(192, 80)
Me.BaseFormInputControl1.Name = "BaseFormInputControl1"
Me.BaseFormInputControl1.Size = New System.Drawing.Size(89, 20)
Me.BaseFormInputControl1.TabIndex = 0
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(448, 266)
Me.Controls.Add(Me.BaseFormInputControl1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
End Class
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:OJ**************@TK2MSFTNGP10.phx.gbl...
My apologies. I did misread the post.

Wow...

Wierd question, but how many projects are in your solution... I ran into
some weird compiler errors when I had a lot of projects. I'm just pulling
straws right now I hope you know.. just trying to help.

-CJ

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I don't think you carefully read my post, but just skimmed for some key words.

The constructor was declared public. And that caused an error. Taking away
'Public' would then compile fine.

Next time I made a change, it woudln't compile again. So I would put the 'Public' back in. Then it was fine again.

The point being, that I kept needing to add and remove the word 'Public' every other change in order to get the project to compile.

In fact, I believe that the default for a constructor is 'Public', else taking 'Public' away, would never have compiled the tester application, as then it definitely would not have had a constructor.

So again, the question is, why is the compiler complaining constantly

about
not finding a constructor, making me place and remove the word
'Public' every other compile time, in order to make it work?

Note: There may be other ways that work in getting the compiler to work other then this trick with 'Public', I don't know. I just found an easy
one.

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
> If you don't put an accessor on there doesn't it default it to
Friend? In
> which case doesn't your project B (second compiled) need to be in
the same
> namespace in order for that to work?
>
> So therefore you contructor must be declared public or it doesn't

think that
> a constructor is avalible for it to use.
>
> Someone correct me if I'm wrong.
>
>
> "Marina" <so*****@nospam.com> wrote in message
> news:uz**************@TK2MSFTNGP11.phx.gbl...
> > Hi, if anyone can help on this, please! This is driving me crazy.
> >
> > I have a user control hierarchy several levels deep that derive
for > > UserControl (windows).
> >
> > The class that is at the top level, has the following constructor
> (generated
> > by VS.NET)
> > Public Sub New()
> > MyBase.New()
> >
> > 'This call is required by the Windows Form Designer.
> > InitializeComponent()
> > 'Add any initialization after the InitializeComponent() call > >
> > End Sub
> >
> > Sometimes (about half the time), when I recompile my solution (which > > contains a project with this class, and a project with a form tester > trying
> > out this user control), I get the error I put in the subject of this post.
> >
> > Now, clearly, this class has a constructor.
> > If I change the code by removing the word 'Public', and recompile
> everything
> > is great.
> >
> > Next time I need to recompile, I get this error again. In this

case,
I
> just
> > put the word 'Public' back in, and recompile - all is well again.
> >
> > So I spend half my time removing 'Public' and then adding it back

in - > just
> > to get the compiler to change its mind.
> >
> > Now, it doesn't do this all the time. Sometimes it recompiles OK.
> >
> > I've checked the project build order - and the project with the user > control
> > is compiled first.
> >
> > I've tried manually compiling the first project - and then the second. And
> > the second always fails, because it thinks there is no constructor
> available
> > for the user control. Until that is, I take away or remove the

'Public'
> > keyword off of the constructor - in which case its fine.
> >
> > Is this some ridiculous VB compiler problem? Some VS.NET bug.

Anything
I
> can
> > do about it?
> >
> > Thanks
> >
> >
>
>



Nov 20 '05 #9

P: n/a
Hi Marina,

I can not reproduce it, can you tell me what I have to add to the method?

After you answered the question from Jay of course.

However you will see my next answer not for tomorrow probably, so do not
count to much on that.

Cor
Nov 20 '05 #10

P: n/a
Well, just try adding a new method to BaseInputControl that is protected -
doing that usually does the trick for me.

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:es**************@TK2MSFTNGP12.phx.gbl...
Hi Marina,

I can not reproduce it, can you tell me what I have to add to the method?

After you answered the question from Jay of course.

However you will see my next answer not for tomorrow probably, so do not
count to much on that.

Cor

Nov 20 '05 #11

P: n/a
As you can see in my response to Jay, rebuilding the solution helps. I am
still mystified as to why this happens at all, and why this particular error
in this particular case.

In any case, thanks for taking an interest and trying to help.

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:es**************@TK2MSFTNGP12.phx.gbl...
Hi Marina,

I can not reproduce it, can you tell me what I have to add to the method?

After you answered the question from Jay of course.

However you will see my next answer not for tomorrow probably, so do not
count to much on that.

Cor

Nov 20 '05 #12

P: n/a
This is VS.NET 2003.

I am referencing the generated DLL.

Oddly enough - chosing rebuild solution does work.

I've gotten used to doing just a build (ctl + shift + b), and I've doing
that for probably 3 years and haven't had a problem yet. I guess I'll have
to reassign that to the rebuild command...

Do you have any idea why rebuilding the solution helps?

Or better yet, why does this happen at all?

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
Marina,
VS.NET 2002 or VS.NET 2003?

Are you referencing the Project or the generated DLL?

Does 'Build - Rebuild Solution' take care of the problem? (instead of
modifing the source file).

Hope this helps
Jay

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Ok, here is the reproduceable code (at least over here). The controls are
in
one project, Form1.vb is in a separate project (one solution).

The key is, there has to be a change in the controls dll (such as adding a Protected method to BaseInputControl.vb), that will trigger this. Not all changes cause this behavior - so it doesn't happen with every change - but very frequently.

BaseInputControl.vb:

Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Public Class BaseInputControl
Inherits UserControl
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Protected WithEvents inputCtl As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()
Me.inputCtl = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'inputCtl
'
Me.inputCtl.Location = New System.Drawing.Point(0, 0)
Me.inputCtl.Name = "inputCtl"
Me.inputCtl.Size = New System.Drawing.Size(89, 20)
Me.inputCtl.TabIndex = 0
Me.inputCtl.Text = ""
'
'BaseInputControl
'
Me.Controls.Add(Me.inputCtl)
Me.Name = "BaseInputControl"
Me.Size = New System.Drawing.Size(89, 20)
Me.ResumeLayout(False)
End Sub
#End Region
Private s As String
Protected Sub AdjustBackgroundColor()
End Sub
End Class

BaseFormInputControl.vb:
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Public Class BaseFormInputControl
Inherits BaseInputControl
#Region " Windows Form Designer generated code "
'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()
'
'inputCtl
'
Me.inputCtl.AcceptsReturn = True
Me.inputCtl.Name = "inputCtl"
'
'BaseFormInputControl
'
Me.Name = "BaseFormInputControl"
End Sub
#End Region
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
Public Sub test()
End Sub
Private Sub inputCtl_Validating(ByVal sender As Object, ByVal e As
System.EventArgs) Handles inputCtl.Validated
AdjustBackgroundColor()
End Sub
End Class
Form1.vb:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents BaseFormInputControl1 As
TestControlLibrary.BaseFormInputControl
<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()
Me.BaseFormInputControl1 = New TestControlLibrary.BaseFormInputControl
Me.SuspendLayout()
'
'BaseFormInputControl1
'
Me.BaseFormInputControl1.Location = New System.Drawing.Point(192, 80)
Me.BaseFormInputControl1.Name = "BaseFormInputControl1"
Me.BaseFormInputControl1.Size = New System.Drawing.Size(89, 20)
Me.BaseFormInputControl1.TabIndex = 0
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(448, 266)
Me.Controls.Add(Me.BaseFormInputControl1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
End Class
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:OJ**************@TK2MSFTNGP10.phx.gbl...
My apologies. I did misread the post.

Wow...

Wierd question, but how many projects are in your solution... I ran into some weird compiler errors when I had a lot of projects. I'm just pulling straws right now I hope you know.. just trying to help.

-CJ

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
> I don't think you carefully read my post, but just skimmed for some key > words.
>
> The constructor was declared public. And that caused an error. Taking away
> 'Public' would then compile fine.
>
> Next time I made a change, it woudln't compile again. So I would put the > 'Public' back in. Then it was fine again.
>
> The point being, that I kept needing to add and remove the word 'Public' > every other change in order to get the project to compile.
>
> In fact, I believe that the default for a constructor is 'Public', else > taking 'Public' away, would never have compiled the tester application,
as
> then it definitely would not have had a constructor.
>
> So again, the question is, why is the compiler complaining constantly about
> not finding a constructor, making me place and remove the word

'Public' > every other compile time, in order to make it work?
>
> Note: There may be other ways that work in getting the compiler to work > other then this trick with 'Public', I don't know. I just found an easy one.
>
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:%2****************@TK2MSFTNGP11.phx.gbl...
> > If you don't put an accessor on there doesn't it default it to Friend? In
> > which case doesn't your project B (second compiled) need to be in the same
> > namespace in order for that to work?
> >
> > So therefore you contructor must be declared public or it doesn't

think
> that
> > a constructor is avalible for it to use.
> >
> > Someone correct me if I'm wrong.
> >
> >
> > "Marina" <so*****@nospam.com> wrote in message
> > news:uz**************@TK2MSFTNGP11.phx.gbl...
> > > Hi, if anyone can help on this, please! This is driving me crazy. > > >
> > > I have a user control hierarchy several levels deep that derive for > > > UserControl (windows).
> > >
> > > The class that is at the top level, has the following constructor > > (generated
> > > by VS.NET)
> > > Public Sub New()
> > > MyBase.New()
> > >
> > > 'This call is required by the Windows Form Designer.
> > > InitializeComponent()
> > > 'Add any initialization after the InitializeComponent() call > > >
> > > End Sub
> > >
> > > Sometimes (about half the time), when I recompile my solution (which > > > contains a project with this class, and a project with a form tester > > trying
> > > out this user control), I get the error I put in the subject of this > post.
> > >
> > > Now, clearly, this class has a constructor.
> > > If I change the code by removing the word 'Public', and recompile > > everything
> > > is great.
> > >
> > > Next time I need to recompile, I get this error again. In this

case,
I
> > just
> > > put the word 'Public' back in, and recompile - all is well again. > > >
> > > So I spend half my time removing 'Public' and then adding it back in -
> > just
> > > to get the compiler to change its mind.
> > >
> > > Now, it doesn't do this all the time. Sometimes it recompiles
OK. > > >
> > > I've checked the project build order - and the project with the

user > > control
> > > is compiled first.
> > >
> > > I've tried manually compiling the first project - and then the

second.
> And
> > > the second always fails, because it thinks there is no constructor > > available
> > > for the user control. Until that is, I take away or remove the
'Public'
> > > keyword off of the constructor - in which case its fine.
> > >
> > > Is this some ridiculous VB compiler problem? Some VS.NET bug.

Anything
I
> > can
> > > do about it?
> > >
> > > Thanks
> > >
> > >
> >
> >
>
>



Nov 20 '05 #13

P: n/a
"Marina" <so*****@nospam.com> schrieb
Well, just try adding a new method to BaseInputControl that is
protected - doing that usually does the trick for me.


When I do it, I get an error in BaseInputControl:

"TestControlLibrary.BaseInputControl.Private Sub InitializeComponent()" is
not accesible in this context because it is "private".

I think the error is not ok. When I rebuild, the error disappears.
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #14

P: n/a
Marina,
I normally reference the project itself, not the DLL. My understanding is
referencing the project enables VS.NET to better determine dependencies.
Or better yet, why does this happen at all? I believe it happens because the background compilation gets confused.

http://www.panopticoncentral.net/arc...03/07/284.aspx
http://www.panopticoncentral.net/arc...03/19/291.aspx
Do you have any idea why rebuilding the solution helps? My theory is the background compilation gets confused, and the Build Rebuild
Solution throws every thing out & does a 100% clean compile, however that is
just my theory.

I know VS.NET 2002 had more problems with then VS.NET 2003 does, at least on
the multi-project solutions that I have worked on.

Hope this helps
Jay
"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl... This is VS.NET 2003.

I am referencing the generated DLL.

Oddly enough - chosing rebuild solution does work.

I've gotten used to doing just a build (ctl + shift + b), and I've doing
that for probably 3 years and haven't had a problem yet. I guess I'll have
to reassign that to the rebuild command...

Do you have any idea why rebuilding the solution helps?

Or better yet, why does this happen at all?

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:%2*****************@TK2MSFTNGP11.phx.gbl...
Marina,
VS.NET 2002 or VS.NET 2003?

Are you referencing the Project or the generated DLL?

Does 'Build - Rebuild Solution' take care of the problem? (instead of
modifing the source file).

Hope this helps
Jay

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Ok, here is the reproduceable code (at least over here). The controls are
in
one project, Form1.vb is in a separate project (one solution).

The key is, there has to be a change in the controls dll (such as adding
a Protected method to BaseInputControl.vb), that will trigger this. Not all changes cause this behavior - so it doesn't happen with every change - but very frequently.

BaseInputControl.vb:

Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Public Class BaseInputControl
Inherits UserControl
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form
Designer 'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Protected WithEvents inputCtl As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()
Me.inputCtl = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'inputCtl
'
Me.inputCtl.Location = New System.Drawing.Point(0, 0)
Me.inputCtl.Name = "inputCtl"
Me.inputCtl.Size = New System.Drawing.Size(89, 20)
Me.inputCtl.TabIndex = 0
Me.inputCtl.Text = ""
'
'BaseInputControl
'
Me.Controls.Add(Me.inputCtl)
Me.Name = "BaseInputControl"
Me.Size = New System.Drawing.Size(89, 20)
Me.ResumeLayout(False)
End Sub
#End Region
Private s As String
Protected Sub AdjustBackgroundColor()
End Sub
End Class

BaseFormInputControl.vb:
Imports System.ComponentModel
Imports System.ComponentModel.Design
Imports System.Drawing.Design
Public Class BaseFormInputControl
Inherits BaseInputControl
#Region " Windows Form Designer generated code "
'UserControl overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()
'
'inputCtl
'
Me.inputCtl.AcceptsReturn = True
Me.inputCtl.Name = "inputCtl"
'
'BaseFormInputControl
'
Me.Name = "BaseFormInputControl"
End Sub
#End Region
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
Public Sub test()
End Sub
Private Sub inputCtl_Validating(ByVal sender As Object, ByVal e As
System.EventArgs) Handles inputCtl.Validated
AdjustBackgroundColor()
End Sub
End Class
Form1.vb:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents BaseFormInputControl1 As
TestControlLibrary.BaseFormInputControl
<System.Diagnostics.DebuggerStepThrough()> Private Sub

InitializeComponent()
Me.BaseFormInputControl1 = New TestControlLibrary.BaseFormInputControl
Me.SuspendLayout()
'
'BaseFormInputControl1
'
Me.BaseFormInputControl1.Location = New System.Drawing.Point(192, 80)
Me.BaseFormInputControl1.Name = "BaseFormInputControl1"
Me.BaseFormInputControl1.Size = New System.Drawing.Size(89, 20)
Me.BaseFormInputControl1.TabIndex = 0
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(448, 266)
Me.Controls.Add(Me.BaseFormInputControl1)
Me.Name = "Form1"
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
End Class
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:OJ**************@TK2MSFTNGP10.phx.gbl...
> My apologies. I did misread the post.
>
> Wow...
>
> Wierd question, but how many projects are in your solution... I ran into > some weird compiler errors when I had a lot of projects. I'm just

pulling
> straws right now I hope you know.. just trying to help.
>
> -CJ
>
> "Marina" <so*****@nospam.com> wrote in message
> news:%2****************@TK2MSFTNGP09.phx.gbl...
> > I don't think you carefully read my post, but just skimmed for some key
> > words.
> >
> > The constructor was declared public. And that caused an error. Taking > away
> > 'Public' would then compile fine.
> >
> > Next time I made a change, it woudln't compile again. So I would
put
the
> > 'Public' back in. Then it was fine again.
> >
> > The point being, that I kept needing to add and remove the word

'Public'
> > every other change in order to get the project to compile.
> >
> > In fact, I believe that the default for a constructor is 'Public',

else
> > taking 'Public' away, would never have compiled the tester

application,
as
> > then it definitely would not have had a constructor.
> >
> > So again, the question is, why is the compiler complaining constantly > about
> > not finding a constructor, making me place and remove the word

'Public'
> > every other compile time, in order to make it work?
> >
> > Note: There may be other ways that work in getting the compiler to

work
> > other then this trick with 'Public', I don't know. I just found an

easy
> one.
> >
> > "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> > news:%2****************@TK2MSFTNGP11.phx.gbl...
> > > If you don't put an accessor on there doesn't it default it to

Friend?
> In
> > > which case doesn't your project B (second compiled) need to be
in the
> same
> > > namespace in order for that to work?
> > >
> > > So therefore you contructor must be declared public or it
doesn't think
> > that
> > > a constructor is avalible for it to use.
> > >
> > > Someone correct me if I'm wrong.
> > >
> > >
> > > "Marina" <so*****@nospam.com> wrote in message
> > > news:uz**************@TK2MSFTNGP11.phx.gbl...
> > > > Hi, if anyone can help on this, please! This is driving me

crazy. > > > >
> > > > I have a user control hierarchy several levels deep that derive for
> > > > UserControl (windows).
> > > >
> > > > The class that is at the top level, has the following constructor > > > (generated
> > > > by VS.NET)
> > > > Public Sub New()
> > > > MyBase.New()
> > > >
> > > > 'This call is required by the Windows Form Designer.
> > > > InitializeComponent()
> > > > 'Add any initialization after the
InitializeComponent()
call
> > > >
> > > > End Sub
> > > >
> > > > Sometimes (about half the time), when I recompile my solution

(which
> > > > contains a project with this class, and a project with a form

tester
> > > trying
> > > > out this user control), I get the error I put in the subject
of this
> > post.
> > > >
> > > > Now, clearly, this class has a constructor.
> > > > If I change the code by removing the word 'Public', and recompile > > > everything
> > > > is great.
> > > >
> > > > Next time I need to recompile, I get this error again. In
this case,
> I
> > > just
> > > > put the word 'Public' back in, and recompile - all is well

again. > > > >
> > > > So I spend half my time removing 'Public' and then adding it back in -
> > > just
> > > > to get the compiler to change its mind.
> > > >
> > > > Now, it doesn't do this all the time. Sometimes it recompiles OK. > > > >
> > > > I've checked the project build order - and the project with the user
> > > control
> > > > is compiled first.
> > > >
> > > > I've tried manually compiling the first project - and then the
second.
> > And
> > > > the second always fails, because it thinks there is no constructor > > > available
> > > > for the user control. Until that is, I take away or remove

the > 'Public'
> > > > keyword off of the constructor - in which case its fine.
> > > >
> > > > Is this some ridiculous VB compiler problem? Some VS.NET bug.
Anything
> I
> > > can
> > > > do about it?
> > > >
> > > > Thanks
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #15

P: n/a

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:O6**************@TK2MSFTNGP10.phx.gbl...
Marina,
I normally reference the project itself, not the DLL. My understanding is
referencing the project enables VS.NET to better determine dependencies.
Or better yet, why does this happen at all? I believe it happens because the background compilation gets confused.

http://www.panopticoncentral.net/arc...03/07/284.aspx
http://www.panopticoncentral.net/arc...03/19/291.aspx
Do you have any idea why rebuilding the solution helps?

My theory is the background compilation gets confused, and the Build

Rebuild Solution throws every thing out & does a 100% clean compile, however that is just my theory.

I'd agree with that theory. I would compare it to make clean;
=0

I know VS.NET 2002 had more problems with then VS.NET 2003 does, at least on the multi-project solutions that I have worked on.

I too saw more problems in VS 2002

Hope this helps
Jay
"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
This is VS.NET 2003.

I am referencing the generated DLL.

Oddly enough - chosing rebuild solution does work.

I've gotten used to doing just a build (ctl + shift + b), and I've doing
that for probably 3 years and haven't had a problem yet. I guess I'll have
to reassign that to the rebuild command...

Do you have any idea why rebuilding the solution helps?

Or better yet, why does this happen at all?

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:%2*****************@TK2MSFTNGP11.phx.gbl...
Marina,
VS.NET 2002 or VS.NET 2003?

Are you referencing the Project or the generated DLL?

Does 'Build - Rebuild Solution' take care of the problem? (instead of
modifing the source file).

Hope this helps
Jay

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> Ok, here is the reproduceable code (at least over here). The controls
are
in
> one project, Form1.vb is in a separate project (one solution).
>
> The key is, there has to be a change in the controls dll (such as adding
a
> Protected method to BaseInputControl.vb), that will trigger this.

Not all
> changes cause this behavior - so it doesn't happen with every
change - but
> very frequently.
>
> BaseInputControl.vb:
>
> Imports System.ComponentModel
> Imports System.ComponentModel.Design
> Imports System.Drawing.Design
> Public Class BaseInputControl
> Inherits UserControl
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Dispose()
> End If
> End If
> MyBase.Dispose(disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.ComponentModel.IContainer
> 'NOTE: The following procedure is required by the Windows Form

Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Protected WithEvents inputCtl As System.Windows.Forms.TextBox
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
> Me.inputCtl = New System.Windows.Forms.TextBox
> Me.SuspendLayout()
> '
> 'inputCtl
> '
> Me.inputCtl.Location = New System.Drawing.Point(0, 0)
> Me.inputCtl.Name = "inputCtl"
> Me.inputCtl.Size = New System.Drawing.Size(89, 20)
> Me.inputCtl.TabIndex = 0
> Me.inputCtl.Text = ""
> '
> 'BaseInputControl
> '
> Me.Controls.Add(Me.inputCtl)
> Me.Name = "BaseInputControl"
> Me.Size = New System.Drawing.Size(89, 20)
> Me.ResumeLayout(False)
> End Sub
> #End Region
> Private s As String
> Protected Sub AdjustBackgroundColor()
> End Sub
> End Class
>
> BaseFormInputControl.vb:
> Imports System.ComponentModel
> Imports System.ComponentModel.Design
> Imports System.Drawing.Design
> Public Class BaseFormInputControl
> Inherits BaseInputControl
> #Region " Windows Form Designer generated code "
> 'UserControl overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Dispose()
> End If
> End If
> MyBase.Dispose(disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.ComponentModel.IContainer
> 'NOTE: The following procedure is required by the Windows Form Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
> '
> 'inputCtl
> '
> Me.inputCtl.AcceptsReturn = True
> Me.inputCtl.Name = "inputCtl"
> '
> 'BaseFormInputControl
> '
> Me.Name = "BaseFormInputControl"
> End Sub
> #End Region
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
> End Sub
> Public Sub test()
> End Sub
> Private Sub inputCtl_Validating(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles inputCtl.Validated
> AdjustBackgroundColor()
> End Sub
> End Class
> Form1.vb:
> Public Class Form1
> Inherits System.Windows.Forms.Form
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Dispose()
> End If
> End If
> MyBase.Dispose(disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.ComponentModel.IContainer
> 'NOTE: The following procedure is required by the Windows Form Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Friend WithEvents BaseFormInputControl1 As
> TestControlLibrary.BaseFormInputControl
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
> Me.BaseFormInputControl1 = New TestControlLibrary.BaseFormInputControl > Me.SuspendLayout()
> '
> 'BaseFormInputControl1
> '
> Me.BaseFormInputControl1.Location = New System.Drawing.Point(192, 80) > Me.BaseFormInputControl1.Name = "BaseFormInputControl1"
> Me.BaseFormInputControl1.Size = New System.Drawing.Size(89, 20)
> Me.BaseFormInputControl1.TabIndex = 0
> '
> 'Form1
> '
> Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
> Me.ClientSize = New System.Drawing.Size(448, 266)
> Me.Controls.Add(Me.BaseFormInputControl1)
> Me.Name = "Form1"
> Me.Text = "Form1"
> Me.ResumeLayout(False)
> End Sub
> #End Region
> End Class
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:OJ**************@TK2MSFTNGP10.phx.gbl...
> > My apologies. I did misread the post.
> >
> > Wow...
> >
> > Wierd question, but how many projects are in your solution... I ran into
> > some weird compiler errors when I had a lot of projects. I'm just
pulling
> > straws right now I hope you know.. just trying to help.
> >
> > -CJ
> >
> > "Marina" <so*****@nospam.com> wrote in message
> > news:%2****************@TK2MSFTNGP09.phx.gbl...
> > > I don't think you carefully read my post, but just skimmed for some key
> > > words.
> > >
> > > The constructor was declared public. And that caused an error.

Taking
> > away
> > > 'Public' would then compile fine.
> > >
> > > Next time I made a change, it woudln't compile again. So I would put the
> > > 'Public' back in. Then it was fine again.
> > >
> > > The point being, that I kept needing to add and remove the word
'Public'
> > > every other change in order to get the project to compile.
> > >
> > > In fact, I believe that the default for a constructor is
'Public', else
> > > taking 'Public' away, would never have compiled the tester
application,
> as
> > > then it definitely would not have had a constructor.
> > >
> > > So again, the question is, why is the compiler complaining

constantly
> > about
> > > not finding a constructor, making me place and remove the word
'Public'
> > > every other compile time, in order to make it work?
> > >
> > > Note: There may be other ways that work in getting the compiler to work
> > > other then this trick with 'Public', I don't know. I just found an easy
> > one.
> > >
> > > "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> > > news:%2****************@TK2MSFTNGP11.phx.gbl...
> > > > If you don't put an accessor on there doesn't it default it to
Friend?
> > In
> > > > which case doesn't your project B (second compiled) need to be in the
> > same
> > > > namespace in order for that to work?
> > > >
> > > > So therefore you contructor must be declared public or it doesn't > think
> > > that
> > > > a constructor is avalible for it to use.
> > > >
> > > > Someone correct me if I'm wrong.
> > > >
> > > >
> > > > "Marina" <so*****@nospam.com> wrote in message
> > > > news:uz**************@TK2MSFTNGP11.phx.gbl...
> > > > > Hi, if anyone can help on this, please! This is driving me

crazy.
> > > > >
> > > > > I have a user control hierarchy several levels deep that derive for
> > > > > UserControl (windows).
> > > > >
> > > > > The class that is at the top level, has the following

constructor
> > > > (generated
> > > > > by VS.NET)
> > > > > Public Sub New()
> > > > > MyBase.New()
> > > > >
> > > > > 'This call is required by the Windows Form Designer.
> > > > > InitializeComponent()
> > > > > 'Add any initialization after the InitializeComponent() call
> > > > >
> > > > > End Sub
> > > > >
> > > > > Sometimes (about half the time), when I recompile my solution (which
> > > > > contains a project with this class, and a project with a form tester
> > > > trying
> > > > > out this user control), I get the error I put in the subject of this
> > > post.
> > > > >
> > > > > Now, clearly, this class has a constructor.
> > > > > If I change the code by removing the word 'Public', and

recompile
> > > > everything
> > > > > is great.
> > > > >
> > > > > Next time I need to recompile, I get this error again. In this > case,
> > I
> > > > just
> > > > > put the word 'Public' back in, and recompile - all is well

again.
> > > > >
> > > > > So I spend half my time removing 'Public' and then adding it

back
> in -
> > > > just
> > > > > to get the compiler to change its mind.
> > > > >
> > > > > Now, it doesn't do this all the time. Sometimes it recompiles OK.
> > > > >
> > > > > I've checked the project build order - and the project with the user
> > > > control
> > > > > is compiled first.
> > > > >
> > > > > I've tried manually compiling the first project - and then
the > second.
> > > And
> > > > > the second always fails, because it thinks there is no

constructor
> > > > available
> > > > > for the user control. Until that is, I take away or remove

the > > 'Public'
> > > > > keyword off of the constructor - in which case its fine.
> > > > >
> > > > > Is this some ridiculous VB compiler problem? Some VS.NET bug. > Anything
> > I
> > > > can
> > > > > do about it?
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #16

P: n/a
Thanks for quoting the whole code! Now I got it 5 times. :-(
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #17

P: n/a
Sorry.

=)

"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
Thanks for quoting the whole code! Now I got it 5 times. :-(
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #18

P: n/a
Ok, thanks to everyone who took time to look at this.

I guess that 'background compilation' gets confused is about the best answer
as to why 'building' the solution doesn't work but 'rebuilding' it does.

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:O6**************@TK2MSFTNGP10.phx.gbl...
Marina,
I normally reference the project itself, not the DLL. My understanding is
referencing the project enables VS.NET to better determine dependencies.
Or better yet, why does this happen at all? I believe it happens because the background compilation gets confused.

http://www.panopticoncentral.net/arc...03/07/284.aspx
http://www.panopticoncentral.net/arc...03/19/291.aspx
Do you have any idea why rebuilding the solution helps?

My theory is the background compilation gets confused, and the Build

Rebuild Solution throws every thing out & does a 100% clean compile, however that is just my theory.

I know VS.NET 2002 had more problems with then VS.NET 2003 does, at least on the multi-project solutions that I have worked on.

Hope this helps
Jay
"Marina" <so*****@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
This is VS.NET 2003.

I am referencing the generated DLL.

Oddly enough - chosing rebuild solution does work.

I've gotten used to doing just a build (ctl + shift + b), and I've doing
that for probably 3 years and haven't had a problem yet. I guess I'll have
to reassign that to the rebuild command...

Do you have any idea why rebuilding the solution helps?

Or better yet, why does this happen at all?

Thanks

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:%2*****************@TK2MSFTNGP11.phx.gbl...
Marina,
VS.NET 2002 or VS.NET 2003?

Are you referencing the Project or the generated DLL?

Does 'Build - Rebuild Solution' take care of the problem? (instead of
modifing the source file).

Hope this helps
Jay

"Marina" <so*****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
> Ok, here is the reproduceable code (at least over here). The controls
are
in
> one project, Form1.vb is in a separate project (one solution).
>
> The key is, there has to be a change in the controls dll (such as adding
a
> Protected method to BaseInputControl.vb), that will trigger this.

Not all
> changes cause this behavior - so it doesn't happen with every
change - but
> very frequently.
>
> BaseInputControl.vb:
>
> Imports System.ComponentModel
> Imports System.ComponentModel.Design
> Imports System.Drawing.Design
> Public Class BaseInputControl
> Inherits UserControl
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As
Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Dispose()
> End If
> End If
> MyBase.Dispose(disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.ComponentModel.IContainer
> 'NOTE: The following procedure is required by the Windows Form

Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Protected WithEvents inputCtl As System.Windows.Forms.TextBox
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
> Me.inputCtl = New System.Windows.Forms.TextBox
> Me.SuspendLayout()
> '
> 'inputCtl
> '
> Me.inputCtl.Location = New System.Drawing.Point(0, 0)
> Me.inputCtl.Name = "inputCtl"
> Me.inputCtl.Size = New System.Drawing.Size(89, 20)
> Me.inputCtl.TabIndex = 0
> Me.inputCtl.Text = ""
> '
> 'BaseInputControl
> '
> Me.Controls.Add(Me.inputCtl)
> Me.Name = "BaseInputControl"
> Me.Size = New System.Drawing.Size(89, 20)
> Me.ResumeLayout(False)
> End Sub
> #End Region
> Private s As String
> Protected Sub AdjustBackgroundColor()
> End Sub
> End Class
>
> BaseFormInputControl.vb:
> Imports System.ComponentModel
> Imports System.ComponentModel.Design
> Imports System.Drawing.Design
> Public Class BaseFormInputControl
> Inherits BaseInputControl
> #Region " Windows Form Designer generated code "
> 'UserControl overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Dispose()
> End If
> End If
> MyBase.Dispose(disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.ComponentModel.IContainer
> 'NOTE: The following procedure is required by the Windows Form Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
> '
> 'inputCtl
> '
> Me.inputCtl.AcceptsReturn = True
> Me.inputCtl.Name = "inputCtl"
> '
> 'BaseFormInputControl
> '
> Me.Name = "BaseFormInputControl"
> End Sub
> #End Region
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
> End Sub
> Public Sub test()
> End Sub
> Private Sub inputCtl_Validating(ByVal sender As Object, ByVal e As
> System.EventArgs) Handles inputCtl.Validated
> AdjustBackgroundColor()
> End Sub
> End Class
> Form1.vb:
> Public Class Form1
> Inherits System.Windows.Forms.Form
> #Region " Windows Form Designer generated code "
> Public Sub New()
> MyBase.New()
> 'This call is required by the Windows Form Designer.
> InitializeComponent()
> 'Add any initialization after the InitializeComponent() call
> End Sub
> 'Form overrides dispose to clean up the component list.
> Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean) > If disposing Then
> If Not (components Is Nothing) Then
> components.Dispose()
> End If
> End If
> MyBase.Dispose(disposing)
> End Sub
> 'Required by the Windows Form Designer
> Private components As System.ComponentModel.IContainer
> 'NOTE: The following procedure is required by the Windows Form Designer > 'It can be modified using the Windows Form Designer.
> 'Do not modify it using the code editor.
> Friend WithEvents BaseFormInputControl1 As
> TestControlLibrary.BaseFormInputControl
> <System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()
> Me.BaseFormInputControl1 = New TestControlLibrary.BaseFormInputControl > Me.SuspendLayout()
> '
> 'BaseFormInputControl1
> '
> Me.BaseFormInputControl1.Location = New System.Drawing.Point(192, 80) > Me.BaseFormInputControl1.Name = "BaseFormInputControl1"
> Me.BaseFormInputControl1.Size = New System.Drawing.Size(89, 20)
> Me.BaseFormInputControl1.TabIndex = 0
> '
> 'Form1
> '
> Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
> Me.ClientSize = New System.Drawing.Size(448, 266)
> Me.Controls.Add(Me.BaseFormInputControl1)
> Me.Name = "Form1"
> Me.Text = "Form1"
> Me.ResumeLayout(False)
> End Sub
> #End Region
> End Class
> "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> news:OJ**************@TK2MSFTNGP10.phx.gbl...
> > My apologies. I did misread the post.
> >
> > Wow...
> >
> > Wierd question, but how many projects are in your solution... I ran into
> > some weird compiler errors when I had a lot of projects. I'm just
pulling
> > straws right now I hope you know.. just trying to help.
> >
> > -CJ
> >
> > "Marina" <so*****@nospam.com> wrote in message
> > news:%2****************@TK2MSFTNGP09.phx.gbl...
> > > I don't think you carefully read my post, but just skimmed for some key
> > > words.
> > >
> > > The constructor was declared public. And that caused an error.

Taking
> > away
> > > 'Public' would then compile fine.
> > >
> > > Next time I made a change, it woudln't compile again. So I would put the
> > > 'Public' back in. Then it was fine again.
> > >
> > > The point being, that I kept needing to add and remove the word
'Public'
> > > every other change in order to get the project to compile.
> > >
> > > In fact, I believe that the default for a constructor is
'Public', else
> > > taking 'Public' away, would never have compiled the tester
application,
> as
> > > then it definitely would not have had a constructor.
> > >
> > > So again, the question is, why is the compiler complaining

constantly
> > about
> > > not finding a constructor, making me place and remove the word
'Public'
> > > every other compile time, in order to make it work?
> > >
> > > Note: There may be other ways that work in getting the compiler to work
> > > other then this trick with 'Public', I don't know. I just found an easy
> > one.
> > >
> > > "CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
> > > news:%2****************@TK2MSFTNGP11.phx.gbl...
> > > > If you don't put an accessor on there doesn't it default it to
Friend?
> > In
> > > > which case doesn't your project B (second compiled) need to be in the
> > same
> > > > namespace in order for that to work?
> > > >
> > > > So therefore you contructor must be declared public or it doesn't > think
> > > that
> > > > a constructor is avalible for it to use.
> > > >
> > > > Someone correct me if I'm wrong.
> > > >
> > > >
> > > > "Marina" <so*****@nospam.com> wrote in message
> > > > news:uz**************@TK2MSFTNGP11.phx.gbl...
> > > > > Hi, if anyone can help on this, please! This is driving me

crazy.
> > > > >
> > > > > I have a user control hierarchy several levels deep that derive for
> > > > > UserControl (windows).
> > > > >
> > > > > The class that is at the top level, has the following

constructor
> > > > (generated
> > > > > by VS.NET)
> > > > > Public Sub New()
> > > > > MyBase.New()
> > > > >
> > > > > 'This call is required by the Windows Form Designer.
> > > > > InitializeComponent()
> > > > > 'Add any initialization after the InitializeComponent() call
> > > > >
> > > > > End Sub
> > > > >
> > > > > Sometimes (about half the time), when I recompile my solution (which
> > > > > contains a project with this class, and a project with a form tester
> > > > trying
> > > > > out this user control), I get the error I put in the subject of this
> > > post.
> > > > >
> > > > > Now, clearly, this class has a constructor.
> > > > > If I change the code by removing the word 'Public', and

recompile
> > > > everything
> > > > > is great.
> > > > >
> > > > > Next time I need to recompile, I get this error again. In this > case,
> > I
> > > > just
> > > > > put the word 'Public' back in, and recompile - all is well

again.
> > > > >
> > > > > So I spend half my time removing 'Public' and then adding it

back
> in -
> > > > just
> > > > > to get the compiler to change its mind.
> > > > >
> > > > > Now, it doesn't do this all the time. Sometimes it recompiles OK.
> > > > >
> > > > > I've checked the project build order - and the project with the user
> > > > control
> > > > > is compiled first.
> > > > >
> > > > > I've tried manually compiling the first project - and then
the > second.
> > > And
> > > > > the second always fails, because it thinks there is no

constructor
> > > > available
> > > > > for the user control. Until that is, I take away or remove

the > > 'Public'
> > > > > keyword off of the constructor - in which case its fine.
> > > > >
> > > > > Is this some ridiculous VB compiler problem? Some VS.NET bug. > Anything
> > I
> > > > can
> > > > > do about it?
> > > > >
> > > > > Thanks
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Nov 20 '05 #19

P: n/a
"CJ Taylor" <[cege] at [tavayn] dit commmmm> schrieb
Sorry.

=)


Ok. :)
--
Armin

Nov 20 '05 #20

This discussion thread is closed

Replies have been disabled for this discussion.