0

I've a problem running an ASMX Web Service. I'm Calling a DLL from a method (AceptaTools.dll) and this DLL load ca4xml.dll.

AceptaTools.dll has been registered with REGSVR32. But ca4xml.dll Can't.

When i Invoke the service:

_objURL = _CA4XML.GetLastResponse();

i get a message "ca4xml.dll not loaded".

Looking al Dependency Walker:

Here both files in detail: enter image description here

Both DLL are in BIN folder and my project run as x86... Why can't load?? Please help.

[WebMethod]

public string Send(string Ip, string Puerto, string NroDocumento, string TipoDocumento, string Comando, string Impresora, string Linea)
{
    try
    {
        int _Result = 0;
        string _Null = "";
        string _objURL;

        //Config Capsula
        string serverConfig = "cfg|" + Ip.ToString() + "|" + Puerto.ToString() + "|10";

        //Impresora FACTURA,1 por Defecto.
        if (string.IsNullOrEmpty(Impresora)) { Impresora = "FACTURA,1"; }
        if (string.IsNullOrEmpty(NroDocumento)) { NroDocumento = "0"; }
        if (string.IsNullOrEmpty(Comando)) { Comando = "generar"; }

        //Nuevo CAXML Cliente
        AceptaTools.CA4XML_Client _CA4XML = new CA4XML_Client();

        _Result = _CA4XML.Send(ref serverConfig, ref NroDocumento, ref Comando, ref Impresora, ref Linea, out _Null);


        if (_Result != 0)
        {
            _objURL = _CA4XML.GetLastResponse(); //Get URL
            return _objURL.ToString();
        }
        else
        {
            return "Error";
        }


    }
    catch (Exception ex)
    {
        return ex.Message.ToString();
    }
}

}

enter image description here

John Saunders
  • 160,644
  • 26
  • 247
  • 397

2 Answers2

0

When you do not load DLL in the program because you need to update some things . you can update project in nuget manager

0

Did you make sure that the ca4xml.dll is deployed properly? Since I guess it is not referenced as .NET assembly the VS will treat it like a normal file and you will need to specifically tell VS to include it when deploying.

Do the following steps to check whether deployment has been setup properly:

Open the Solution Explorer -> Got to the ca4xml.dll -> Right click -> Select Properties -> Set Build Action = None & Copy to Output = Always

Also in addition to the Dependency Walker I suggest to use Process Monitor. When you use the file access view (disregarding registry changes etc.) you can see all the locations where a process tries to load a dll from. Afterwards you can make sure that the dll you are missing is in one of the listed locations, here is the link:
http://technet.microsoft.com/en-us/sysinternals/bb896645

ntziolis
  • 10,091
  • 1
  • 34
  • 50