How to run VS 2010 Local IIS in 32 bit mode

asp.netasp.net-mvc-3iis-7.5

I have referenced some 32 bit and some 64 bit DLL in my ASP.NET MVC 3 project.

The projects compile but I get runtime errors.

It's because I am running the web project as 64 bit.

How do I "enable 32 bit" in my local IIS (just how I can do it in IIS 7.5 Pro)?

I am using .NET 4.0

The error I get is:

Retrieving the COM class factory for component with CLSID {A6775dfd2-1dfF-421C-A187-4D55F4DDFBFF} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Best Answer

If you don't require the 64 bit component (not sure what is running there or if this can be excluded as you simply wanted to know how to run in 32 bit more)

http://learn.iis.net/page.aspx/201/32-bit-mode-worker-processes/

You can set it at the server level via: %windir%\system32\inetsrv\appcmd set config -section:applicationPools -applicationPoolDefaults.enable32BitAppOnWin64:true

Or set your particular app pool (more recommended imho) you can try the following. Sorry the page this came from is no longer seemingly active and only googles caches is showing it now:

Force IIS to create a 32-bit app pool worker process

If your application is running as a web app, meaning it is running in an IIS app pool worker process, you’ll want that worker process (w3wp.exe) to be a 32-bit process. That can be specified in the advanced settings of the app pool:

Select the app pool for your web app. Click Advanced Settings… under Edit Application Pool on the right. Change the value of Enable 32-Bit Applications under (General) to True.

Note that the word “Enable” in the setting doesn’t mean “allow” as in “allow either 32- or 64-bit applications.” It actually means “force” as in “force the worker process to run in 32-bit mode so that 32-bit applications are supported.” This means that the app pool worker process will always be launched as a 32-bit process when this setting has a value of True. Setting it to False will launch a 64-bit app pool worker process.

Note that when an app pool worker process is started, it shows up in the Image Name column on the Processes tab in Task Manager as w3wp.exe. When the Enable 32-Bit Applications setting has a value of True, it will be listed as w3wp.exe *32.

Related Topic