0

I have an MS ReportViewer report that is bound to a datasource, that is requesting a property that it shouldnt. I have checked all of the fields on the report and I cant find anywhere its used.

Putting a break point on the property shows its definately being called, but I cant find out from where as its the ReportViewer is making the call.

****Is there a way to find out where this property is being called from?**

Here is what I have checked so far:

enter image description here

Stack Trace: shows managed code, checked the disassembly but couldn't see anything obvious.

enter image description here

Call hierarchy shows all the places that property is called from - none of which are on the report.

Update:

Tried n8wrl's suggestion of throwing an exception, but the stack is still on unmanaged code.

enter image description here

Update 2

I have also tried adding Xml and Script ignore tags in case the object as being serialized somewhere but that didn't work (unless they are not the correct tags to ignore serialization?)

WraithNath
  • 17,658
  • 10
  • 55
  • 82
  • Bang it with a hammer - can you make your property throw an exception, run the report, and look at the stack trace when it fails? – n8wrl Jul 18 '12 at 16:12
  • @n8wrl - Thanks, I have tried your suggestion (see update) but I still have the same issue with not knowing where it has been requetsed from due to unmanaged code. – WraithNath Jul 18 '12 at 16:22

1 Answers1

1

Ok, I have come up with a solution. I assumed this had something to do with serialization so I passed the datasource in to a System.Web.Script.Serialization.JavaScriptSerializer.

When serializing the object I found all of the properties that were causing the code to bomb out. I added [ScriptIgnore] tags to these properties to stop them begin serialized as they were not used.

System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer();

serializer.RecursionLimit = int.MaxValue;

object o = serializer.Serialize(base.CurrentOrder);
WraithNath
  • 17,658
  • 10
  • 55
  • 82