Hi,
I've noticed that when I have an exception in one of my custom styles, inside the DrawCore override, that the only stack that gets bubbled up looks like this:
System.NullReferenceException: Object reference not set to an instance of an object.
at ThinkGeo.MapSuite.WpfDesktopEdition.Tile.<>c__DisplayClass2.<drawexception>b__0()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)</drawexception>
I would like to see more information around the cause of the actual problem in the exception. I suspect that ThinkGeo code is catching the exception and rethrowing a new exception, without settiing the original exception as the InnerException property of the new exception.
I have gone through all of my DrawCore overrides and added a try/catch with a log.error and a rethrow, as a way to work around this problem. But I think it would be cleaner if ThinkGeo gave me more information and I suspect that other customers would like their exceptions to be more descriptive so they realize that their exception is caused by their code and not ThinkGeo code!
I have noticed this type of problem in other areas as well... but I cannot remember the specific cases.
Here are the Microsoft Guidelines for Wrapping Exceptions : msdn.microsoft.com/en-us/library/ms229049.aspx
They state.... "Do specify the inner exception when wrapping exceptions. This allows tools to display the underlying details of the problem and can aid in debugging code. ...."
Thanks,
Greg