Posts tagged ‘C Sharp (C#)’

Event Logging Using Reflection

When exceptions occur during the execution of an application, the stack trace contains the detailed location of where the exception is originated. Continue reading ‘Event Logging Using Reflection’ »

Could not Find File ‘Microsoft.Windows.CommonLanguageRuntime’ Error

I ran into this weird compile time error the other day, and as it turned out, this is due to the limitation of Visual Studio 2005 deployment capabilities.  Continue reading ‘Could not Find File ‘Microsoft.Windows.CommonLanguageRuntime’ Error’ »

Unexpected Event Behavior

Typically, there is rarely a need to change a control’s ID. However, this practice is sometimes useful when debugging a custom control, partiularly one that contains dynamically generated controls. Continue reading ‘Unexpected Event Behavior’ »

A Strange Databinding Issue

It seems that the DropDownList control in ASP.Net 2.0 really has some issues. Besides the one I mentioned in an earlier post, I recently ran into another annoying problem. Continue reading ‘A Strange Databinding Issue’ »

Reflection and Case Sensitivity

Reflection is case sensitive by default, which comes at no surprise to most C# developers. Continue reading ‘Reflection and Case Sensitivity’ »

Enable/Disable Controls using ControlCollection

In a role based application, it is often required that certain controls on the UI form be enabled and disabled based on user’s security credentials. Continue reading ‘Enable/Disable Controls using ControlCollection’ »

The Elusive File.Copy

A while ago, I discussed some interesting behavior of File.Exist function in .Net. Recently I found out that File.Copy is just as elusive when UNC is involved. Continue reading ‘The Elusive File.Copy’ »

Same Method, Different Speed

I came across something rather interesting the other day when trying to determine what sorting algorithms .Net Framework uses in its list class: The built-in  sorting method runs much faster than the reverse-engineered and then compiled code, even though in theory the code being executed is identical. Continue reading ‘Same Method, Different Speed’ »

A TIFF Merge and Split Utility

Here is a tool that I created (in C#.Net) which comes in handy when dealing with multi-frame TIFF images. Continue reading ‘A TIFF Merge and Split Utility’ »

Understanding “A generic error occurred in GDI+.” Error

When dealing with GDI+ in .Net (e.g. certain objects in System.Drawing namespace), we would sometimes get the following exception: Continue reading ‘Understanding “A generic error occurred in GDI+.” Error’ »

Lousy GDI+ Error Messages

I have heard many people complaining about how GDI+ handles errors. Continue reading ‘Lousy GDI+ Error Messages’ »

Dynamic Event Handling Using Reflection


In an article earlier, I discussed how to dynamically load an assembly and execute it via the contract of a predefined interface. Continue reading ‘Dynamic Event Handling Using Reflection’ »

Generic Custom Configuration Handler in .Net

Sometimes we find App.config inadequate in addressing our problems and need to have a generic solution in creating strongly typed configuration files. Continue reading ‘Generic Custom Configuration Handler in .Net’ »

Partial Class Differences Between C# and VB.Net

Partial class was introduced in .Net 2.0 mainly for better handling of visual designer generated code. Continue reading ‘Partial Class Differences Between C# and VB.Net’ »

A Generic File Watcher


In business world, file watchers play an important role in day to day operations. Continue reading ‘A Generic File Watcher’ »