.NET Managed Shell Replacement Possible?? (MissingMethodException)

  • Thread starter Thread starter Alan Marchiori
  • Start date Start date
A

Alan Marchiori

Hello,

I am working on a Windows CE based Kiosk. Mike Hall's Kiosk Mode blog
entries have been usefull (see
http://blogs.msdn.com/mikehall/archive/2005/08/03/447386.aspx). I tried
to take this one step further and rather than use a C/C++ shell launcher
app, I am attempting to launch my kiosk.exe (C#, .net) directly using:

[HKEY_LOCAL_MACHINE\init]
"Launch50"="kiosk.exe"
"Depend50"=hex:14,00,1E,00

it appears to begin launching my app and very quickly there after a
missing method exception is thrown (below). If I boot the windows shell
then launch kiosk.exe everything works great. Does a .NET forms app
require the windows shell be running? Any thoughts?

Thanks


------------------------------------------------------------------------
kiosk.exe
Error
An Unexpected error has occured in kiosk.exe
Select Quit and then restart this program, or select Details for more
information.

1 => Quit
2 => Details
2
kiosk.exe
Error
kiosk.exe
MissingMethodException

Control::_InitIntance+0x31
Control::ctor+0x15
ScrollableControl::.ctor+0x8
ContainerControl::.ctor+0x8
Form::ctor+0x9
Form1::.ctor+0x6
Form1::Main+x28
 
You can't do that operation that *early* in the boot process. Not all of
the APIs are ready by the time that Init will be launched. For example, the
Device Manager will *very* likely not have mounted any storage cards, will
not have loaded the network drivers, etc., etc. Managed code applications
make a lot of assumptions about the state of the OS when they start and you
get an exception like you're seeing when things aren't in that state. The
best way to do this, I think, is to write a C/C++ launcher application which
will wait for the required APIs to be ready (using IsAPIReady), then launch
the managed code application. I believe that there's been previous
discussion of this here. Have you used GoogleGroups to check the archives
(searching on Init and Depend would probably find what you're looking
for)...

http://groups.google.com/group/micr...tframework?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8

Paul T.
 
I have successfully launched a replacement shell written as a managed
application in place of the usual shell using the technique below so I'm not
sure this response is accurate. Remember, Launch50 is the level at which
shell.exe is normally launched itself. MissingMethodException in this
scenario is more likely to be caused by the executable not being able to
locate a companion DLL, or something like that. I've found that compact
framework has unexpected behaviour when combined with file system mappings
normally found in .db or .dat files - (can't remember which one is used to
map a file in the system image into the file system). Perhaps that could be
the issue?

Note a compact framework app does not require the shell, but if there is no
shell, window/form activation behaves slightly differently and you may have
to code around methods like BringToFront().

Regards,
- John

Paul G. Tobey said:
You can't do that operation that *early* in the boot process. Not all of
the APIs are ready by the time that Init will be launched. For example,
the Device Manager will *very* likely not have mounted any storage cards,
will not have loaded the network drivers, etc., etc. Managed code
applications make a lot of assumptions about the state of the OS when they
start and you get an exception like you're seeing when things aren't in
that state. The best way to do this, I think, is to write a C/C++
launcher application which will wait for the required APIs to be ready
(using IsAPIReady), then launch the managed code application. I believe
that there's been previous discussion of this here. Have you used
GoogleGroups to check the archives (searching on Init and Depend would
probably find what you're looking for)...

http://groups.google.com/group/micr...tframework?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8

Paul T.

Alan Marchiori said:
Hello,

I am working on a Windows CE based Kiosk. Mike Hall's Kiosk Mode blog
entries have been usefull (see
http://blogs.msdn.com/mikehall/archive/2005/08/03/447386.aspx). I tried
to take this one step further and rather than use a C/C++ shell launcher
app, I am attempting to launch my kiosk.exe (C#, .net) directly using:

[HKEY_LOCAL_MACHINE\init]
"Launch50"="kiosk.exe"
"Depend50"=hex:14,00,1E,00

it appears to begin launching my app and very quickly there after a
missing method exception is thrown (below). If I boot the windows shell
then launch kiosk.exe everything works great. Does a .NET forms app
require the windows shell be running? Any thoughts?

Thanks


------------------------------------------------------------------------
kiosk.exe
Error
An Unexpected error has occured in kiosk.exe
Select Quit and then restart this program, or select Details for more
information.

1 => Quit
2 => Details
2
kiosk.exe
Error
kiosk.exe
MissingMethodException

Control::_InitIntance+0x31
Control::ctor+0x15
ScrollableControl::.ctor+0x8
ContainerControl::.ctor+0x8
Form::ctor+0x9
Form1::.ctor+0x6
Form1::Main+x28
 
I guess I should say that you can't do that operation reliably that early in
the boot process. Whether it works or not isn't a 100% thing. If the
device manager takes a little longer to get a hard disk driver started, or
if the hard disk itself doesn't start as fast as 'normal', you can easily
start up in a state where the .NET CF won't run. It's possible that on some
devices with some peripherals, that never happens, but there are definitely
devices where starting things, even after the default shell is done loading,
written with .NET CF won't work. Launching an unmanaged application which
waited for some of the APIs to be ready and then launched the managed code
fixed that problem reliably. This was in 4.2, so maybe WM5/CE5 devices are
better.

Paul T.

John Roberts said:
I have successfully launched a replacement shell written as a managed
application in place of the usual shell using the technique below so I'm
not sure this response is accurate. Remember, Launch50 is the level at
which shell.exe is normally launched itself. MissingMethodException in this
scenario is more likely to be caused by the executable not being able to
locate a companion DLL, or something like that. I've found that compact
framework has unexpected behaviour when combined with file system mappings
normally found in .db or .dat files - (can't remember which one is used to
map a file in the system image into the file system). Perhaps that could be
the issue?

Note a compact framework app does not require the shell, but if there is
no shell, window/form activation behaves slightly differently and you may
have to code around methods like BringToFront().

Regards,
- John

Paul G. Tobey said:
You can't do that operation that *early* in the boot process. Not all of
the APIs are ready by the time that Init will be launched. For example,
the Device Manager will *very* likely not have mounted any storage cards,
will not have loaded the network drivers, etc., etc. Managed code
applications make a lot of assumptions about the state of the OS when
they start and you get an exception like you're seeing when things aren't
in that state. The best way to do this, I think, is to write a C/C++
launcher application which will wait for the required APIs to be ready
(using IsAPIReady), then launch the managed code application. I believe
that there's been previous discussion of this here. Have you used
GoogleGroups to check the archives (searching on Init and Depend would
probably find what you're looking for)...

http://groups.google.com/group/micr...tframework?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8

Paul T.

Alan Marchiori said:
Hello,

I am working on a Windows CE based Kiosk. Mike Hall's Kiosk Mode blog
entries have been usefull (see
http://blogs.msdn.com/mikehall/archive/2005/08/03/447386.aspx). I tried
to take this one step further and rather than use a C/C++ shell launcher
app, I am attempting to launch my kiosk.exe (C#, .net) directly using:

[HKEY_LOCAL_MACHINE\init]
"Launch50"="kiosk.exe"
"Depend50"=hex:14,00,1E,00

it appears to begin launching my app and very quickly there after a
missing method exception is thrown (below). If I boot the windows shell
then launch kiosk.exe everything works great. Does a .NET forms app
require the windows shell be running? Any thoughts?

Thanks


------------------------------------------------------------------------
kiosk.exe
Error
An Unexpected error has occured in kiosk.exe
Select Quit and then restart this program, or select Details for more
information.

1 => Quit
2 => Details
2
kiosk.exe
Error
kiosk.exe
MissingMethodException

Control::_InitIntance+0x31
Control::ctor+0x15
ScrollableControl::.ctor+0x8
ContainerControl::.ctor+0x8
Form::ctor+0x9
Form1::.ctor+0x6
Form1::Main+x28
 
" Remember, Launch50 is the level at which
shell.exe is normally launched itself. "
That should be "Explorer.exe" or "Shell32.exe" NOT shell.exe. Shell.exe is
the device side debug shell used to establish the "CE Target Control" over
KITL. There is no WAY you can replace that in managed code at this time.
 
OK so it is device specific. Just that I have found no problem on my device
but it doesn't have any peripherals that take long to start up. It is WinCE
5.0.

Cheers,
- John
 
The debug information that was posted indicated an OS API that was being
called that was not yet ready or just plain missing from the OS Design. I
haven't seen the response to my question about the call stack at the point
of the failure. Did I miss it somehow. Did the servers hiccup on that one?
 
It was

kiosk.exe
MissingMethodException

Control::_InitIntance+0x31
Control::ctor+0x15
ScrollableControl::.ctor+0x8
ContainerControl::.ctor+0x8
Form::ctor+0x9
Form1::.ctor+0x6
Form1::Main+x28

I guess there is a call there into a Dll which can't be found.

Anyway, the poster appears to have deserted us!
 
Back
Top