Home Contact

Matt Roberts

Rails and .NET

News




Twitter












Archives

Post Categories

BlogRoll

Entropy

Syndication:

Get your (old) COM-based or "ASP.NET with Interop" web app working in Windows Server 2003 R2 64 Bit !

AKA: "Why am I getting 'ActiveX can't create component' when I try to access my COM DLL's"
AKA: "Why am I getting 'Service Unavailable' when I've set IIS to run in 32 bit compatibility mode.
AKA "Why do I get 404 errors when I browse to my ASPX pages"

Man that's a long title :)

So, I recently had to spend some time looking into getting my companies web application working in 64 Bit Windows (2003 R2 to be exact). I eventually got this working, but found the information scattered and incomplete on the interweb, so this little guide should see you through. I hope someone out there finds it useful.

Starting Point.

You have windows 2003 R2 64 bit SP1. You have the 64bit version of the .NET framework (V2 or higher) installed. No other changes have been made to IIS - it seems to run just fine for serving .NET and HTML. You install your web application that includes COM, try to run it, and BANG...

Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object

The cause? Its because those COM objects are 32 bit components, and by default IIS won't work with 32 components. You need to tell IIS to run in 32 bit compatibility mode (WOW64). To do this, you need to configure IIS to run in 32 bit compatibility mode, as explained by this link.

But wait! Its not quite that easy! If you do this, then you're telling IIS to run in 32 bit mode, but then you've already got the 64 bit ASP.NET DLL's registered with IIS, so the first time you hit your app, you'll probably see a big fat "Service Unavailable" Error message. If you look in the event log, you'll see your application pools are crashing with this error:

A process serving application pool 'DefaultAppPool' reported a failure.
The process id was '4156'. The data field contains the error number.

So, you need to register the 32 bit ASP.NET DLL's with IIS. But wait! You can't do that before you un-register the existing 64 bit ones.

Enough waffling. Here's the step-by-step :-

  1. Un-register the 64 bit ASP.NET DLL's. In a command prompt, navigate to C:\Windows\Framework64\v2.0.50727\ and from there run "aspnet_regiis -u"
  2. Set IIS to work in 32 bit compatibility (WOW64) mode:
    cscript c:\inetpub\AdminScripts\adsutil.vbs set w3svc/AppPools/Enable32BitAppOnWin64 1
  3. Register the 32-Bit ASP.NET DLL's. Navigate to C:\Windows\Framework\v2.0.50727\ and from there run "aspnet_regiis -i"
  4. Finally, in IIS, Navigate to "Web Service Extensions", and make sure that ASP.NET is "allowed".

You're done!


Feedback

# re: Get your (old) COM-based or "ASP.NET with Interop" web app working in Windows Server 2003 R2 64 Bit !

Thanks, it was a great help! 5/9/2008 3:25 AM | Luis Camayd

# re: Get your (old) COM-based or "ASP.NET with Interop" web app working in Windows Server 2003 R2 64 Bit !

This helped me out, thanks!

Mike Clarke 11/13/2008 10:33 PM | Mike Clarke

# re: Get your (old) COM-based or "ASP.NET with Interop" web app working in Windows Server 2003 R2 64 Bit !

this has been really helpful.

thanks a zillion!!!!!!!!!!! 12/17/2008 3:50 AM | tushar v

# re: Get your (old) COM-based or "ASP.NET with Interop" web app working in Windows Server 2003 R2 64 Bit !

Great! It was a really great halpful.

Thanks alot!! :) 5/10/2009 1:43 PM | greenb

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: