using ilasm to compile assembly for CF2

B

Buthrakaur

I need to compile some IL code to CF2 class library (.dll). I just
tried it, got the dll using something like
"c:\WINNT\Microsoft.NET\Framework\v2.0.50727\ilasm.exe /DLL mycode.il".
The DLL looks ok on first sight (I can see all the classes using
reflector), but if I add the assembly to my SmartDevice CF2 project in
VS2k5, I'm not able to use the classes. The reference is added without
any error messages, but the compiler doesn't recognize names of the
classes int the assembly if I try to use them...

If I try to use the assembly from WinForms project, everything works
ok. So it looks like the ilasm generates just full-framework compatible
assembly.

Is there any special ilasm.exe tool for compact framework?

The exact reason I'm trying to compile IL is that I need to port one
ADO.Net provider from CF1 to CF2. The only difference which causes
problem when I use directly the CF1 version of the provider from my CF2
application is a descendant of DbDataAdapter. In CF1 the DbDataAdapter
class is located in System.Data.Common.dll, but there is no such
assembly in CF2 (all classes moved to System.Data.dll). When I try to
cast descendant to base class ( (DbDataAdapter)XYZDataAdapter), the
compiler reports an error. So I used ILDASM to disassemble the
provider, modified the IL so as not to use [System.Data.Common], but
[System.Data] and now I'm trying to compile it back for CF2.

Does anybody have suggestions how to achieve this?
 
I

Ilya Tumanov [MS]

You should recompile sources of that provider against V2 instead.

If you don't have sources (e.g. provider is not created/belongs to you), you
should contact whoever does to avoid possible legal issues as well as
technical issues.


--
Best regards,

Ilya

This posting is provided "AS IS" with no warranties, and confers no rights.

*** Want to find answers instantly? Here's how... ***

1. Go to
http://groups-beta.google.com/group/microsoft.public.dotnet.framework.compactframework?hl=en
2. Type your question in the text box near "Search this group" button.
3. Hit "Search this group" button.
4. Read answer(s).
 
B

Buthrakaur

Thanks for your post. I don't have sources of course - if I have them,
I wouldn't try to ILDASM/ILASM the library. Now if we forget the legal
issues for a moment - is it possible to compile the IL code to working
CF2 assembly at all?
 
B

Buthrakaur

Anybody knows how to use ilasm to produce CF2-compatible class
libraries? I really need to solve this...
 

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