CodeBetter.Com
CodeBetter.Com
RSS 2.0 via Feedburner
           Do you Twitter? Follow us @CodeBetter

Brendan Tompkins [MVP]

Blog First. Ask Questions Later.

ASP.NET Development "Bitness" on Windows XP 64 Bit Edition

I hope the title of this post isn’t too confusing; this is not about developing for 64 bit ASP.NET, it’s about how to develop ASP.NET apps when running under 64 Bit windows.  I’ve recently been tasked to do a bunch of 3D studio animation and to support this project, I was ordered a new workstation. Yeah, I’m not really bragging, but it’s a dual zeon, blah blah whatever, I’m not a hardware guy.  Poor me, right?

Anyway, I went ahead and had it equipped with XP Pro 64 Bit, assuming this would be the best for graphics-intensive apps.  Now, I’m not so sure this was the greatest idea, since as Audodesk/Descreet doesn’t appear to have a 64 bit version of 3D Studio, but I’ve got it installed so I’m sticking with it.

Today, I ran into my fist big hangup with 64 bitland.  I had a really hard time opening a Visual Studio ASP.NET project from source safe.  Specifically, opening the web project.  Just wouldn’t open.  Now since this can be a problem on a new system, I set the project type to “Local” to just get the dang thing to open up, and did manage to squeeze out a build. 

When I went to the server to test, I got

Service Unavailable

...on my local web server (running on my workstation).  You know, that brilliant IIS error in the big bold <H1> in your web browser.  So,  I re-booted the server, and I still got this error! After much looking around, I finally found some great information over on David Wang’s blog, that told me just what to do, here’s an excerpt from his post, HOWTO: Diagnose one cause of 503 Service Unavailable on IIS6:

The reason why you are getting this event is straight forward:

* On 64bit Windows, the "bitness" (i.e. 32bit or 64bit) of a process must match the bitness of the DLLs loaded by that process. In other words, a 64bit EXE can only load 64bit DLLs, and 32bit EXE can only load 32bit DLLs.
* By default, IIS6 on 64bit Windows runs with 64bit W3WP.EXE worker processes
* .NET Framework 1.1 has ASP.Net implemented through 32bit ISAPI DLLs.

What is happening when you install .NET Framework 1.1 on IIS6 on 64bit Windows is that while IIS6 runs W3WP.EXE as 64bit, you are configuring it to load some 32bit ISAPI DLLs. This does not work and leads to the event log entry. Since the ISAPI DLLs are loaded for every request, this failure immediately happens again and again, thus triggering the "Rapid Fail Protection" health monitoring check of IIS6. This leads to this Application Pool being taken offline and a 503 Service Unavailable response being sent.

One way to fix this issue is to make IIS6 run W3WP.EXE as 32bit, which allows the 32bit ISAPI DLLs installed by .NET Framework 1.1 for ASP.NET to load and run inside of it. This is done by running the following commandline:
CSCRIPT %SYSTEMDRIVE%\Inetpub\AdminScripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

This fix worked great.  I also love his use of the word “Bitness!” I think this will become common vernacular as more of us get on 64 bits.. Anyhow, just wanted to relay the fix, and the warning, and I hope you can read this … see these fonts, they were typed in 64 bit.  

-Brendan



Comments

Robert said:

Exactly how smart how you to be doing all this stuff? That's like a pianist building a house with his pretty soft hands.
# October 14, 2005 8:43 AM

Brendan Tompkins said:

Josh... Yes, it does run, as an X32 bit app. You can run 32-bit apps just fine, as long as they don't try to load a dll with different bitness. When you run 64 bit windows, you'll see two program files directories Program Files, and Program Files (x86). AFAIKT, there's no big issues running 32 bit apps.

Robert... Oh, because of the 3D stuff? I've flirted with that for years, but never been very good at it. It is like a pianist building a house.. None of the angles are right... :) It does excersize the left side of my brain, but frankly, I'm ready to do some more coding...
# October 14, 2005 9:01 AM

Michael said:

I'm a developer who plays in apps like Painter and 3DS as well. I'd say I'm more like a builder trying to play Piano. Or perhaps it's more like a coder trying to model 3D objects. Something like that... I'm horrible with metaphors ;)
# October 14, 2005 11:21 AM

Brendan Tompkins said:

Michael, cool! I'm actually in the process of creating a 3D-focused blogging site, and guess what it's called? RenderBetter.Com Would you like a blog?

-Brendan
# October 14, 2005 12:51 PM

Eric-Goz said:

I posted this at David Wang’s blog, well I had the same problem and the above mentioned fix did not work me. After digging around you must download and install the Microsoft .NET Framework Version 2.0 Redistributable Package (x64). This also updates IIS 6.0.
After this update I have no problems running VS 2003 and any .NET projects under XP64.
The URL for the download is here:
http://www.microsoft.com/downloads/thankyou.aspx?familyId=b44a0000-acf8-4fa1-affb-40e78d788b00&displayLang=en&oRef=

I hope this helps, good luck.
# November 15, 2005 3:37 PM

Mind Gravy » Blog Archive » links for 2008-02-07 said:

Pingback from  Mind Gravy  &raquo; Blog Archive   &raquo; links for 2008-02-07

# February 7, 2008 7:28 AM

Leave a Comment

(required)  
(optional)
(required)  

Enter the numbers above:
Add

About Brendan Tompkins

Brendan has been programming with .NET since the first public beta and is owner and operator of Port Technology Services, a consultancy company providing .NET application development services to the Maritime industry. In July, 2007, he was awarded the Microsoft MVP award for ASP.NET. He's also a proud co-founder of failed .COM startup Intrinsigo, and has had a hand in the failure of numerous other businesses. He currently runs CodeBetter.Com and Devlicio.us, and lives in Norfolk, Virgina with his wife Tiara and son Ian.

View Brendan's profile on LinkedIn

Check out Devlicio.us!