Problem with OpenNetCF.IO.Serial.GPS

N

n33470

Hi all,

We just installed the OpenNetCF 1.3 on our VS2003 development PC.
We're trying to prototype a SmartPhone application that uses the GPS
capability from the OpenNetCF library. We're running inside of the
SmartPhone emulator only, as we don't have the GPS receiver yet.

We run the following code from a menu click:

private void menuItem5_Click_1(object sender, System.EventArgs e)
{
try
{
OpenNETCF.IO.Serial.GPS.GPS gps = new OpenNETCF.IO.Serial.GPS.GPS();
}
catch(Exception ex)
{
// the exception does NOT get caught here
_lastInputValue = ex.Message;
}
}

And it throws a System.TypeLoadException. The unusual part is that it
does not get caught in the click hander, rather it gets caught in the
static void main exception handler:

static void Main()
{
try
{
Application.Run(new Form1());
}
catch(Exception ex)
{
// the exception gets caught here. Whats up with that?
throw ex;
}
}

Are there any know problems calling the constructor on the GPS object
from within the emulator?

Any ideas?

Thanks!

--steve
 
C

Chris Tacke, eMVP

I don't see anything obvious in your code or the GPS class code. My
suggestion would be to see if the sample in Vault does the same thing, or
step through the source code.

--
Chris Tacke
Co-founder
OpenNETCF.org
Are you using the SDF? Let's do a case study.
Email us at d c s @ o p e n n e t c f . c o m
http://www.opennetcf.org/donate
 
P

Peter Foot [MVP]

Being that the error thrown is a TypeLoadException, the most likely cause is
that the device/emulator doesn't have the required dll (OpenNETCF.dll
contains the GPS classes from recollection) or it contains the wrong version
of said dll. Try adding the OpenNETCF.dll as a content file with your
project so that it is deployed to the application folder. If you've
previously had another version of the dll on your system make sure you copy
the v1.3 version.

Peter
 
N

n33470

Chris,

We picked up this sample from the vault:

$/Samples/GPS/GPSSample/SmartPhoneGPS/

And after opening up the solution file there is a broken reference to
the following assembly (which of course is the important one!)

OpenNetCF.IO.Serial.GPS

I think it may be an installation issue. Is it possible that the
assembly packaged into the MSI file is not the correct one?

When we did the installation, we used this file "SDFSetup13.msi" which
is dated 5/12/2005.

Where do the assemblies get installed? I can try to check out which
versions we have.

Thanks!

--steve
 

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