TypeLoadException

T

tkragelj

Hi

I checked previous posts for this error, but it seems nothing works for
me. When I reference external class library from my application and use
their classes, I get TypeLoad exception when I launch my application
(compiler doesn't complain). If I copy the code to my application,
compile and run, it works. I tested all references assemblies and they
are all of type "Pocket PC 2003 Class library".

This is the message I get:
Could not load type 'System.Collections.Generic.List`1' from assembly
'mscorlib, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=969DB8053D3322AC'.

What am I missing???

Regars, Tom
 
G

Guest

Use Reflector to check, but I believe that the 969D... public key token is
for CF 1.0, which would explain why it can't find Generics. Make sure the
project references are all correct.

-Chris
 
A

Alex Feinman [MVP]

Actually, I think this is the desktop version of mscorlib. There must be a
reference somewhere there to a component built for the desktop
 
T

tkragelj

Original code was made for desktop application, but I copied the
sources to a new Pocket PC 2003 library project and compiled it there.
This works since I don't use functionality not supported in CF. After I
reference this library in my Pocket PC application, compiler is also
happy, but emulator reports an error. I tried to re-create the library
several times, but every time with the same result (I'm sure I use 2.0
version of CF for the library and project).

It looks like the problem is in references, since it works when all
code is copied to the main project, but I can't find what's wrong with
the libraries. Reflector display seems ok to me. The 2.0.0.0 version of
mscorlib has PKT 969db8053d3322ac. I will re-check again, thanks for
suggestions. Anything else to look for?

Tom

Alex Feinman [MVP] je napisal:
 
T

tkragelj

After stripping my application to bare bones, moving all the files from
the libraries to the main application solution and deleting all
references to my libraries, this is what I get when I start the
application:

Could not load type 'System.Xml.XmlElement' from assembly 'System.Xml,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=969DB8053D3322AC'.

I can't even debug. As soon as one line of code that uses the classes
(new statement for example) is included, the application terminates
with the TypeLoadException. This is really weird... And this was
working at one point... At the moment I'm completely lost.

Tom
 

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