5

I have an IIS6 server setup running Windows Server 2003 x64, R2, SP2. Everything is working great I can host websites in IIS, and it works exactly how I want.

The catch, I've got an ASP.NET WebApp that needs to use a 32-bit only Odbc driver. I've setup the ASP.NET WebApp to compile for x86 only, but it still doesn't work.

I've also tried this command on the server to enable x86 worker processes, but it also doesn't work: cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true from here

Still the application fails to load the Odbc Driver, if I run the exact same code on an x86 dev machine it works as expected, it also works on my x86 IIS7; I'd like to avoid building another production web server for this one WebApp, so any help is appreciated.

Nate
  • 2,151
  • 5
  • 25
  • 41
  • Try this: http://serverfault.com/questions/68537/is-it-possible-to-force-a-c-application-compiled-with-the-any-architecture-tag – blueberryfields Dec 30 '09 at 18:34

3 Answers3

7

In addition to enabling 32 bit apps on win 64, you need to enable 32 bit asp.net IIS integration. In Windows\Microsoft.NET\Framework\v2.0.50727 (not the Framework64 directory) run:

aspnet_regiis -enable -i

dmo
  • 2,100
  • 1
  • 16
  • 22
  • Both commands are required, this solved my issue, thanks! `aspnet_regiis -enable -i` and `cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true` – Nate Dec 30 '09 at 20:27
1

Besides what @dmo has answered above, I had to allow Application Pool to handle x86 apps.
To do this open IIS Manager and then choose Application Pool which you expect it to handle x86 and open Advanced Settings.
Now find property Enable 32-bit Applications and set to True.

Bronek
  • 111
  • 2
  • If you look at my comment to his post, you'll see that I too had to do the same thing: `adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 true ` – Nate Jun 10 '13 at 15:02
  • I've read only your answer. However I guess your command set it for the all defined pools. Maybe it would be better if you updated your answer. – Bronek Jun 10 '13 at 16:48
0

Do you have other dll's that could be accessing the ODBC driver in "Any" instead of 32-bit mode? That would likely be your problem, we had a similar issue and resolved it by switching the assemblies that called the driver to be 32-bit only ... but left the web app as "Any" (64-bit).

Beep beep
  • 1,843
  • 2
  • 18
  • 33