2012-03-16 69 views
0

我在运行C#Web服务时遇到了问题。我从一个方法(AceptaTools.dll)调用一个VB6 DLL,并调用这个DLL调用ca4xml.dll。未加载C#WebService和DLL。 NIGHTMARE

当我调用该服务时,我收到一条消息ca4xml.dll未加载。

这两个DLL都在BIN文件夹中...为什么不能加载?请大家帮忙。

//Eliminar la marca de comentario de la línea siguiente si utiliza los componentes 


[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(); 
    } 
} 

}

+2

您是否尝试使用regsvr32注册它们? – 2012-03-16 21:06:16

+0

尝试将您的构建平台目标更改为x86。它可能有帮助。 – Phil 2012-03-16 21:17:35

+0

我已经注册,但不起作用。我已经更改为x86,但不起作用。 – Orlando 2012-03-17 01:24:28

回答

0

VB6既懂COM式装载,使DLL必须进行登记。

+0

嘿!谢谢,我可以在没有问题的情况下注册'AceptaTools.dll'。但我不能注册与regsvr32 ca4xml.dll,问题依然存在。我会尝试改变为X86 ... – Orlando 2012-03-17 00:22:08