"App-Domain could not be created" - Check Your ISAPI Filters

Ran into an issue this morning where I was working on an IIS instance that just could not for the life of it create an AppDomain to run any ASP.NET applications.

Failed to execute request because the App-Domain could not be created. Error: 0x80131522

The server was running a mixture of ASP.NET 1.1 and 2.0 applications and should have been working just fine.  I looked at the application setup, the app pool setup, the application mappings... everything was in order.

I created a second IIS server instance, new app pools, and new applications pointed at the same code as the first server instance - everything worked.  I compared app pool settings - the same.  Compared application settings - the same.  The file permissions were the same (pointed to the same physical files).  The users things were executing as were the same, but it worked.

I even went so far as to uninstall and re-install ASP.NET 1.1 and 2.0 with the server.  No change.

After investigating, you know what the difference was?

The troubled server instance had an ISAPI filter in it - specifically one to force a certain version of the .NET CLR to load up - and the working server instance did not.  After removing the ISAPI filter in the troubled server instance, everything suddenly started working again.  Problem solved.

There didn't seem to be enough overt logging to determine exactly why this was causing a problem.  Since the filter was forcing .NET 1.1 to load, I hypothesize that having .NET 1.1 loaded into the server process was trashing things as soon as .NET 2.0 tried to start up.  I'm not sure why that would be exactly, but I'm guessing somewhere in the bowels of the system there was a BadImageFormatException (1.1 trying to read/instantiate 2.0 stuff) and ended up resulting in no AppDomains for anyone.  I'd have investigated cause further but for various reasons reaching a verifiable solution was very time-sensitive and once we'd resolved the issue, determining root causes beyond the presence of the ISAPI filter was not pursued.

Long story short - if you're having trouble not being able to create an AppDomain in ASP.NET, don't forget to check your ISAPI filters.

posted on Tuesday, September 25, 2007 2:40 PM | Filed Under [ Web Development .NET ]


Gravatar # re: "App-Domain could not be created" - Check Your ISAPI Filters
by Bruce at 7/21/2008 1:08 PM
You're the man! This issue happened with Altiris Notification Server 6.0. Heavy ASP use. (Also restart IIS after removing trouble NS Isapi Filter) Thanks!!!!!!!!!!
Gravatar # re: "App-Domain could not be created" - Check Your ISAPI Filters
by ram at 8/20/2008 6:31 AM
Yes there is a same problem with altiris.. i just deleted the filter of NSdirect. Restart the IIS services. It works like a champ
Gravatar # re: "App-Domain could not be created" - Check Your ISAPI Filters
by PERFECT at 9/17/2008 8:18 AM
OUTSTANDING advice, removing the redirect filter cleared this up for me as well!!!
Gravatar # re: "App-Domain could not be created" - Check Your ISAPI Filters
by Luke at 9/24/2008 4:40 AM
Also had the problem with Altiris and would never have sussed it out without this post, well done!
Gravatar # re: "App-Domain could not be created" - Check Your ISAPI Filters
by Steph at 11/14/2008 7:59 AM
Awesome. My Altiris notification server is back on track. THanks.
Gravatar # re: "App-Domain could not be created" - Check Your ISAPI Filters
by Jason at 1/19/2009 6:18 AM
This also cleared up my issue with the NS. Question for you guys: is it OK to remove this ISAPI filter? According to Altiris knowledgebase, it has a purpose... I'm just wondering if it's safe to remove, or if any of you have noticed any issues since you removed it...
Comments have been closed on this topic.