Home > Net >  Asp.net web application how to call unmanaged DLL containing ini configuration file?
Asp.net web application how to call unmanaged DLL containing ini configuration file?

Time:11-12

Asp.net web application how to call unmanaged DLL containing ini configuration file?

I copy in winform procedure is to put the DLL to the C: \ DLL \, environment variables, and then built the ini configuration file copy to the solution of the root directory, the following figure, can run normally released,


Then I built a asp.net web project, in the same way the ini configuration file copy to the solution to the root directory


Below is the reference DLLS


In vs local test tip mistakes when like ini configuration file doesn't work, released after prompt unable to load the DLL "ynumip_offline. DLL" : can't find the specified module, (abnormal from HRESULT: 0 x8007007e),

After release of application server I also built environment variable

Could you tell me how to call asp.net web application unmanaged DLL containing ini configuration file? Online, etc., thank you



CodePudding user response:

Ini file there are some DLL's address, port and other information

CodePudding user response:

Whether your DLL in 32 (can call, I feel is the problem

CodePudding user response:

Can't find the module is not to find ini
You the aspnet is at the same time, you have to put things in the bin, theoretically ini files in the bin, too

In addition those ini configuration recommendations for physical absolute path (the ans it's hard to know the somebody else's rules of the DLL, the relative directory, so the absolute path to the insurance)

At the same time, the real production environment should be read and write to that directory corresponding executive power (IIS running aspnet deposit actually is not in your path, what is his real running directory system disk aspnet temp directory, so this is also why you put the things in the bin under the reason, because he is actually put things in the bin in the temp directory in run)

CodePudding user response:

Add read access to your DLL
And the site itself and you put together a DLL, such as bin

CodePudding user response:

The
big watermelon a WuYiJin reference 2 floor? Response:
does your DLL in 32 (can call, I feel is the issue


reference wanghui0380 reply: 3/f
can't find the module is not to find ini
You the aspnet is at the same time, you have to put things in the bin, theoretically ini files in the bin, too

In addition those ini configuration recommendations for physical absolute path (the ans it's hard to know the somebody else's rules of the DLL, the relative directory, so the absolute path to the insurance)

At the same time, the real production environment should be read and write to that directory corresponding executive power (IIS running aspnet deposit actually is not in your path, what is his real running directory system disk aspnet temp directory, so this is also why you put the things in the bin under the reason, because he is actually put things in the bin in the temp directory in run)


references 4 floor in the autumn red fruit reply:
add read access to your DLL
And the site itself and you put together a DLL, such as bin under


(1) me this machine with the server is 64 - bit, winform edition 64 no problem before, 32 can run normally
(2) now I put all of the DLL with ini files are copied to Bin, reference Bin path, when [DllImport (@ "Bin \ ynumip_offline DLL,"...].
(3) issued after the release folder to all users already all set to fully control, or an error: unable to load the DLL "Bin \ ynumip_offline DLL" : can't find the specified module, (abnormal from HRESULT: 0 x8007007e),

CodePudding user response:

Bin \ ynumip_offline DLL this without change, still use ynumip_offline. DLL to check

Or you can directly put the DLL and ini in system disk system32 folders, Windows default DLL search path for (the current running directory, system32)

The practical operation of the current running directory: asp.net directory for C:\Windows\Microsoft.NET \ Framework \ v4.0.30319 \ Temporary asp.net Files
(according to the framework version you use)

CodePudding user response:

refer to 6th floor wanghui0380 response:
Bin \ ynumip_offline DLL that without change, still use ynumip_offline. DLL to check

Or you can directly put the DLL and ini in system disk system32 folders, Windows default DLL search path for (the current running directory, system32)

The practical operation of the current running directory: asp.net directory for C:\Windows\Microsoft.NET \ Framework \ v4.0.30319 \ Temporary asp.net Files
(according to the framework version you use)


The difference is: unable to load the DLL "ynumip_offline. DLL" : can't find the specified module, (abnormal from HRESULT: 0 x8007007e),
Unable to load the DLL "Bin \ ynumip_offline DLL" : can't find the specified module, (abnormal from HRESULT: 0 x8007007e),

Copy to system32 a bit risky, I copy to the C: \ DLL, set up the environment variables, should be the same?

CodePudding user response:

(2) now I put all of the DLL with ini files are copied to Bin, reference Bin path, when [DllImport (@ "Bin \ ynumip_offline DLL,"...].
==& gt;
[DllImport (" ynumip_offline. DLL, "...].
The bin is not a physical path, get rid of

CodePudding user response:

And you gave full control permissions, which is for the account?

CodePudding user response:

Ynumip_offline. DLL that is written in c?
https://bbs.csdn.net/topics/396908683 estimation and you almost look at this problem, also won't load the DLL you iis application is set into a 32-bit application?
  • Related