Exception – How to raise and retrieve error information whithout losing it?

Small icon All .NET applications at sometime will have to deal with an exception. It is just a matter of time. As application run longer in PRODUCTION phase than in development (unless it is a prototype ;)) the more information you can get out of the exception, the more likely you will be able to quickly pinpoint the root cause and resolve the issue.

I know, this might seem a little too basic, but there are still some misuses of Exception and misunderstanding about how to raise/re-raise exception without losing the original information. So here it is my contribution to help to improve the “good” use of Exception programming in .NET (samples are in C#, but the principles are valid for the .NET platform). (more…)

Advertisement

PerfView 1.0 – A new performance analysis tool

Microsoft has just released a new performance analysis tool, called PerfView (download here).

It can help to isolate CPU- and memory-related performance issues. As I do a few performance analysis per month, this is a very good news – something new to try. (more…)

ODP.NET – “Pooling” and “Connection request timed out”

Oracle - Pooling - smallRecently, I had to look at an issue in our code regarding “Connection request timed out”. Our Oracle connections are set to use the Pooling service offered by ODP.NET. Oracle documentation as the following description:

“The Max Pool Size attribute of the ConnectionString property sets the maximum number of connections for a connection pool. If a new connection is requested, but no connections are available and the limit for Max Pool Size has been reached, then the connection pooling service waits for the time defined by the Connection Timeout attribute. If the Connection Timeout time has been reached, and there are still no connections available in the pool, the connection pooling service raises an exception indicating that the connection pool request has timed-out.” [Ref-01, p3-6]

(more…)

WinDbg – Failed to load data access DLL

I recently had to look at the  memory consumption of a .NET process (running as a service). The process memory was growing up and we wanted to see how the memory was used  (on a Windows 2003 SP2-32 bits server machine).

Using WinDbg, we created a dump of the process memory. Then I tried to look at it on my development machine (Windows XP SP2, 32 bits) and I got the error message “Failed to load data access DLL, 0x80004005“. The error was about the version of “mscordacwks.dll“.

(more…)

TechEd 2010 – Day #4

Today, I went to 4 sessions.

1-MEF

First one was presented by Dino Esposito and about “Managed Extensibility Framework (MEF) in Action”. MEF is now part of .NET 4.0 framework

The primary role of MEF is to extend the application at runtime. As a framework, it is to improve productivity by providing the required features for extensibility and dicosvery. (more…)

How to debug a remote process

Introduction

(original blog entry)

Visual Studio supports remote debugging from one computer to another. When you are doing remote debugging, the host computer can be any platform that supports Visual Studio. The remote computer can be a 32-bit (, Windows 2000, Windows XP, or Windows Server 2003) or 64-bit (IA64, IA64 WOW mode, x64, or x64 WOW mode) platform. (more…)

How to Debug the Installation/Uninstallation of Windows Service (.NET)

(original blog entry)

Just setup in your “Debug” tab of your Visual Studio “Windows Service” project:

  • Select “Start external program” and find “InstallUtil.exe” (usually under <Windows>\Microsoft.NET)
  • Then as command line argument put the name of your executable
  • As a working directory, select the output folder of your project

It should look like this:

 

Setup the breakpoints and hit F5. The installation should start and stop at your breakpoint.

If you want to debug uninstallation of your Windows Service (.NET), use the “/u” argument of InstallUtil.exe.

If the debug session is aborted (because you stopped it in the middle or an error arose) , then the service might not be completely installed or removed. If that is the case, just open a command line window and type in:

>InstallUtil.exe /u <path:filename of your .NET executable>

Good debug session.

IIS – Web issue – “Global.asax could not be loaded”

(I had this issue back on 10 April 2006 – original blog entry)

This blog is to raise awareness of new security features in Windows XP SP2 and 2003 SP1 which are not always very visible through the different tools (e.g. Internet Explorer, Windows Explorer, …), but can make applications fail silently without warnings or events being logged. (more…)

%d bloggers like this: