.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 ‘application’

Activation fails when you try to activate Windows Vista or Windows Server 2008 over the Internet

Symptoms
When you try to activate Windows Vista or Windows Server 2008 over the Internet, the activation may be unsuccessful. Additionally, you may experience one or more of the following symptoms: Activation fails with error code 0×8004FE33. The following Error events may be recorded in the Application log:

Log Name: Application
Source: Software Licensing Service
Event ID: 8198
Level: Error Description: License Activation (SLUI.exe) failed with the following error code: 0×80004005

Log Name: Application
Source: Software Licensing Service
Event ID: 1008
Level: Error Description: Acquisition of Secure Processor Certificate failed. Status Code=hr=0×8004FE33Activation is not successful, and you are not prompted for credentials.
Resolution
This issue may occur when you connect to the Internet through a proxy server where Basic authentication is enabled.
When the proxy server is configured for Basic authentication, the server requires that you type a username and a password. However, the activation user interface does not let you enter these credentials. Therefore, the Basic authentication fails, and activation is not successful.

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.

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

FIX: A floating-point exception may occur when an inline function in a C++ application returns an uninitialized floating-point variable in Visual Studio 2005

Symptoms
Consider the following scenario:In Microsoft Visual Studio 2005, you create a C++ application.You do not specify the /fp:except option. Therefore, floating-point exceptions are not enabled in the C++ application.You do not specify the /fp:strict option. Therefore, the strict floating-point model is not enabled in the C++ application.An inline function in the C++ application returns an uninitialized floating-point variable.You compile the C++ application.In this scenario, a floating-point exception may occur when you run the C++ application. Additionally, you may receive the following error message:

0xC0000090: Floating-point invalid operation.Note This problem may occur in debug builds and in release builds.
Resolution
This problem occurs when the uninitialized floating-point variable loads a memory location that contains a signaling not-a-number (NaN) value.

FIX: A .NET Framework 2.0-based application may experience an ArgumentNullException exception and may exit unexpectedly

Symptoms
When you run a Microsoft .NET Framework 2.0-based application, the application may experience an ArgumentNullException exception and may exit unexpectedly (crash).
Resolution
This problem occurs because the FileSystemWatcher class throws an unhandled ArgumentNullException exception. This exception is generated because a race condition occurs between events that raise loops and the StopRaisingEvents method.

Exception in DbgBreakPoint with TN5250 Service

Symptoms
An application exception (trap) may occur on the SNA Server computer when you use the Rumba 5.2 TN5250 client to connect to the TN5250 Service. If you have Dr. Watson (Drwtsn32.exe) configured as the default debugger, a Drwtsn32.log file is created in the [NTROOT] directory. The following events are created in the Application event log of the Event Viewer:

Event ID: 5
Source : SNA TN5250 ServerDescription:
The SNA TN5250 Service detected an internal error.
File = ..\shared\tn5tnspm.c
Line = 3477
Fail = ((NB_IPS *)dsi5_data)->buf_size >= ((NB_IPS *)dsi5_data)->ips_length
Parm = 0×0
Event ID: 4097
Source: DrWatson
The application, exe\tn5250.dbg, generated an application error The error occurred on1/25/2000 @ 20:58: 3.406.
The exception generated was 80000003 at address 77f76274 (DbgBreakPoint).The following is an example of the exception in DbgBreakPoint:

Application exception occurred:App: exe\tn5250.dbg (pid=326)When: 1/25/2000 @ 20:58:3.406Exception number: 80000003 (hardcoded breakpoint)function: DbgBreakPointFAULT ->77f76274 ccint377f76275 c3ret77f76276 8bc0moveax,eax
Resolution
To resolve this problem, obtain the latest service pack for SNA Server 4.0. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
215838?(http://support.microsoft.com/kb/215838/EN-US/) How to Obtain the Latest SNA Server Version 4.0 Service Pack