This post was moved to my real blog: To Resharper or not to Resharper
This blog is a placeholder for my real blog notes (used to share my drafts).
Please visit Dll Shepherd.Net
Please don't reference any of this posts because they might be moved or deleted!
Sunday, January 23, 2011
IntelliTrace:
So on Thursday I had a problem with one of the Unit Tests, but it was already late so I decided to go home and get a fresh start on the problem on Sunday. I started the the Unit Test and there indeed was a problem but it was with loading data from an a file GeoDatabase – I don’t have any program that can open such a file…
So I decided to debug the problem and usually it takes a while to reach the problem. My preferred method is to let the program run the first time in debug just to get an idea of where the Exception is located. This time I noticed something, on the right side of the screen a new screen that I haven’t noticed before appeared:
Selecting the first Exception navigated me to where the exception poped:
- public static void InsertFeature(this IFeatureBuffer buffer, IFeature feature)
- {
- buffer.Shape = feature.Shape;
- for (int i = 0; i < feature.Fields.FieldCount; i++)
- {
- IField field = feature.Fields.get_Field(i);
- if (!field.Required)
- buffer.SetValue(field.Name, feature.get_Value(i));
- }
- }
Now this in it self was huge but I still had to know from what the exception occoured, looking at all the variables shown:
So I changed the options:
And now for some odd reason some values do show (i doesn’t):
Even Locals show some data:
The problem was the field Status was in the file but not in the DB. So I changed the code to look at only fields that are both in the buffer and the feature – run all my framework unit test –> they passes. And then run the migration tests and they also passed.
//TODO: study intelliTrace more…
Keywords: vs2010, intelliTrace, Exception, unit test