Solution for running a 32 bit DLL in a 64 bit process or vise versa

3

I am running windows vista business 64 bit. I have a web service that was written in .NET using C#. I also have a client-side script on a web page that communicates with the web service. This is a aspx page titled "Default.aspx". I setup IIS and moved my web service folder containing the web service and all of the files that are needed to run it including the default.aspx page into C:\inetpub\wwwroot. I opened IIS manager and configured everything properly. I now get an error message:

An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

I was told that this could be a problem with my license key, the app was configured for a different format, or there is a corrupt file somewhere. My license key is fine and I don't believe there is a corrupt file. I think the issue is I'm trying to load a 32 bit DLL into a 64 bit proces or vise versa. The detailed error message is below. If someone could please give me a detailed solution as I have given a detailed description, I'd very much so appreciate it. I have been wrestling with this all day and I'm frustrated. please help me.

Exception Details: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)] Luxand.FSDK.ActivateLibrary(String LicenseKey) +0 FaceRecognition._Default.Page_Load(Object sender, EventArgs e) in D:\Project Details\Layne Projects\DotNet Project\FaceRecognition\FaceRecognition\Default.aspx.cs:60 System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +25 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +42 System.Web.UI.Control.OnLoad(EventArgs e) +132 System.Web.UI.Control.LoadRecursive() +66 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2428

windows
iis
windows-vista
.net
asked on Server Fault Feb 13, 2010 by Brandon

1 Answer

5

In IIS 7, you can configure application pools to run in 32-bit mode; this is quite useful when you have to access DLLs which are only available for 32-bit systems.

You can modify the default application pool's properties to make your whole web server run in x86 mode, or you can create a new application pool, configure it to be 32-bit and assign specific web sites and/or virtual directories to it.

answered on Server Fault Feb 13, 2010 by Massimo

User contributions licensed under CC BY-SA 3.0