Using 32-bit dll on 64-bit system shows 0x8007000B Error

感情迁移 提交于 2019-11-29 14:05:20

If you try to run 32-bit applications on IIS 7 (and/or 64-bit OS machine), you will get the same error. So, from the IIS 7, right click on the applications' application pool and go to "advanced settings" and change "Enable 32-Bit Applications" to "TRUE".

Restart your website and it should work.

Check the Build checkbox in the Configuration Manager for your executable, what CPU it is running for, probably you have Any CPU build there. Restart Visual Studio then to not complain that it couldn't debug the assembly.

Right-click on the project and open Properties->Compile->Advanced Compile Options->Target CPU: it should match the "Platform" you are building. That is, if you are building "Any CPU" then "Target CPU" should say "Any CPU". Go through all of your Platforms by making them active and check this setting.

If you try to run 32-bit applications on IIS 7 (and/or 64-bit OS machine), you will get the same error. So, from the IIS 7, right click on the applications' application pool and go to "advanced settings" and change "Enable 32-Bit Applications" to "TRUE".

Restart your website and it should work.

I have experienced this problem both when I was running a 32-bit dll on a 64-bit machine and when using the DllImport method and forgetting to install the appropriate redistributable library for what I was calling. I've needed to install the visual c++ redistributable on occasion when a called library had a dependency on that and I've also needed to install the Intel Visual Fortran redistributable - when calling a Fortran function from a .NET library.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!