Generic list and powershell

I met with an accident recently riding my motorcycle and hence was unable to blog for some time. Here is my post after a brief break.   I wanted to create a generic list of my class in power shell. It was an interesting experience. Here is what I found.   When I tried to create a…

2

Debug .NET Framework Source Code and loading SOS in Visual Studio

I found this blog post from Shawn Burke to be very useful. Comes in handy if you have to step through .NET source when debugging. http://blogs.msdn.com/sburke/archive/2008/01/16/configuring-visual-studio-to-debug-net-framework-source-code.aspx Another helpful post is to load sos from Visual Studio which is explained here: http://blogs.msdn.com/vijaysk/archive/2007/11/15/sos-your-visual-studio.aspx

1

Asynchronous delegates and callback

I was debugging some issue related to asynchronous delegates and wanted to share that information with everyone.   When you do a BeginInvoke the delegate is invoked on a thread from the thread pool and on completion the callback is also called on the same thread pool thread. Now, any exceptions that is thrown on…

4

System.Data.DataException and System.Data.DataSet.RaiseMergeFailed exception

This was another interesting issue I encountered recently. The error presented itself as an event log entry from our logging as below:   Unhandled Exception: System.Data.DataException: <target>.Column2 and <source>.Column2 have conflicting properties: DataType property mismatch.    at System.Data.DataSet.RaiseMergeFailed(DataTable table, String conflict, MissingSchemaAction missingSchemaAction)    at System.Data.Merger.MergeSchema(DataTable table)    at System.Data.Merger.MergeTableData(DataTable src)    at System.Data.Merger.MergeDataSet(DataSet source)…

1

CString and GetLength

I ran into this problem recently when debugging some native code and thought that it will be good to share this with everyone.   CString sampleString = CString(_T(“Sample\0String”), 14); int len = sampleString.GetLength();          // len is 14 CString trimmedString = sampleString.Trim(); // trimmedString = “Sample” CString newstring = CString(sampleString);   // newString = “Sample” len…

12

NTSD and SOS: StopOnException

using System; class Program {     static void Main(string[] args)     {         Program p = new Program();         p.ExceptionSample();     }       private void ExceptionSample()     {         int i=0;         while (i < 100)         {             if (i == 60)             {                 try                 {                     throw new ArgumentException();                …

0