CodingPleasure

cultivate passion for everything else that goes on around programming

Debugging .NET source code

TI finally managed to debug .NET source code. I needed this because a client mentioned getting the following error:

   1: System.NullReferenceException: Object reference not set to an instance of an object.
   2:    at System.Data.DataColumn.IsNotAllowDBNullViolated()
   3:    at System.Data.DataTable.EnableConstraints()
   4:    at System.Data.DataTable.set_EnforceConstraints(Boolean value)
   5:    at System.Data.DataTable.EndLoadData()
   6:    at System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue)
   7:    at System.Data.Common.DataAdapter.Fill(DataTable[] dataTables, IDataReader dataReader, Int32 startRecord, Int32 maxRecords)
   8:    at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   9:    at System.Data.Common.DbDataAdapter.Fill(DataTable[] dataTables, Int32 startRecord, Int32 maxRecords, IDbCommand command, CommandBehavior behavior)
  10:    at System.Data.Common.DbDataAdapter.Fill(DataTable dataTable)

This of course is an exception thrown inside the .NET assemblies and I was curious about the possible cause. So I followed this topic here: Configuring Visual Studio to Debug .NET Framework Source Code and was able to check out the code inside System.Data.DataTable. Of course, nothing led to a possible NullReferenceException.

Then I assumed there must be a different problem. I asked the client to run the following .NET version detector: .NET Version Detector

Client’s version:

clip_image001

My version:

image

So the obvious choice here is to ask the client to update their .NET 2.0 framework to SP2 🙂

Advertisements

3 responses to “Debugging .NET source code

  1. Dave May 24, 2011 at 20:52

    I’m getting this same exact error (Null reference from within System.Data.DataColumn.IsNotAllowDBNullViolated()) on my development machine, but my .Net version looks just like yours. Did you find anything else that could contribute to this?

    Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: