Referencing

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

An unhandled exception of type 'System.TypeLoadException' occurred in System.Windows.Forms.dl

The above exception is thrown when i run my compact framework application. I can compile the project but when i call a class the above exception is thrown. The class i called consist of full framework dll eg. System.Data.OleDb, which compact framework don't support in my compact framework project, is it due to this problem that the above exception is thrown? Thanks for your help.
 
You cannot use full framework assemblies in the CF.

-Chris


angka said:
An unhandled exception of type 'System.TypeLoadException' occurred in System.Windows.Forms.dll

The above exception is thrown when i run my compact framework application.
I can compile the project but when i call a class the above exception is
thrown. The class i called consist of full framework dll eg.
System.Data.OleDb, which compact framework don't support in my compact
framework project, is it due to this problem that the above exception is
thrown? Thanks for your help.
 
So u mean if my class use the System.Data.OleDb dll then I wont be able to call the class in my compact framework project? Then is there a way to solve the problem? Thanks for your help.
 
The TypeLoadException is thrown when you step into a function that uses an
assembly that is not available.
The easiest way to deal with it is to write a set of wrappers like this:

void SomeFunctionThatUsesOleDbProvider()
{
....
}

void SomeFunctionThatUsesOleDbProviderWrapper()
{
if ( /* Platform is Windows CE */ )
{
SomeFunctionThatUsesOleDbProvider();
}
else
{
// Use some other provider available on CF platform - e.g. SqlCe
}
}

--
Alex Feinman
---
Visit http://www.opennetcf.org
angka said:
So u mean if my class use the System.Data.OleDb dll then I wont be able to
call the class in my compact framework project? Then is there a way to solve
the problem? Thanks for your help.
 
Thanks alot. But i got another problem. I don't have the code for the class I calling as I was only given the dll. So I can't modify and the code is being used by many other full framework application. Is there any other way that I can use the class in my project? Thanks alot.
 
No.

--
Alex Yakhnin .NET CF MVP
www.intelliprog.com | www.opennetcf.org

angka said:
Thanks alot. But i got another problem. I don't have the code for the
class I calling as I was only given the dll. So I can't modify and the code
is being used by many other full framework application. Is there any other
way that I can use the class in my project? Thanks alot.
 
Back
Top