Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / January 2006

Tip: Looking for answers? Try searching our database.

Windows CE 4.1 TypeLoadException or Fatal Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nick - 08 Jan 2006 14:24 GMT
We have written a very simple application in VB.NET that uses the .NET
Compact Framework (SP2). The application reads a product barcode, looks
it up in a database and shows the price on the screen. The device we
are targeting is the Symbol MK1100 which has Windows CE 4.1 installed.

We have set up the CE device so that it installs the .NET Compact
Framework and relevant Symbol Assemblies as it boots up. Then we launch
our application as the final step.

Following a cold boot, approximately 1 in 3 times, as our application
starts it yields a variety of random error messages such as "Fatal
Application Error" or a number of different "TypeLoadException"
errors claiming various .NET assemblies are missing (which ones are
missing seem to be completely random). This problem can sometimes be
resolved by simply restarting our application.

For several days now we have tried many, many things, and have no more
ideas. For example we are running the application from the \Program
Files directory and NOT the \Application directory as we understand
running applications from non-volatile flash memory could cause
instability. We have also tried adding a delay of 15 seconds before our
application begins in case there is some timing issue - again this
makes no difference.

Whatever the problem is it seems that the programs installed on boot -
i.e. the CF, Symbol Libraries etc are not being properly registered in
the GAC or installed correctly. We've even tried putting the DLLs in
the application directory but it makes no difference.

Any ideas would be greatly appreciated.

Thanks
Nick Thompson
DCSL Internet Ltd
Paul G. Tobey [eMVP] - 09 Jan 2006 15:50 GMT
You're probably running the program before the OS is ready to respond to
some of the calls that the run-time for .NET CF uses.  The only way I've
seen to work around this is to just wait a while before starting the
program.  Obviously, if the program is counting on, say, a given storage
card to be mounted or something, you want to check that before actually
trying to use it and, in that case, make sure that the file system is up and
running, but there's no one answer to 'how do I have a .NET CF program run
on startup'.

Paul T.

> We have written a very simple application in VB.NET that uses the .NET
> Compact Framework (SP2). The application reads a product barcode, looks
[quoted text clipped - 30 lines]
> Nick Thompson
> DCSL Internet Ltd
Nick - 09 Jan 2006 16:10 GMT
Hi Paul,

I did set a 15 second delay before starting my app, but it didn't seem
to make any difference. The processor is an ARMV4 200Mz. Do you think
15 seconds may not be enough? I don't care - it can be 10 minutes as
long as I can get it working!

Thanks for your help with this.

Regards
Nick
Paul G. Tobey [eMVP] - 09 Jan 2006 17:09 GMT
I'd try something that you know is ridiculously long, a minute, say.  If
that does fix the problem, then you can, maybe, adjust the delay...

Paul T.

> Hi Paul,
>
[quoted text clipped - 7 lines]
> Regards
> Nick
Nick - 09 Jan 2006 21:02 GMT
Hi Paul,

I tried adding a 1 minute delay. I cold booted the device about 3 times
and it worked great. On the 4th boot I got a TypeLoadException and it
said:

Could not load type
System.ComponentModel.Component
from assembly System,
Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC.

The error above is just one of similar errors I get with this,
sometimes later on in the application (for example I often see it
complaining it's missing stuff from System.Drawing or the
Symbol.Barcode assemblies) and sometimes so early on I just get a Fatal
Error (so I guess essential .NET CF error handling assemblies are not
available).

I am really stumped with this. Have you any more ideas about what might
be causing this weird intermittent problem?

Thanks again,
Nick
Paul G. Tobey [eMVP] - 09 Jan 2006 21:09 GMT
No, I'm afraid not.  I don't launch this type of application from, say, the
Startup folder.  If I had to run a managed code application at boot-time,
I'd write an unmanaged application to do the launching.  However, I've never
seen a 1 minute delay in readiness.  You could try running it manually from
File Explorer early on after boot and seeing if that, too, intermittently
fails...

Paul T.

> Hi Paul,
>
[quoted text clipped - 20 lines]
> Thanks again,
> Nick
Nick - 10 Jan 2006 08:17 GMT
OK - Thanks Paul.

If anybody else has this same problem and finds a solution please post
it to this topic.

In the meantime I'm going to re-write the app as a browser based
solution!

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.