From: AussieRules on
Hi,

I am able to run my application on my development machine with no problems.

When I compile and install the application on the brand new computer, I am
unable to start the application as it crashes.


To try and work out the problem, i put as the very first line in my main
form load event to just show a message box.

The installed application crashs before the dialog box is shown, so I don't
know how to debug as its crashing before any of my code starts..

I have to get this sorted this weekend, so any advice or tips would be taken
with huge thanks...


From: Phill W. on
On 14/05/2010 11:24, AussieRules wrote:

> I am able to run my application on my development machine with no problems.
It's becoming the .Net developers' Mantra:
"It runs on /my/ machine"

> When I compile and install the application on the brand new computer, I
> am unable to start the application as it crashes.
Define "install".

If you use any installer product, it should take all the necessary
dependencies across onto the target machine as well. Just copying the
executable isn't always enough.

> To try and work out the problem, i put as the very first line in my main
> form load event to just show a message box.
Never mind Form_Load - what about Sub Main()?
At the very least, get a Try..Catch construct in there to catch things
like this (it's not perfect, by any means, but it's a start).

> The installed application crashs before the dialog box is shown, so I
> don't know how to debug as its crashing before any of my code starts..

Have a look in the Application Event Log; there should be an entry in
there that gives you some idea of what's going on.

HTH,
Phill W.
From: Onur Güzel on
On May 14, 1:24 pm, "AussieRules" <nos...(a)nospam.com> wrote:
> Hi,
>
> I am able to run my application on my development machine with no problems.
>
> When I compile and install the application on the brand new computer, I am
> unable to start the application as it crashes.
>
> To try and work out the problem, i put as the very first line in my main
> form load event to just show a message box.
>
> The installed application crashs before the dialog box is shown, so I don't
> know how to debug as its crashing before any of my code starts..
>
> I have to get this sorted this weekend, so any advice or tips would be taken
> with huge thanks...

Make sure that any COM components are registered on target machine
(with regsvr32 optionally) if you use any COM components. Plus,
investigating Event Log gives much more idea about the exception.

HTH,

Onur Güzel
From: AussieRules on
HI,
Thanks for you advice.

I created the installer application via the standard visual studio setup
wizard. It would seem to have the dependacies, and I have checked to make
sure the .net framework is installed(which it is).

My splash screen (define in project properties) displayes and then I get the
error :

appname as encountered a problem and needs to close. We are sorry for the
inconvenience.

(send error report) ( Don't send)


Looking at the application.log I get.

..net Runtime 2.0 Error

EventType clr203r3, P1 appname.exe, P2 1.0.0.0, P3 4becddd1, P4 appname, P5
1.0.0.0, P6 4becdd1, P7 29,P8 e9, P9system.invalidoperationexception, P10Nil

I don't have a sub main, and my project startup is set to form1. I will add
a sub main now...



"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-k> wrote in message
news:hsjcmd$9bd$1(a)south.jnrs.ja.net...
> On 14/05/2010 11:24, AussieRules wrote:
>
>> I am able to run my application on my development machine with no
>> problems.
> It's becoming the .Net developers' Mantra:
> "It runs on /my/ machine"
>
>> When I compile and install the application on the brand new computer, I
>> am unable to start the application as it crashes.
> Define "install".
>
> If you use any installer product, it should take all the necessary
> dependencies across onto the target machine as well. Just copying the
> executable isn't always enough.
>
>> To try and work out the problem, i put as the very first line in my main
>> form load event to just show a message box.
> Never mind Form_Load - what about Sub Main()?
> At the very least, get a Try..Catch construct in there to catch things
> like this (it's not perfect, by any means, but it's a start).
>
>> The installed application crashs before the dialog box is shown, so I
>> don't know how to debug as its crashing before any of my code starts..
>
> Have a look in the Application Event Log; there should be an entry in
> there that gives you some idea of what's going on.
>
> HTH,
> Phill W.

From: AussieRules on
Hi,

I have tried to add a sub main, I just added this code into my form where I
have all my other function and subs.

<STAThread()> Shared Sub Main()

' Declare a variable named frm1 of type Form1.
MsgBox("hello")

Dim frm1 As frmMain

' Instantiate (create) a new Form1 object and assign
' it to variable frm1.

frm1 = New frmMain()

' Call the Application class' Run method
' passing it the Form1 object created above.

Application.Run(frm1)

End Sub



It doesn't seem to work as I never get the hello message box ???

Have I done something wrong ??

Thanks


"Phill W." <p-.-a-.-w-a-r-d-@-o-p-e-n-.-a-c-.-u-k> wrote in message
news:hsjcmd$9bd$1(a)south.jnrs.ja.net...
> On 14/05/2010 11:24, AussieRules wrote:
>
>> I am able to run my application on my development machine with no
>> problems.
> It's becoming the .Net developers' Mantra:
> "It runs on /my/ machine"
>
>> When I compile and install the application on the brand new computer, I
>> am unable to start the application as it crashes.
> Define "install".
>
> If you use any installer product, it should take all the necessary
> dependencies across onto the target machine as well. Just copying the
> executable isn't always enough.
>
>> To try and work out the problem, i put as the very first line in my main
>> form load event to just show a message box.
> Never mind Form_Load - what about Sub Main()?
> At the very least, get a Try..Catch construct in there to catch things
> like this (it's not perfect, by any means, but it's a start).
>
>> The installed application crashs before the dialog box is shown, so I
>> don't know how to debug as its crashing before any of my code starts..
>
> Have a look in the Application Event Log; there should be an entry in
> there that gives you some idea of what's going on.
>
> HTH,
> Phill W.