0

I have created a C++ dll. It works fine and does the job.

I have created methods in asp.net that call the methods in C++ dll. DLL path is absolute. It works fine too.

I then published the website onto a folder and hosted the website on IIS. I get an error message

Exception Details: System.DllNotFoundException: Unable to load DLL 'FilesCreator.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)

Please suggest what I need to do to get it to work.

InfoLearner
  • 13,592
  • 17
  • 65
  • 108
  • This is a duplicate question by the same author. http://stackoverflow.com/questions/5247907/asp-net-c-does-not-work-under-classic-application-pool-mode – ildjarn Mar 09 '11 at 22:03
  • i really need a solution, may be my previous question was unclear as i didn't get any answer there – InfoLearner Mar 09 '11 at 22:07
  • Is the FilesCreator.dll copied into the /bin folder of the website? – hova Mar 09 '11 at 22:17
  • yep. i have used absolute and relative paths, yet no luck. – InfoLearner Mar 09 '11 at 22:25
  • Can you show us one of your DLLImport statements? Also, there were some comments to your previous question, asking for more information. You haven't given us enough information to help you debug your problem. You'll have to provide more details if you want us to help. – Jim Mischel Mar 09 '11 at 22:28
  • i just noticed the comments now. [DllImport("c:\\User\\bin\\FilesCreator.dll")] public static extern void SetText(int h, String s, string name); } – InfoLearner Mar 09 '11 at 22:38
  • just to confirm, it's not related to a missing dependent dll right? as it works perfectly in VS – InfoLearner Mar 09 '11 at 22:57

1 Answers1

1

Did you confirm that the authenticated user of the application pool which is running your app has the appropriate permissions to read and execute the DLL?

Try adding permissions for the user who is running the application pool for IIS7. For IIS6, if you are using anonymous authentication trying giving permission to the IIS anonymous user as configured in your Web Site settings. See here for IIS6 and here for IIS7.

Community
  • 1
  • 1
Josh M.
  • 23,573
  • 23
  • 96
  • 160
  • I added Everyone group in the security tab of the folder with full control. That should have worked right? – InfoLearner Mar 10 '11 at 07:45
  • Not necessarily. Edited my answer, above. – Josh M. Mar 10 '11 at 12:30
  • is using network service with no impersination. i have added network service and the logged in user in security tab of the foler which contains the DLL and I given the two users full access on the folder. yet i experience no success... what am i missing? – InfoLearner Mar 10 '11 at 23:18
  • Is this IIS7? If so, it runs as a 64-bit process so perhaps there is an issue if you're trying to call a function in a 32-bit EXE? Can you confirm that they are both targeting the same architecture? – Josh M. Mar 11 '11 at 02:00