Strange problem

  • Thread starter Thread starter Lars Olsson
  • Start date Start date
L

Lars Olsson

Ok, here is the situation:
We have a windows service A and a windows foms application B, both written
in
C#, compiled with .net framework 1.1
A starts autmatically at PC startup.
For various reasons, we want to launch B when the PC shuts down, without any
possibility
for end users to interfere with the process or mess with applications and
documents.
So the way we solved it is to have A create a Local shutdown script that
launches B.

Here is what happens:

This works:
1 Start the PC, log on.
2 Let A create the shutdown script.
3 A shuts the PC down
4 B runs fine

This does not work:
1 Start a shutted down PC
2 As soon as A starts (before anyone logs on), A creates the logon script
3 A shuts the PC down
4 B crashes with an CLR error dialog that says nothing particular, just that
it can't find the JIT debugger
and some other useless info

Note that 2 works, so we assume we have the .net framework up and running
Is it possible that parts of the .net framework is NOT running, parts that
is requred by B but not by A?

Thankful for any ideas
 
You are running B when no one is logged in. B should be a Console
application, not a Windows application, to be able to run when no one is
logged in.

--- Nick
 
Apps that run in a shutdown script are running in the context of the user
logging off.

There is no user context for the second condition.

Change your app to a console app

Is there some reason why this would be unduly difficult to do?

--- Nick
 
Nick,
There is no user context for the first condition either.
All users are logged of and the PC shuts down.
Then the shutdown script runs B fine.
We have now attributed this behaviour to a defect in the
..net framework.
 
If it is a defect in the framework, Microsoft will provide support for free
to help you work around it or simply send you a patch.

Good Luck
--- Nick
 
Back
Top