.NET Questions and Solutions

As a software engineer, I focus on .NET, especially asp.net, C#, WCF and so on, and I am also very interested in Search Engine Optimization.

Entries Tagged ‘exception’

What Are Fatal Exception Errors

Symptoms
When you attempt to shut down your computer, start Windows, or start a program in Windows, you may encounter error messages that are similar to:

A fatal exception XY has occurred at xxxx:xxxxxxxx Fatal exception errors are codes that are returned by a program in the following cases: Access to an illegal instruction has been encountered Invalid data or code has been accessed The privilege level of an operation is invalid When any of these cases occurs, the processor returns an exception to the operating system, which in turn is handled as a fatal exception error. In many cases the exception is non-recoverable and the system must either be restarted or shut down, depending upon the severity of the error.
In the sample error message that is listed above, XY represents the actual processor exception from 00 to 0F. (Note that the “h” that is listed after the 0E, 0F, and so on, in the explanations below is frequently omitted from the error message.) The xxxx:xxxxxxxx value represents the enhanced instruction pointer to the code segment; the 32-bit address is the actual address where the exception occurred.
Windows does not cause these errors, but has the exception-handling routine for that particular processor exception, which displays the error message.
NOTE: This article is primarily for informational use. Click the following link to go to the “Troubleshooting Fatal Exception Errors” section of this article:

Unknown Software Exception When Application Calls OpenGL

Symptoms
An unknown software exception occurs when applications call OpenGL. WhenWindows NT attempts to shutdown the computer, a bluescreen appears.
Resolution
To correct this problem, install the latest U.S. Service Pack for WindowsNT version 3.51.

Unhandled exceptions cause ASP.NET-based applications to unexpectedly quit in the .NET Framework 2.0

Symptoms
When an unhandled exception is thrown in a Microsoft ASP.NET-based application that is built on the Microsoft .NET Framework 2.0, 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 may be logged in the System log:
Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1009
Date: 9/28/2005
Time: 3:18:11
PM User: N/A
Computer: IIS-SERVER
Description:
A process serving application pool ‘DefaultAppPool’ terminated unexpectedly. The process id was ‘2548’. The process exit code was ‘0xe0434f4d’. Additionally, an event message that is similar to the following may be logged in the Application log:
Event Type: Error
Event Source: .NET Runtime 2.0 Error Reporting
Event Category: None
Event ID: 5000
Date: 9/28/2005
Time: 3:18:02 PM
User: N/A
Computer: IIS-SERVER
Description:
EventType clr20r3, P1 w3wp.exe, P2 6.0.3790.1830, P3 42435be1, P4 app_web_7437ep-9, P5 0.0.0.0, P6 433b1670, P7 9, P8 a, P9 system.exception, P10 NIL.
Resolution
This problem occurs because the default policy for unhandled exceptions has changed in the .NET Framework 2.0. By default, the policy for unhandled exceptions is to end the worker process.
In the Microsoft .NET Framework 1.1 and in the Microsoft .NET Framework 1.0, unhandled exceptions on managed threads were ignored. Unless you attached a debugger to catch the exception, you would not realize that anything was wrong.
ASP.NET uses the default policy for unhandled exceptions in the .NET Framework 2.0. When an unhandled exception is thrown, the ASP.NET-based application unexpectedly quits.
This behavior does not 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 do not 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.

PRB: Exception Code 0xE06D7363 When Calling Win32 SEH APIs

Symptoms
When you call Win32 Structured Exception Handling (SEH) APIs, such asGetExceptionCode() and GetExceptionInformation(), sometimes the systemreports the following exception code:

0xE06D7363 Sometimes GetLastError() also returnsthis value. This exception code will be used for any error that is raised by the Microsoft Visual C++ compiler through a call to “throw”.
Resolution
All Visual C++ exceptions thrown from code generated by the MicrosoftVisual C++ compiler contain this error code. Because this is a compiler-generated error, the code is not listed in the Win32 API header files. The code is actually a cryptic mnemonic device, with the initial “E” standing for “exception” and the final 3 bytes (0×6D7363) representing the ASCII values of “msc”.

INFO: Microsoft Application Blocks for .NET – Exception Management Application Block Overview

Symptoms
This article describes the Microsoft Application Blocks for .NET topic “Exception Management Application Block Overview.”
The Exception Management Application Block provides a simple, extensible framework for handling exceptions. Without affecting your application code, you can do the following: Log exception information to the event log by using only one line of application code.Extend the application block by creating your own components that log exception details to other data sources or notify operators.You can use the Exception Management Application Block as a building block in your .NET Framework-based application.
Resolution
“Exception Management Application Block Overview” contains the following sections: Introduction
The Exception Management Application Block is an exception management framework that you can use as a building block in your own .NET Framework-based application. If you use this block, you reduce the quantity of custom error handling code that you must create, test, and maintain. You may also make your application more robust and easier to debug.
The Exception Management Application Block helps you to do the following: Manage exceptions in an efficient and consistent way.Isolate exception management code from business logic code.Handle and log exceptions by using minimal custom code.What Does the Exception Management Application Block Include?
The Exception Management Application Block is made up of three Microsoft Visual Studio .NET projects, full source code, and comprehensive documentation.Downloading and Installing the Exception Management Application Block
A Microsoft Windows Installer file that contains the Exception Management Application Block projects, source code, and comprehensive documentation is available.
The install process creates a Microsoft Application Blocks for .NET menu on your Programs menu. An Exception Management menu appears on the Microsoft Application Blocks for .NET menu. The Exception Management menu includes options to start the documentation and to start the Exception Management Application Block Visual Studio .NET solution.Using the Exception Management Application Block
This section discusses how to use the basic features of the Exception Management Application Block. For additional information about these topics, and other related topics, see the documentation that is included with the Exception Management Application Block download.
The topics that this section discusses include: Publishing ExceptionsReferencing the Exception Management Application BlockConfiguring the Exception Manager Application Block
You control the behavior of the Exception Management Application Block by using the following standard .NET Framework-based XML application configuration files: Web.config (for an ASP.NET application)Appname.exe.config (for a Windows-based application)You can also apply configuration settings at the computer level by using the Machine.config file.Extending the Exception Management Application Block
You may be satisfied with the functionality of the default publisher. The default publisher writes exception details to the Windows event log. However, you may want to develop your own custom publishers to log exception details to alternative locations or to notify operators (possibly through Microsoft Windows Management Instrumentation [WMI]), that an exception has occurred. This section discusses how to extend the functionality of the Exception Management Application Block.Internal Design
This section discusses the main elements of the Exception Management Application Block. The main elements of the Exception Management Application Block are as follows: The BaseApplicationException classThe ExceptionManagerSectionHandler classThe ExceptionManager classThe ExceptionManagerInstaller classThe DefaultPublisher classThe IExceptionPublisher interfaceThe IExceptionXmlPublisher interface

How the Windows Firewall exception settings in the Group Policy administrative template work together with the Windows Firewall Control Panel program in Windows Vista

Symptoms
This article describes how the Windows Firewall exception settings in the Group Policy administrative template work together with the Windows Firewall Control Panel program in Windows Vista.
Resolution
Group Policy settingsYou can configure the Windows Firewall settings in the Group Policy administrative template and then apply the settings to a Windows Vista-based computer. The settings that you use to configure exceptions appear on the Exceptions tab in the Windows Firewall Control Panel program. When you enable a setting in the Group Policy administrative template, the setting generates an enabled firewall rule that has the “Allow” action. When you disable a setting, this action generates an enabled firewall rule that has the “Block” action.
Windows Firewall Control Panel program settingsIf you enable or disable an exception by using the settings in Group Policy, the check box for the exception entry is selected in the Windows Firewall Control Panel program. A selected check box indicates only that some action has been taken in that exception. The selection does not indicate what specific action is configured in the exception. The selected check box could indicate any of the following settings:Windows Firewall: Allow inbound file and printer sharing exception Windows Firewall: Allow inbound remote administration exception Windows Firewall: Allow inbound Remote Desktop exception Windows Firewall: Allow inbound UPnP framework exceptions Windows Firewall: Allow ICMP exceptions
Full exception settingsTo view the full exception settings, use the “Windows Firewall with Advanced Security” snap-in. This snap-in is available in the Administrative Tools folder.