TypeLoadException with .Net CF

  • Thread starter Thread starter Jason Jacob
  • Start date Start date
J

Jason Jacob

to all,

I think I am not the first one to ask this question

I've written a dll in c# (project type is a library project , not
library project under SmartDeviceApplication)

Then I've attached the dll reference to another Smart Device App.
project, can the TypeLoadException occur (something like "can't load
System.Drawing.Color from the assembly 1.0.5000.0......")

Again, the dll work fine under non smart device projects.

The problem could be solved if the dll is ported to a Smart Device
App's Library project!!! It works fine then, but why?????

Microsoft Products are really buggy....... Maybe Service pack 3 may
solved the problem (I doubt +_+!)

And this is not a good solution too, since there are lots of dll
projects started earlier, so it is not practical to port or rewrite
them into the CE platform.

Can anybody help to resolve such problem ???

From Jason (Kusangihk)
 
..NETCF is a subset of the full .NET Framework. Therefore to use a dll
assembly it must be compiled against the .NETCF runtimes. However since the
..NETCF runtimes are marked as Retargetable you can use dlls built against
the Compact Framework in a desktop project as long as they don't use .NETCF
specific functionality.


Peter
 
To Peter,

Thanks for your quick reply :)
Actually, the dll involve simple operations (Non .NetCF specific
things), I just create a Color object from reading a textfile (use
Color.FromArgb (int, int, int))

So I bet there is nothing special or .NetCF specific at all, I've
checked the version of the dll and it is the same under SmartDeviceApp
projects and WindowsForm App projects. (I mean the version for both
System.Drawing is the same)

Will there be tools or advice kits for dll conversions from .Net
platforms to .NetCF platforms ?? (as stated earlier, I may need to
convert quite a number of "legacy" dll components +_+!)

Thanks!

From Jason (Kusanagihk)
 
Back
Top