Good day
I was looking for a way to implement the below code, inline; As in doing the implementation just before I call the code
[DllImport(dllName: "utilities.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
public static extern string EncryptCardNumber(string c);
The utilities.dll is not releasing its memory and I am looking for a way around that by only using it "inline".
I found calling GC.Collect() just after calling EncryptCardNumber was working but was slowing the program for a 9min run till above an hour.
I know the below DLLImport has to be outside the function it just to show what I hope to achieve
private string doWork(string a)
{
//need to replace below with "inline" import
[DllImport(dllName: "utilities.dll", CallingConvention = CallingConvention.StdCall, CharSet = CharSet.Ansi)]
return EncryptCardNumber(a);
}