NullReferenceException in Main

  • Thread starter Thread starter Miguel
  • Start date Start date
M

Miguel

Well it's a rather weird problem.
On a Qtec S100 with Windows Mobile 2003 SE the following happens: When
I tap on the .exe the first time the application throws a
NullReferenceException in main. When I tap on it again, the application
starts normally.
However this behaviour does not occur when testing this application on
ipaq devices.
Basically what I am doing (it is a non-graphical application)

Public Class X
Public Sub New()
'doing some stuff
End Sub

Public Shared Sub Main()
Dim temp as new X
End Sub
End Class

Could someone tell me what is wrong with this?
Or isn't this the proper way to start a non-graphical application?

Regards

Miguel
 
I have seen this in one of my apps inc running on the emulator but havn't put
my finger on it yet. I will post back here when I do.

Regards
Simon.
 
Why have an object and not move everything from the ctor into the single
shared sub main?

Cheers
Daniel
 
Back
Top