2012-03-16 64 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