none
Assembly load() or dependency problem RRS feed

  • Question

  • Hi everybody,

     

    Loading my app on windows storage server 2003, I get the following Exception :

    Could not load file or assembly 'MailMill, Version=1.0.3.3, Culture=neutral, PublicKeyToken=5de605f1a26e31f5' or one of its dependencies. An attempt was made to load a program with an incorrect format.


    Notice that Windows Storage Server 2003 is a 64 bit edition

     

    Also, I copied the binaries from a XP 32 bits machine, that works fine, to the Windows Storage 2003 64 bits. Is's the way I usually do.

     

    My app uses the MaillMill.NET component to send emails. It works fine on Windows XP, but not on 2003. I know that MaillMill needs Capicom to be installed. I have installed it, but no changes.

    It seems like MaillMill.dll needs a DLL that is not on the machine and I would like to find wich one. I tried to use Dependency Walker and CheckAsm to find the dependences, but nothing came up.


    I guess that there must be a [DllImport] inside of MaillMill.dll or something like that that causes the Exception. Actually I don't know how to debug this issue.

     

    I get the same issue with another dll  ( ITapi3.dll ). I don't know if the problem comes from the OS 64 bits version or something  else.

     


    Could not load file or assembly 'ITapi3, Version=1.0.0.3, Culture=neutral, PublicKeyToken=36377d9f6f1f4883' or one of its dependencies. An attempt was made to load a program with an incorrect format

    Can you help me please ?

     

    Best regards.

     

    MatteoDev

     

    Friday, March 26, 2010 1:09 PM

Answers

All replies

  • Have you tried looking at the fusion logs? The fusion logs would give information on the assembly load failure.

     

     

    Thanks

    naveen

    http://naveensrinivasan.com/

    Friday, March 26, 2010 2:53 PM
  • Here's more about fusion logs and fuslogvw.exe: http://msdn.microsoft.com/en-us/library/e74a18c4.aspx

    -Karel
    Friday, March 26, 2010 4:00 PM
    Moderator
  • I never heard about the fuslogvw.exe...

    I will try next week and give you my feedback ! Now it's the week end ! :-)

    Thanks a lot !

    Best Regards

    MatteoDev

     

    P.S : Also thanks to Karel of course !!!

    Friday, March 26, 2010 6:47 PM
  • MailMill might be a 32-bit assembly only, but if your code is MSIL AnyCpu then it run as native 64-bit and won't load a 32-bit Dll.
    Phil Wilson
    Friday, March 26, 2010 7:08 PM
  • thank you for your response. Wow... That would put me in a big trouble ! Is there a way to get out with it ? I don't have the source code of those libraries. How can I know if there are built for 32 bits plateforms ? Best regards. MatteoDev
    Friday, March 26, 2010 8:37 PM
  • You use dumpbin to get headers And you can also change the code to compile to x86 or use corflags to change your assembly to x86.

     

     


    Thanks Naveen http://naveensrinivasan.com
    Friday, March 26, 2010 9:35 PM
  • Alright ! I will try to compile all of my code in x86. I hope I can ! I have one more fear : I am using a postscript driver (pscript5.dll), with a virtual printer, to generate PDF files. I read that wow64 cannot deal with 32 bits drivers. If that driver is a 32 bits one, can I do anything to make it work on my x64 server ? Thanks 4 helping me !
    Friday, March 26, 2010 10:15 PM
  • Hello everybody,

    With your help, I have resolved my problem. I built my code targeting the x86 plateform. All the code is now a 32 bits one and runs fine on the x64 server.

    I still have one problem : my app installs a "virtual printer" with the following dll import and it fails.

     [DllImport("winspool.drv", SetLastError = true, CharSet = CharSet.Ansi)]
    public static extern IntPtr AddPrinter(string pName, int level, IntPtr pPrinter);

    My driver files are stored on a server and are the following ones :

    09.12.2006  09:54            26'165 GHOSTPDF.PPD
    04.08.2004  00:54           134'656 PS5UI.DLL
    23.08.2001  15:47            26'761 PSCRIPT.HLP
    17.07.2004  11:41           792'644 PSCRIPT.NTF
    04.08.2004  00:54           464'384 PSCRIPT5.DLL

    Using dumpbin, I see that PSCRIPT5.DLL is a x86 dll :

    FILE HEADER VALUES
                 14C machine (x86)
                   4 number of sections
            41109627 time date stamp Wed Aug 04 09:54:15 2004
                   0 file pointer to symbol table
                   0 number of symbols
                  E0 size of optional header
                210E characteristics
                       Executable
                       Line numbers stripped
                       Symbols stripped
                       32 bit word machine
                       DLL

    A read that a x86 driver cannot be installed on x64 systems.

    The problem is that I have not developed that part of the software and I have no information about this driver ( where the files come from, where they were downloaded ). So I don't know where I can find a x64 version.

    I am going to open a new thread with this issue.

    Thanks to every of you for helping me !!!

    MatteoDev

     

    Monday, March 29, 2010 8:22 AM