Lately, I encountered an issue where IIS kept crashing every minute due to unhandled exceptions. There was nothing much in application logs except event viewer, which says application pool “xyz” terminated unexpectedly.
This was happening in IIS 6 with .Net 4.
Are you experiencing similar issue?
The reason IIS keep crashing caused by unhandled exception is because the default policy for an unhandled exception has changed in the .Net framework 2.0 and later version.
The behavior of this policy is to end the worker process.
To fix this permanently, a developer must handle all exceptions in the application.
As a workaround, you can change unhandled exception policy back to legacy (.Net framework 1.x)
- Login into problematic IIS server
- Find which version of .Net you are using
- Go to below folder
- Take a backup of Aspnet.config file
- Modify or add if doesn’t exist following
<configuration> <runtime> <legacyUnhandledExceptionPolicy enabled="true" /> </runtime> </configuration>
- Restart IIS Application pool
You will notice, IIS will prevent crashing, and you are back in business.
If you want to be master in IIS administration, then check out this course by Hassan Aboul Hassan.
More great readings on Sysadmin
5 System Center Configuration Manager (SCCM) Alternatives for Desktop and Server PatchingSatish Shethi on July 28, 2022
Best Privileged Access Management (PAM) Solutions in 2022Lakshman Sharma on July 28, 2022
Network Bandwidth Monitoring is Easy with these 6 ToolsAshlin Jenifa on July 31, 2022
9 Best Microsoft WSUS Alternative Patch Management Tools for SMBSatish Shethi on July 13, 2022
10 Popular Network Connectivity Methods to KnowAmrita Pathak on July 1, 2022
A Brief Guide About Windows Management Instrumentation (WMI)Satish Shethi on June 28, 2022
Join Geekflare Newsletter
Every week we share trending articles and tools in our newsletter. More than 10,000 people enjoy reading, and you will love it too.