Archive for April 4th, 2011

Error on 64 Bit Install of IIS – LoadLibraryEx failed on aspnet_filter.dll

I’ve been having a few problems with my Windows 7 install and trying to get IIS applications to run properly in 64 bit. After installing IIS and creating virtual directories for several of my applications and firing them up I was left with the following error message from IIS:

Calling LoadLibraryEx on ISAPI filter “c:\windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll” failed

IisIsapiFilterError

This is on Windows 7 64 bit and running on an ASP.NET 4.0 Application configured for running 64 bit (32 bit disabled). It’s also on what is essentially a brand new installation of IIS and Windows 7. So it failed right out of the box.

The problem here is that IIS is trying to loading this ISAPI filter from the 32 bit folder – it should be loading from Framework64 folder note the Framework folder. The aspnet_filter.dll component is a small Win32 ISAPI filter used to back up the cookieless session state for ASP.NET on IIS 7 applications. It’s not terribly important because of this focus, but it’s a default loaded component.

After a lot of fiddling I ended up with two solutions (with the help and support of some Twitter folks):

  • Switch IIS to run in 32 bit mode
  • Fix the filter listing in ApplicationHost.config

Switching IIS to allow 32 Bit Code

This is a quick fix for the problem above which enables 32 bit code in the Application Pool. The problem above is that IIS is trying to load a 32 bit ISAPI filter and enabling 32 bit code gets you around this problem. To configure your Application Pool, open the Application Pool in IIS Manager bring up Advanced Options and Enable 32 Bit Applications:

Enable32BitMode

And voila the error message above goes away.

Fix Filters

Enabling 32 bit code is a quick fix solution to this problem, but not an ideal one. If you’re running a pure .NET application that doesn’t need to do COM or pInvoke Interop with 32 bit apps there’s usually no need for enabling 32 bit code in an Application Pool as you can run in native 64 bit code. So trying to get 64 bit working natively is a pretty key feature in my opinion :-)

So what’s the problem – why is IIS trying to load a 32 bit DLL in a 64 bit install, especially if the application pool is configured to not allow 32 bit code at all? The problem lies in the server configuration and the fact that 32 bit and 64 bit configuration settings exist side by side in IIS. If I open my Default Web Site (or any other root Web Site) and go to the ISAPI filter list here’s what I see:

ISAPIFilters

Notice that there are 3 entries for ASP.NET 4.0 in this list. Only two of them however are specifically scoped to the specifically to 32 bit or 64 bit. As you can see the 64 bit filter correctly points at the Framework64 folder to load the dll, while both the 32 bit and the ‘generic’ entry point at the plain Framework 32 bit folder.

Aha! Hence lies our problem.

You can edit ApplicationHost.config manually, but I ran into the nasty issue of not being able to easily edit that file with the 32 bit editor (who ever thought that was a good idea???? WTF). You have to open ApplicationHost.Config in a 64 bit native text editor – which Visual Studio is not. Or my favorite editor: EditPad Pro. Since I don’t have a native 64 bit editor handy Notepad was my only choice.

Or as an alternative you can use the IIS 7.5 Configuration Editor which lets you interactively browse and edit most ApplicationHost settings. You can drill into the configuration hierarchy visually to find your keys and edit attributes and sub values in property editor type interface. I had no idea this tool existed prior to today and it’s pretty cool as it gives you some visual clues to options available – especially in absence of an Intellisense scheme you’d get in Visual Studio (which doesn’t work).

To use the Configuration Editor go the Web Site root and use the Configuration Editor option in the Management Group. Drill into System.webServer/isapiFilters and then click on the Collection’s … button on the right. You should now see a display like this:

ConfigurationEditor

which shows all the same attributes you’d see in ApplicationHost.config (cool!). These entries correspond to these raw ApplicationHost.config entries:

<filter name="ASP.Net_4.0" path="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv4.0" />
<filter name="ASP.Net_4.0_64bit" path="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv4.0,bitness64" />
<filter name="ASP.Net_4.0_32bit" path="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv4.0,bitness32" />

The key attribute we’re concerned with here is the preCondition and the bitness subvalue. Notice that the ‘generic’ version – which comes first in the filter list – has no bitness assigned to it, so it defaults to 32 bit and the 32 bit dll path. And this is where our problem comes from.

The simple solution to fix the startup problem is to remove the generic entry from this list here or in the filters list shown earlier and leave only the bitness specific versions active.

The preCondition attribute acts as a filter and as you can see here it filters the list by runtime version and bitness value. This is something to keep an eye out in general – if a bitness values are missing it’s easy to run into conflicts like this with any settings that are global and especially those that load modules and handlers and other executable code. On 64 bit systems it’s a good idea to explicitly set the bitness of all entries or remove the non-specific versions and add bit specific entries.

So how did this get misconfigured?

I installed IIS before everything else was installed on this machine and then went ahead and installed Visual Studio. I suspect the Visual Studio install munged this up as I never saw a similar problem on my live server where everything just worked right out of the box.

In searching about this problem a lot of solutions pointed at using aspnet_regiis –r from the Framework64 directory, but that did not fix this extra entry in the filters list – it adds the required 32 bit and 64 bit entries, but it doesn’t remove the errand un-bitness set entry.

Hopefully this post will help out anybody who runs into a similar situation without having to trouble shoot all the way down into the configuration settings and noticing the bitness settings. It’s a good lesson learned for me – this is my first desktop install of a 64 bit OS and things like this are what I was reluctant to find. Now that I ran into this I have a good idea what to look for with 32/64 bit misconfigurations in IIS at least.

© Rick Strahl, West Wind Technologies, 2005-2011
Posted in IIS7   ASP.NET  
kick it on DotNetKicks.com

See your location history dashboard and more with Google Maps 5.3 for Android

Today, we’re happy to announce Google Maps 5.3 for Android, which lets you see your Google Location History dashboard, check in at “home,” and add your own aspects for places when rating them.

Location History dashboard
If you’ve enabled Location History for Google Latitude, you’ve been able to visualize interesting trends in your location history with a personal dashboard at google.com/latitude on your computer. Now, you can also see your dashboard on your phone by tapping View location history from your Latitude profile. You’ll be able to see right on your phone how far you’ve travelled as well as an estimate of how much time you’ve spent at home, at work, or out.

If you haven’t yet, you can enable Location History from your computer or from Latitude’s Settings menu on your phone. Location History is 100% opt-in and is private to you and nobody else. You can always delete any of your location history from the Manage History tab or correct the estimated work and home locations from the dashboard on your computer.

View your location history dashboard from your Latitude profile on your phone and see estimates of where you’ve spent your time.

Check in at home
Now that you can see how much time you spend at “home”, you might want to let friends know when you’re there. Checking in at places using Latitude is another way to keep a history of places you’ve been and also lets you share when you’re there. I love letting friends and family know when I’m at a cafe or park, but sometimes I want them to know that I’m relaxing at home or made it back safely from a road trip. So now, I can start checking in at “home” in Latitude:
  1. Check in from Latitude and tap “Home - Tap to set your location” at the bottom of the nearby places list if you don’t have one yet.
  2. Use the estimated current address or enter in your home address yourself.
  3. Once you’ve checked in at home once, “Home” will appear at the top of the list when you’re checking in near there.

Like Latitude and other check-ins, checking in at home is entirely opt-in. Your set “home” location is not searchable and only you can check in there. Just like any other check-in, you can choose with whom to share your home check-ins (along with your name and address info).

Add your own aspects for places
When you’re rating places on the go in Maps using Google Places with Hotpot, you could always quickly leave feedback on a specific aspect or characteristic of a place, such as the food or ambiance. Before, we’d automatically include aspects about places that were commonly mentioned in reviews. Now, you can add your own aspects for each place. So if you think a place has a beautiful view or great music, you can add it yourself and quickly share it with the world.

When rating places, you can add your own aspects like “music” for places and leave quick feedback.

To get started, update Google Maps from Android Market on devices with Android OS 1.6+ anywhere Google Maps and Latitude are already available.


  • Sponsored Links

  • April 2011
    M T W T F S S
    « Mar   May »
     123
    45678910
    11121314151617
    18192021222324
    252627282930  
  • .

    Copyright © 1996-2010 Answer My Query. All rights reserved.
    iDream theme by Templates Next | Powered by WordPress