>>>>Your app. needs to be able to find this DLL. I usually add the DLL to the project (not as a reference, just to the project) then select it and set "Copy to Output Directory" to "Copy always".
>>>
>>>Do you know how should I figure out the problems? I've been debugging the test. When I come up to the Invoke1 line I saw a call to Request.Dispose method (request is a separate class that implements IDisposable interface) and then the test ended. So, I assume that this call somehow interrupted the whole thing.
>>
>>If Request.Dispose() fired unexpectedly then it's a sure sign that your code threw an uncaught exception - which was probably the failure to load the DLL.
>>You should add your own try/catch block.
>
>Here is my current code:
>
>
> internal String RestoreData(String columnValue, String convertCode)
> {
> String result = "";
> String invoke = "gethash".MakeTag("func") + (convertCode + this.nClientNumber.ToString() + "SELECT version FROM metadata").MakeTag("data");
> String translate = "";
> try
> {
> translate = Invoke1(invoke);
> if (translate.Left(4) == "OK :")
> {
> invoke = "decryptdata".MakeTag("func") + columnValue.MakeTag("data") + translate.Substring(4).MakeTag("key");
> result = Invoke1(invoke);
> }
> }
> catch
> {
> Logging.Log(1, "Using ww_local.dll generated an exception...");
> }
> return result;
> }
>
>As you see, I have try/catch here. But it's getting by-passed and I see a call of Dispose method of the Request class.
http://msdn.microsoft.com/en-us/library/dd638517.aspx