.NET App wont start with system when told to

S

Smokey Grindel

Ok this is wierd I am seeing this issue with C# and VB.NET apps made in
..NET...

I have the framework installed (.NET 3.5 currently)... i installed my
applications... I placed them in the registry to start up when the user logs
in so I placed it in the
HKEY_Current_USER_\Software\Microsoft\Windows\CurrentVersion\Run key... ok
seems like it should start... nope nothing.. place a C++ app in there starts
right up with the login! ok wierd... place the app in the Startup group in
control panel... nothing... once again place a C++ app in there (non-managed
of course) and boom starts up on login... what the heck is going on? I need
this app to start with the system when the client logs in... and it can not
be a service because it has UI interaction... any ideas what is going on?
Thanks!
 
N

Nicholas Paldino [.NET/C# MVP]

Smokey,

I would put some sort of logging in the app, espectially around your
call to the static Run method on the Application class (in a try/catch
block) to see if there is an exception that is being thrown. I'm not saying
this is the case, but it's definitely a place to start.
 
C

christery

Anything in the eventlog about what happend?

not done that (starting .net app from run/autostart) so I dont know if
there is a problem...

writing to files that user doesnt have rights to but you do when
testing? nah...

does it work with your account but not another (rights)

otherwise i solved one strange with delay of start (didnt find a nice
sleep or wait in dos)
a .bat file and some ping before it started but that was to get 2
different programs to start with a few seconds delay like "ping -n 1 -
w 5000 x"

UI *should* work until vista as a service as far as I know, but would
not recommend it - using it myself with an old VB6 app, but that has
to go soon.

//CY
 
S

Smokey Grindel

This doesn't even work if I just make a winforms app with nothing in it,
compile it and place it in there... so it souldnt be permission or file IO
errors... because the app is in a folder the user has permission to... so I
am confused... no event logs or anything
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,


Personally I never use the registry, I use the startup folder accesible from
the start menu.
Having said that I have never ever encountered any problem doing it.

As Paldino said put some logging int he app and see what is going on.
 
K

kimiraikkonen

Hi,

Personally I never use the registry, I use the startup folder accesible from
the start menu.
Having said that I have never ever encountered any problem doing it.

As Paldino said put some logging int he app and see what is going on.

Could be a timing problem? At startup, usually all the processes are
forced to load at the same time, thus CPU must process them at the
same time. If the app tries to run before .NET libraries is loaded and
services being configured, then maybe that could be the reason. But at
this point it's likely that you should have get a run-time error if
the .NET framework runtime libraries cannot be found due to app can be
launced before .NET libraries.
 
I

Ignacio Machin \( .NET/ C# MVP \)

Hi,



--
Ignacio Machin
http://www.laceupsolutions.com
Mobile & warehouse Solutions.
Could be a timing problem? At startup, usually all the processes are
forced to load at the same time, thus CPU must process them at the
same time. If the app tries to run before .NET libraries is loaded and
services being configured, then maybe that could be the reason. But at
this point it's likely that you should have get a run-time error if
the .NET framework runtime libraries cannot be found due to app can be
launced before .NET libraries.

I do not think so, I'm pretty sure that all the services are started first,
and you can write a service in .NET so that kind of invalidate your point.
 
F

Family Tree Mike

Smokey Grindel said:
Ok this is wierd I am seeing this issue with C# and VB.NET apps made in
..NET...

I have the framework installed (.NET 3.5 currently)... i installed my
applications... I placed them in the registry to start up when the user logs
in so I placed it in the
HKEY_Current_USER_\Software\Microsoft\Windows\CurrentVersion\Run key... ok
seems like it should start... nope nothing.. place a C++ app in there starts
right up with the login! ok wierd... place the app in the Startup group in
control panel... nothing... once again place a C++ app in there (non-managed
of course) and boom starts up on login... what the heck is going on? I need
this app to start with the system when the client logs in... and it can not
be a service because it has UI interaction... any ideas what is going on?
Thanks!

I tried this on my machine with no problems. Is the problem isolated to a
single machine or account? I just created a simple dialog which displays
 
W

Willy Denoyette [MVP]

kimiraikkonen said:
Could be a timing problem? At startup, usually all the processes are
forced to load at the same time, thus CPU must process them at the
same time. If the app tries to run before .NET libraries is loaded and
services being configured, then maybe that could be the reason. But at
this point it's likely that you should have get a run-time error if
the .NET framework runtime libraries cannot be found due to app can be
launced before .NET libraries.



This is nonsense, there are no .NET libraries to be loaded or configured
during logon , .NET libraries are loaded as part of the application itself.

Willy.
 
K

kimiraikkonen

This is nonsense, there are no .NET libraries to be loaded or configured
during logon , .NET libraries are loaded as part of the application itself.

Willy.

Embedded into app? No .NET runtimelibaries loaded by Windows? But none
of .NET-powered apps can run without .NET runtime libraries installed.
 
S

Stephany Young

Precisely!

Surely you know the difference between 'installed' and 'loaded'.

When one logs in to a PC, an awful lot of work takes place before the system
is ready to start executing commands that you throw at it.

I suspect that your program is attempting to access some recource or other
before it is actually available.
 
W

Willy Denoyette [MVP]

kimiraikkonen said:
Embedded into app? No .NET runtimelibaries loaded by Windows? But none
of .NET-powered apps can run without .NET runtime libraries installed.


Yes the CLR and .NET libraries are loaded *in the process* of the .NET
application. Windows does not load the runtime (why would it?), the runtime
is no stand-alone shared component and is not part of the Windows OS!
..NET applications cannot run without the Framework installed, just like non
..NET applications cannot run without some other runtime libraries , Windows
(other than Vista) has no dependency on the .NET Framework. Vista comes with
the Framework installed, but this is because some Vista utilities are .NET
applications, but the Vista OS basically does not require .NET to be
present.

Willy.
 

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