Please Help! - Getting 'System.MissingMethodException' error when using Class Library

S

ShakeDoctor

Hi,

I thought what I am trying to do would be quite simple, but I can't get the
bastard thing to work!

Basically, I've created 2 projects in VS.NET (both in C#) - the first is a
class library project which outputs as PROJECTNAME.DLL,
and the second is a Pocket PC application which outputs PROJECTNAME.EXE.
The Pocket PC app is dependent on the class library, so I've added the class
library as a reference in the Pocket PC project.

Fine so far, the Pocket PC app creates some classes that are in the class
library, and then calls some of their methods. It all compiles fine.

However, when I deploy and run on the Pocket PC, I get the following error
as soon as it tries to create one of the classes in the class library:


An unhandled exception of type 'System.MissingMethodException' occurred in
PROJECTNAME.exe

:(

Does anyone know why this is???? The DLL is definitely getting copied into
the application directory on the device.
If I try and run the PROJECTNAME.EXE file on my actual PC, then it loads up
fine - it just doesn't work from the device!!

Please help!!
TIA.
 
S

ShakeDoctor

Ah thanks, I see where I went wrong then. So I need to create a class
library for windows/web applications, and a Smart Device class library for
Pocket PC? Presemably the same code can be used in both libraries, the
only difference would be the type of library created? Otherwise it would
defeat the purpose of having the libary in the first place, as I couldn't
reuse the code on all platforms?
 
C

Chris Tacke, eMVP

Correct. If you compile the class library as a CF assembly, you *can* use
it on the desktop directly.

--
Chris Tacke
Co-founder
OpenNETCF.org
Has OpenNETCF helped you? Consider donating to support us!
http://www.opennetcf.org/donate
 

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