How to fix .NET 4.6 application pool crash on Windows Server 2022

Trevor Levitt 0 Reputation points
2024-10-10T11:34:26.3066667+00:00

We recently upgraded our Windows Server from 2012 to 2022. We are now experiencing App Pool crashes with IIS hosted applications running .NET 4.6. The crashes require us to stop the application pool, terminate the w3wp.exe task manually for that application pool and then restart the application pool in IIS. None of our .NET Core applications seem to have this problem. We upgraded one of the older applications to .NET 4.8 but that didn't help either. We also still have an old Windows 2012 server that does not present any of these crashes with the same applications.

We were able to generate a dump file before terminating w3wp task and run it in DebugDiag. I'm seeing multiple counts of the System.ObjectDisposedException so we may be having an issue with garbage collection. I also see several others like StackOverflow and OutOfMemory but the ObjectDisposedException may be the cause of those.

I'd appreciate any help. Thanks.

Previous .NET Exceptions Report (Exceptions in all .NET Heaps)

Exception TypeCountMessageStack Trace__System.Exception__1<none>;__System.OutOfMemoryException__1<none>;__System.StackOverflowException__1<none>;__System.ExecutionEngineException__1<none>;__System.Threading.ThreadAbortException__2<none>;__System.ObjectDisposedException__4Cannot access a disposed object.;

Internet Information Services
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,504 questions
Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
13,205 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 66,226 Reputation points
    2024-10-11T17:02:19.0966667+00:00

    your windows 2022 server is running your 4.6 code (out of support) with the 4.8 runtime. to get Microsoft support you will probably need to upgrade your code to .net 4.8 first, which may fix your issue. also check you have the lastest nuget package versions.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.