Combine DLLs into one

Discussion in 'Code Samples & Tips' started by dzt, Nov 24, 2007.

  1. alfcen

    alfcen Well-Known Member Licensed User

    Hi All,

    ilmerge.exe does not like the device hardware.dll, throwing this exception in DOS mode:
    Unresolved assembly reference not allowed: Microsoft.WindowsCE.Forms

    Has anybody had the same experience?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The Hardware library references Microsoft.WindowsCE.Forms.
    Download the attached file and add it to ILMerge.
     

    Attached Files:

  3. alfcen

    alfcen Well-Known Member Licensed User

    Thanks a lot, Erel,

    we are getting closer. The merged dll containing solely device targeting dlls can now be created.

    Last problem, when attempting to run the app on the device with the merged dll, I see an error:

    Error loading program. File or assemby name 'System.Windows.Forms, Version=2.0.0.0..blah blah...or one of its dependencies, was not found.

    Is there something like a Microsoft.Windows.Forms.dll that ilmerge is missing?
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    I don't think that we are so close yet ;)
    It seems that ILMerge references the desktop dll files.
    I will test it here.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Follow these instructions and it should work:

    1. Go to C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE
    If it doesn't exist download and install .Net CF 2.0: http://www.microsoft.com/downloads/...2F-07B5-4A8C-8A44-B4E1B196D5C0&displaylang=en
    2. Copy ILMerge.exe and your dll files to this folder.
    3. Run ILMerge from this folder (do not include other dll files other than your dll files).

    I recommend you to use Microsoft Power Toy - Open Command Here: http://download.microsoft.com/download/whistler/Install/2/WXP/EN-US/CmdHerePowertoySetup.exe
    It really helps with such command line tools.
     
  6. alfcen

    alfcen Well-Known Member Licensed User

    Thanks so much, I will give it a try, Erel.
    Would ilmerge.exe once in this location, also merge DLLs referenced to the desktop?
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    It depends.
    If the dll doesn't call any desktop specific methods it will work (like ControlsEx or HTTP library which supports both platforms).
    Otherwise it will probably fail to merge.
     
  8. dzt

    dzt Active Member Licensed User

    I'm thinking again that probably illink.exe is simpler, because does not care about what DLLs are referenced by the linked DLLs.
     
  9. derez

    derez Expert Licensed User

    Last edited: Nov 28, 2007
  10. derez

    derez Expert Licensed User

    Ooooops

    I just missed two pages of discussions...:signOops:
     
  11. alfcen

    alfcen Well-Known Member Licensed User

  12. derez

    derez Expert Licensed User

    Merging

    Thanks Alfcen
    Your program did the merging but for some reason the program, when running on the device, gets an error of not able to read this merged dll, and does not run.
    I tried several times with the same result.
    I merged GPS.dll, hardware.dll and SerialDevice.dll to Nivut.dll
    All were in the same directory of the merger program.
    :confused:
     
  13. alfcen

    alfcen Well-Known Member Licensed User

    Well, derez, I have tested a few but not all DLLs. Actually, I just attempted to merge serial2.dll and gps.dll. The resulting anjin.dll was accepted by the device but...

    serial.InputString
    and/or
    GPS.GPSStream(x)

    failed to respond.

    Combining libraries doesn't seem to be that easy. Development continues in this theater of file dependencies.
     
  14. derez

    derez Expert Licensed User

    merging

    I triend with gps and serialdevice - same problem.
    I think that the problem in my case has something to do with the fact the my device has english & hebrew installed and I had experienced some problems with strings in textboxes that recieve and extra character at the beginning - may be the file name is corrupted and the system cannot find it.
     
  15. alfcen

    alfcen Well-Known Member Licensed User

    Hi Derez,
    Please try the attached merged DLL, containing
    GPS.dll, hardware.dll and SerialDevice.dll
     

    Attached Files:

  16. derez

    derez Expert Licensed User

    Nivut.dll

    Thanks for trying but it does the same like my merging.:(
     
  17. alfcen

    alfcen Well-Known Member Licensed User

    Hmm, I am using the attached combined DLL with one if my apps. The only difference being, it contains Serial2.dll
    Please try.
     

    Attached Files:

  18. royboyjoytoy2

    royboyjoytoy2 New Member

    The file "illink.zip" seems to be broken... Could someone with the original file post it as an attachment please? That would really be appreciated. ;)
     
    Last edited: May 20, 2008
  19. specci48

    specci48 Well-Known Member Licensed User

    Small info at this position: dzt updated his link in post 1. :)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice