[DllImport("Final1_dll.dll", CharSet = CharSet.Ansi, CallingConvention=CallingConvention.StdCall)]
public static extern IntPtr PtrReturnAPI02(char[] abc);
I need some suggestions ASAP. Thanks in advance. public string DemosData(Stream data1) {
// convert Stream Data to StreamReader
StreamReader reader = new StreamReader(data1);
// Read StreamReader data as string
string xmlString = reader.ReadToEnd();
if (IsJson(xmlString))
{
IntPtr pStr = PtrReturnAPI02(xmlString.ToCharArray());
string str = Marshal.PtrToStringAnsi(pStr);
Marshal.FreeHGlobal(pStr);
pStr = IntPtr.Zero;
return str;
}
else
{ return "Input was not in a correct format."; }
// PtrReturnAPI02(xmlString.ToCharArray());
}
public static bool IsJson(string input)
{
input = input.Trim();
return input.StartsWith("{") && input.EndsWith("}")
|| input.StartsWith("[") && input.EndsWith("]");
}
[ServiceContract]
interface IManagedCodeService
{
[OperationContract(Name="DemoData")]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "DemoData")]
string DemosData(Stream data1);
}
}

VulpesRank #55 · 29.2K reputationPosted Apr 10, 2014, 5:02 AM EDT
If you're not sure what dependencies the dll has, you can check them with the free tool Dependency Walker:
http://www.dependencywalker.com/
Software House5 reputationPosted Apr 10, 2014, 5:11 AM EDT
yes I run the dependencywalker on the server and resolve all the dll required for this dll add it to the system32 and SysWOW64 folder but the same error is returning
VulpesRank #55 · 29.2K reputationPosted Apr 10, 2014, 5:24 AM EDT
Dependency Walker has a column which will tell you which CPU the dll was compiled for.
Software House5 reputationPosted Apr 10, 2014, 6:07 AM EDT