Hello Mr.Nelson I have same problem. I want to import a dll in asp.net, and I have a major problem
First i want to say that this dll works fine in a windows application written in C#, and It works fine when I use the ASP.NET development server (Local machine).
But when I run the this code in Local host ( I upload it to my webserver ) ,asp.net know its Functions, but dont return anything or return wrong output adn return true output for sometimes.
Can it be something with the security rights the IIS has? or Web.config? or my way to Import?
----------------------------------------------
for Example this Function code is:
[DllImport("mydll.dll")]
public static extern int GetTotal();
and when i call that ( in localhost )...
Response.Write( GetTotal().ToString() );
Output is: "-1" But when i use the ASP.NET development server (Local machine) It works fine, and Output is: "67"
----------------------------------------------------
this Function works true in both ( Localhost and LocalMachine ):
[DllImport("mydll.dll")]
public static extern string ErrorDescription(int errorcode);
and when i call that ...
Response.Write( ErrorDescription(3) );
output in Localhost and Localmachine is : "invalid Account" !! therefore it works file in both.
--------------------------------------------------------
this Function don't return anything in local host :
[DllImport("mydll.dll")]
public static extern string ServerGet(int index);
and when i call that ...
Response.Write( ServerGet(1) );
output in Localhost is empty! but in local machine output is : "219.39.43.34:244"
-------------------------------------------------------
i sure that Asp.net know this DLL well, and if its not so Asp.net show error for me but dont work fine! but don't work true. do you know any solution for me?
Can it be something with the IIS permissions?