Strange deployment problem

S

Simon Verona

I have a strange problem with a Windows Forms application.

It installs and runs fine on my development machine but consistently comes
up with errors on any installed machine.

I get an error about an unhandled exception as the application starts up.

If I go to debugger I get the error showing as :

[thread 0x1220] Unhandled exception generated: (0x04941b54)
<System.NullReferenc
eException>
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x04942e38) "Object reference not set to an instance of an
object."
_innerException=<null>
_helpURL=<null>
_stackTrace=(0x04942eb4) array with dims=[60]
_stackTraceString=<null>
_remoteStackTraceString=<null>
_remoteStackIndex=0x00000000
_HResult=0x80004003
_source=<null>
_xptrs=0x0012ed28
_xcode=0xc0000005


I've attempted to trace the problem in my code by inserted msgbox lines to
work out where it falls over.

The form is an inherited form (which itself inherits from a standard Windows
Form). It seems to crash as it instantiates a user control on the form.

The line it appears to fall over on is :

Me.DmsTextBox1 = New DMSControls.DmsTextBox



DMSTextBox is my usercontrol. If I put a msgbox before this line I see
it.



The start of the usercontrol reads:



Public Sub New()

MyBase.New()

MsgBox("Start_Input_Box")

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub



You never see the msgbox that is at the top of this form....

I'm lost as to what the problem might be!

Anybody any further clues as to what I can do to locate / fix the problem?

The application was developed using VS.Net 2003. The deployed machine is a
Windows 2000 Server, with the .Net framework distributable V1.1 installed.
The project is deployed as an msi built as an install project in VS .net
2003.

Regards
 
O

One Handed Man [ OHM ]

Hmm,
This is a third party control right ?, I would suggest you
contact the vendors.

Regards - OHM

======================

Simon said:
I have a strange problem with a Windows Forms application.

It installs and runs fine on my development machine but consistently
comes up with errors on any installed machine.

I get an error about an unhandled exception as the application starts
up.

If I go to debugger I get the error showing as :

[thread 0x1220] Unhandled exception generated: (0x04941b54)
<System.NullReferenc
eException>
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x04942e38) "Object reference not set to an instance of an
object."
_innerException=<null>
_helpURL=<null>
_stackTrace=(0x04942eb4) array with dims=[60]
_stackTraceString=<null>
_remoteStackTraceString=<null>
_remoteStackIndex=0x00000000
_HResult=0x80004003
_source=<null>
_xptrs=0x0012ed28
_xcode=0xc0000005


I've attempted to trace the problem in my code by inserted msgbox
lines to work out where it falls over.

The form is an inherited form (which itself inherits from a standard
Windows Form). It seems to crash as it instantiates a user control
on the form.

The line it appears to fall over on is :

Me.DmsTextBox1 = New DMSControls.DmsTextBox



DMSTextBox is my usercontrol. If I put a msgbox before this line
I see it.



The start of the usercontrol reads:



Public Sub New()

MyBase.New()

MsgBox("Start_Input_Box")

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub



You never see the msgbox that is at the top of this form....

I'm lost as to what the problem might be!

Anybody any further clues as to what I can do to locate / fix the
problem?

The application was developed using VS.Net 2003. The deployed
machine is a Windows 2000 Server, with the .Net framework
distributable V1.1 installed. The project is deployed as an msi built
as an install project in VS .net 2003.

Regards

Best Regards - OHMBest Regards - OHM (e-mail address removed)
 
S

Simon Verona

no not third party... I wrote it... It's just a usercontrol that contains a
text box. It's used to extend the standard textbox control for some custom
databinding etc. It works in other solutions, and runs fine on my
development system in this project.

What I can't see, is why it seems to fall over so early in the control!

It looks from the debug message that it's trying to dimension something, but
can't see what.

Not sure if this helps.

Simon
One Handed Man said:
Hmm,
This is a third party control right ?, I would suggest you
contact the vendors.

Regards - OHM

======================

Simon said:
I have a strange problem with a Windows Forms application.

It installs and runs fine on my development machine but consistently
comes up with errors on any installed machine.

I get an error about an unhandled exception as the application starts
up.

If I go to debugger I get the error showing as :

[thread 0x1220] Unhandled exception generated: (0x04941b54)
<System.NullReferenc
eException>
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x04942e38) "Object reference not set to an instance of an
object."
_innerException=<null>
_helpURL=<null>
_stackTrace=(0x04942eb4) array with dims=[60]
_stackTraceString=<null>
_remoteStackTraceString=<null>
_remoteStackIndex=0x00000000
_HResult=0x80004003
_source=<null>
_xptrs=0x0012ed28
_xcode=0xc0000005


I've attempted to trace the problem in my code by inserted msgbox
lines to work out where it falls over.

The form is an inherited form (which itself inherits from a standard
Windows Form). It seems to crash as it instantiates a user control
on the form.

The line it appears to fall over on is :

Me.DmsTextBox1 = New DMSControls.DmsTextBox



DMSTextBox is my usercontrol. If I put a msgbox before this line
I see it.



The start of the usercontrol reads:



Public Sub New()

MyBase.New()

MsgBox("Start_Input_Box")

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub



You never see the msgbox that is at the top of this form....

I'm lost as to what the problem might be!

Anybody any further clues as to what I can do to locate / fix the
problem?

The application was developed using VS.Net 2003. The deployed
machine is a Windows 2000 Server, with the .Net framework
distributable V1.1 installed. The project is deployed as an msi built
as an install project in VS .net 2003.

Regards

Best Regards - OHMBest Regards - OHM (e-mail address removed)
 
A

Armin Zingler

Simon Verona said:
Public Sub New()

MyBase.New()

MsgBox("Start_Input_Box")

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub



You never see the msgbox that is at the top of this form....

What if you put the msgbox *before* MyBase.New? Means:


Public Sub New()

MsgBox("MyBase.New()")

MyBase.New()

MsgBox("InitializeComponent")

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub
 
E

EricJ

probably not mutch help but anyway it wont hurt

are you sure that the server has al the updates from ms (probably not the
problem but i've had a pc acting up on me becouse of that)

are you sure that the installer isn't forgetting any references (since you
are using custom controls this could be an issue) do you use the user
control somewhere else? dous it work there? have you tried using the control
static (putting it somwhere on the form in designer instaid of using code)

hope it helps a bit
these things can be very hard to find

eric
 
J

Jay B. Harlow [MVP - Outlook]

Armin,
What if you put the msgbox *before* MyBase.New? Means:

Public Sub New()
MsgBox("MyBase.New()")
MyBase.New()

However remember that the call to MyBase.New needs to be the very first
statement in the constructor, so the above code will not compile.

Hope this helps
Jay
 
S

Simon Verona

It won't then compile.. says mybase.new must be the first line of the
subroutine....
 
O

One Handed Man [ OHM ]

DMSControls.DmsTextBox is apparently not returning an object. As to why, I
dont know. If you change from Debug to Release on your development machine,
does this also exhibit the same problem ?

Can you simplify the problem by creating a new tempory form as a startup
form and without altering your control in anyway, recreate this. In other
words, without disturbing the project too much use the control on a new
starup form.

These sorts of things are difficult to deal with at best, you just need to
play Sherlock Homes and apply deducive reasoning.

Regards - OHM





Simon said:
no not third party... I wrote it... It's just a usercontrol that
contains a text box. It's used to extend the standard textbox
control for some custom databinding etc. It works in other
solutions, and runs fine on my development system in this project.

What I can't see, is why it seems to fall over so early in the
control!

It looks from the debug message that it's trying to dimension
something, but can't see what.

Not sure if this helps.

Simon
"One Handed Man [ OHM ]"
Hmm,
This is a third party control right ?, I would suggest you
contact the vendors.

Regards - OHM

======================

Simon said:
I have a strange problem with a Windows Forms application.

It installs and runs fine on my development machine but consistently
comes up with errors on any installed machine.

I get an error about an unhandled exception as the application
starts up.

If I go to debugger I get the error showing as :

[thread 0x1220] Unhandled exception generated: (0x04941b54)
<System.NullReferenc
eException>
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x04942e38) "Object reference not set to an instance of
an object."
_innerException=<null>
_helpURL=<null>
_stackTrace=(0x04942eb4) array with dims=[60]
_stackTraceString=<null>
_remoteStackTraceString=<null>
_remoteStackIndex=0x00000000
_HResult=0x80004003
_source=<null>
_xptrs=0x0012ed28
_xcode=0xc0000005


I've attempted to trace the problem in my code by inserted msgbox
lines to work out where it falls over.

The form is an inherited form (which itself inherits from a standard
Windows Form). It seems to crash as it instantiates a user control
on the form.

The line it appears to fall over on is :

Me.DmsTextBox1 = New DMSControls.DmsTextBox



DMSTextBox is my usercontrol. If I put a msgbox before this line
I see it.



The start of the usercontrol reads:



Public Sub New()

MyBase.New()

MsgBox("Start_Input_Box")

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub



You never see the msgbox that is at the top of this form....

I'm lost as to what the problem might be!

Anybody any further clues as to what I can do to locate / fix the
problem?

The application was developed using VS.Net 2003. The deployed
machine is a Windows 2000 Server, with the .Net framework
distributable V1.1 installed. The project is deployed as an msi
built as an install project in VS .net 2003.

Regards

Best Regards - OHMBest Regards - OHM (e-mail address removed)

Best Regards - OHMBest Regards - OHM (e-mail address removed)
 
S

Simon Verona

I've checked all the dll's that are there. The only possibility is a com
interop where I don't install the actual dll as it has it's own installer
(which has been installed).

I'm going to keep trying to locate the problem... I'm now looking at all the
module based dim statements in the usercontrol and putting msgbox's in each
of their constructors to try and locate if the problem is in there - I'm
presuming that these are instantiated before the constructor for the
usercontrol itself??

Regards
Simon
EricJ said:
probably not mutch help but anyway it wont hurt

are you sure that the server has al the updates from ms (probably not the
problem but i've had a pc acting up on me becouse of that)

are you sure that the installer isn't forgetting any references (since you
are using custom controls this could be an issue) do you use the user
control somewhere else? dous it work there? have you tried using the control
static (putting it somwhere on the form in designer instaid of using code)

hope it helps a bit
these things can be very hard to find

eric

Simon Verona said:
I have a strange problem with a Windows Forms application.

It installs and runs fine on my development machine but consistently comes
up with errors on any installed machine.

I get an error about an unhandled exception as the application starts up.

If I go to debugger I get the error showing as :

[thread 0x1220] Unhandled exception generated: (0x04941b54)
<System.NullReferenc
eException>
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x04942e38) "Object reference not set to an instance of an
object."
_innerException=<null>
_helpURL=<null>
_stackTrace=(0x04942eb4) array with dims=[60]
_stackTraceString=<null>
_remoteStackTraceString=<null>
_remoteStackIndex=0x00000000
_HResult=0x80004003
_source=<null>
_xptrs=0x0012ed28
_xcode=0xc0000005


I've attempted to trace the problem in my code by inserted msgbox lines to
work out where it falls over.

The form is an inherited form (which itself inherits from a standard Windows
Form). It seems to crash as it instantiates a user control on the form.

The line it appears to fall over on is :

Me.DmsTextBox1 = New DMSControls.DmsTextBox



DMSTextBox is my usercontrol. If I put a msgbox before this line I see
it.



The start of the usercontrol reads:



Public Sub New()

MyBase.New()

MsgBox("Start_Input_Box")

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub



You never see the msgbox that is at the top of this form....

I'm lost as to what the problem might be!

Anybody any further clues as to what I can do to locate / fix the problem?

The application was developed using VS.Net 2003. The deployed machine
is
a
Windows 2000 Server, with the .Net framework distributable V1.1 installed.
The project is deployed as an msi built as an install project in VS .net
2003.

Regards
 
S

Simon Verona

Ok found the problem...

The user control creates an instance of another object (which is also home
grown), which trys to read some stuff from the registry. Unfortunately,
the registry settings is set by another bit of my software which wasn't
installed on these servers. I somehow had omitted a try/catch around the
registry reading code, which was falling over when it tried to traverse the
keys!

Strange error message though!

Thanks for the help

Regards
Simon
EricJ said:
probably not mutch help but anyway it wont hurt

are you sure that the server has al the updates from ms (probably not the
problem but i've had a pc acting up on me becouse of that)

are you sure that the installer isn't forgetting any references (since you
are using custom controls this could be an issue) do you use the user
control somewhere else? dous it work there? have you tried using the control
static (putting it somwhere on the form in designer instaid of using code)

hope it helps a bit
these things can be very hard to find

eric

Simon Verona said:
I have a strange problem with a Windows Forms application.

It installs and runs fine on my development machine but consistently comes
up with errors on any installed machine.

I get an error about an unhandled exception as the application starts up.

If I go to debugger I get the error showing as :

[thread 0x1220] Unhandled exception generated: (0x04941b54)
<System.NullReferenc
eException>
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x04942e38) "Object reference not set to an instance of an
object."
_innerException=<null>
_helpURL=<null>
_stackTrace=(0x04942eb4) array with dims=[60]
_stackTraceString=<null>
_remoteStackTraceString=<null>
_remoteStackIndex=0x00000000
_HResult=0x80004003
_source=<null>
_xptrs=0x0012ed28
_xcode=0xc0000005


I've attempted to trace the problem in my code by inserted msgbox lines to
work out where it falls over.

The form is an inherited form (which itself inherits from a standard Windows
Form). It seems to crash as it instantiates a user control on the form.

The line it appears to fall over on is :

Me.DmsTextBox1 = New DMSControls.DmsTextBox



DMSTextBox is my usercontrol. If I put a msgbox before this line I see
it.



The start of the usercontrol reads:



Public Sub New()

MyBase.New()

MsgBox("Start_Input_Box")

'This call is required by the Windows Form Designer.

InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub



You never see the msgbox that is at the top of this form....

I'm lost as to what the problem might be!

Anybody any further clues as to what I can do to locate / fix the problem?

The application was developed using VS.Net 2003. The deployed machine
is
a
Windows 2000 Server, with the .Net framework distributable V1.1 installed.
The project is deployed as an msi built as an install project in VS .net
2003.

Regards
 
A

Armin Zingler

Simon Verona said:
It won't then compile.. says mybase.new must be the first line of
the subroutine....


Ahhh...yes ..ok.. I should have tested this. (sorry!)
 

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