-->
When the app quits unexpectedly on its own. If the app is showing a lot of crash messages, your best bet is to uninstall and re-install the app.
This article helps you resolve the problem where unhandled exceptions cause ASP.NET-based applications to quit unexpectedly in the .NET Framework.
Original product version: .NET Framework 4.5
Original KB number: 911816
Note
This article applies to the Microsoft .NET Framework 2.0 and all later versions.
Symptoms
When an unhandled exception is thrown in a ASP.NET-based application that is built on the .NET Framework 2.0 and later versions, the application unexpectedly quits. When this problem occurs, no exception information that you must have to understanding the issue is logged in the application log.
However, an event message that is similar to the following example may be logged in the System log. Additionally, an event message that is similar to the following example may be logged in the application log.
Cause
- Here’s one big possible solution to the problem. Go into your home screen and then tap on the Settings menu. Scroll down and then tap on the Apps selection. Then scroll down to the Message app in.
- Apple’s Safari is one of the speediest and most stable browsers around. But occasionally it does run into problems. One of these is that it can shut down, displaying a message that says ‘Safari quit unexpectedly’ or something similar. Fortunately, there are several things you can do to make sure the problem doesn’t re-occur.
This problem occurs because the default policy for unhandled exceptions has changed in the .NET Framework 2.0 and later versions. By default, the policy for unhandled exceptions is to end the worker process.
In the .NET Framework 1.1 and in the .NET Framework 1.0, unhandled exceptions on managed threads were ignored. Unless you attached a debugger to catch the exception, you wouldn't realize that anything was wrong.
ASP.NET uses the default policy for unhandled exceptions in the .NET Framework 2.0 and later versions. When an unhandled exception is thrown, the ASP.NET-based application unexpectedly quits.
This behavior doesn't apply to exceptions that occur in the context of a request. These kinds of exceptions are still handled and wrapped by an HttpException
object. Exceptions that occur in the context of a request don't cause the worker process to end. However, unhandled exceptions outside the context of a request, such as exceptions on a timer thread or in a callback function, cause the worker process to end.
Messages App Quits Unexpectedly
Resolution 1
Modify the source code for the IHttpModule
object so that it will log exception information to the application log. The information that is logged will include the following:
- The virtual directory path in which the exception occurred
- The exception name
- The message
- The stack trace
To modify the IHttpModule
object, follow these steps.
Note
This code will log a message that has the Event Type of Error and the Event Source of ASP.NET 2.0.50727.0 in the application log. To test the module, request an ASP.NET page that uses the ThreadPool.QueueUserWorkItem
method to call a method that throws an unhandled exception.
Put the following code in a file that is named UnhandledExceptionModule.cs.
Save the UnhandledExceptionModule.cs file to the
C:Program FilesMicrosoft Visual Studio 8VC
folder.Open the Visual Studio Command Prompt.
Type
sn.exe -k key.snk
, and then press ENTER.Type
csc /t:library /r:system.web.dll,system.dll /keyfile:key.snk UnhandledExceptionModule.cs
, and then press ENTER.Type
gacutil.exe /if UnhandledExceptionModule.dll
, and then press ENTER.Type
ngen install UnhandledExceptionModule.dll
, and then press ENTER.Type
gacutil /l UnhandledExceptionModule
, and then press ENTER to display the strong name for the UnhandledExceptionModule file.Add the following code to the Web.config file of your ASP.NET-based application.
Resolution 2
Change the unhandled exception policy back to the default behavior that occurs in the .NET Framework 1.1 and in the .NET Framework 1.0.
Note
We do not recommend that you change the default behavior. If you ignore exceptions, the application may leak resources and abandon locks.
To enable this default behavior, add the following code to the Aspnet.config file that is located in the following folder:%WINDIR%Microsoft.NETFrameworkv2.0.50727
Status
This behavior is by design.
More information
For more information about changes in the .NET Framework 2.0, visit Breaking Changes in .NET Framework 2.0.
Those working on Windows 10 system, often prefer using the Windows Mail app for their different mail servers. It’s the best way to access all your emails from different email clients on a single platform. While this is a useful feature by Windows 10, it also comes with its own set of problems.
Many users have been experiencing the Windows 10 mail app crashing issue causing a lot of inconvenience. You may need uninstall the app complete and install it all over again. However, before that, you can try the below solutions to fix the issue.
Method 1: By Running SFC /Scannow
Step 1: Go to the Start button on your desktop and type Command Prompt in the search field. Right-click on the result and select Run as administrator to open Command Prompt in admin mode.
Step 2: In the Command Prompt window, type the below command and hit Enter:
The scanning process takes time, so have patience till it’s complete. It scans any broken files and repairs them. Once the scanning is complete, restart your PC and your Mail app should be working. If it doesn’t follow the 2nd method.
Method 2: By Checking for Updates
Step 1: Go to the Start button on your desktop and select Settings (gear icon) from the context menu, located above the Power option.
Step 2: In the Settings window, click on Update & Security.
Step 3: In the next window, click on Windows Update on the left. Now, on the right side of the pane, click on Check for updates.
If there’s any available update, it starts downloading and installing automatically. Once the installation is complete, restart your Windows 10 PC for the update t complete and the Mail app should be working fine. If not, then try the 3rd method.
Method 3: By Disabling the Windows Firewall
Step 1: Press the Windows key + R to open the Run command. Now, type control firewall.cpl in the search field. Press OK.
Step 2: In the Control Panel window, click on Turn Windows Defender Firewall on or off on the left side.
Step 3: In the next window, go to the Private network settings section and select the radio button next to Turn off Windows Defender Firewall.
Now, go to the Public network settings section and select the radio button next to Turn off Windows Defender Firewall.
Press OK to save the changes and exit.
Your mail app should be working now. If problem persists, try the 4th method.
Method 4: By Running the Troubleshooter
Step 1: Go to the Start button your desktop and type Troubleshooter in the search field. Left click on the result to open the Troubleshoot settings.
Step 2: In the Troubleshoot settings window, on the right side of the pane,scroll down and click on Additional troubleshooters link in blue.
Step 3: Next, under Find and fix other problems section, scroll down to find Windows store apps. Select it and click on the Run the troubleshooter button.
Let the troubleshooter detect any problems. It will then ask you if you want to reset any app. Follow the instructions till it’s fixed. Now, your Windows 10 Mail app should be working again. If it doesn’t work still, follow the 5th method.
Method 5: By Deleting User Account From the Windows Mail App
Step 1: Go to the Start button on your desktop and type Mail in the search box. Click on the result to open the Mail app.
Step 2: In the Mail app, click on the three horizontal lines on the upper left corner and click on the gear icon (Settings) towards the bottom left.
Step 3: Now, on the right side of the pane, under the Settings option, click on Manage Accounts.
Step 4: Here, select the email user account that you want to delete.
For instance, we selected the Outlook account here.
Step 5: In the next window, Outlook account settings (or, any account you choose), select the Delete account from this device option.
Step 6: Next, in the confirmation window, click the Delete button at the bottom to remove the user account.
*Note – You are supposed to do this step before you proceed to reset the account. So, make sure you delete the Windows Mail user account first and then reset the Mail and Calendar app.
Now, that you are done deleting the user account, proceed with the 6th method.
Method 6: By Resetting the Mail and Calendar App
Step 1: Go to Settings as explained in Method 2 Step 1. Then, in the Settings window, click on Apps.
Step 2: In the next window, on the right side of the pane, scroll down to the Apps & features section. Now, look for the Mail and Calendar app and select it.
Click on Advanced options below it.
Step 3: In the next window, scroll down till the Reset section, and press the Reset button below it.
Step 4: Click Reset again on the prompt if you are sure you want to proceed.
Now, reboot your PC and your Windows 10 Mail app should be working. If it doesn’t, try the 7th method.
Method 7: By Uninstalling and Reinstalling the App
There are two ways by which you can do this.
How To Uninstall the Mail App Through Right-Click Menu
Step 1: Go to the Start button on your desktop and type Mail in the search field. Now, right-click on the result and select Uninstall to remove the app from your Windows 10 PC.
How To Uninstall the Mail App Using Powershell
Step 1: Go to the Start button on your desktop and type Powershell in the search field. Right-click on Windows Powershell and select Run as administrator to open Powershell with admin rights.
Step 2: Now, in the Powershell window, execute the below command and hit Enter:
How To Re-install the Mail App Through Windows Store
Step 1: Go to the Start button on your desktop and type Store in the search field. Left-click on the result to open the Microsoft Store.
Messages App Quits Unexpectedly How To
Step 2: In the Microsoft Store window, go to the search box on the upper right and type Mail. Select Mail and Calendar from the list of results.
Step 3: It will take you to the Mail and Calendar app page. Click on get to download and install the app.
You have successfully installed the Mail app from Windows Store. But, if the Mail app is still not working properly, chances are that there are some mail app packages that are missing. In that case, follow the 8th method.
Method 8: By Installing Missing Mail App Packages Through Command Prompt
Step 1: Open Command Prompt in admin mode as shown in Method 1 Step 1. Now, in the Command Prompt window, run the below command and hit Enter.
Now, restart your PC for the changes to be effective. Your Windows 10 Mail app should be working perfectly fine now.
Messages App Quits Unexpectedly Without
While the above mentioned methods should resolve your Mail app crashing issue in your Windows 10, if the problem still persists. you may try another mail client. At least, till the time you can resolve this issue.
I find passion in writing Tech articles around Windows PC and softwares