Problem dllimport C # on web

3

Dear, I have found it very difficult to find the solution to this problem:

It turns out that I am using third-party dll which can not be integrated into the project in visual studio. Using the dllImport function I have managed to use them without problems in a desktop test application that makes, now I intend to transfer it to the web, but this does not work, I do not even give me an error with which to work simply remains in an infinite load.  I have read that it could be because of the location of the dll in question, in the project of the desktop I put them in the folder bin of the project, the same as in the web, but in one it works and in the other no.

The code I use for this is:

[DllImportAttribute("ejemplo.dll", EntryPoint = "OpenIPPort", CallingConvention = System.Runtime.InteropServices.CallingConvention.StdCall)]

public static extern int OpenIPPort(System.IntPtr ip_address, int tcp_port);
    
asked by Bryan Peralta 06.06.2016 в 21:49
source

1 answer

1

The library that you are trying to use was created with C or C ++ with which it is a non-managed dll.

You should copy it to the C:\Windows\System32

folder

Then enable the 32bit on the website in the IIS

It also validates that the Identity of the Application Pool executes with a user that has elevating privileges, could in principle use a user that is local admin

    
answered by 06.06.2016 / 22:20
source