Why does IPolygon.Overlap(IPolygon) use reflection to load client assemblies?

Discussion created by ssstanton on Jul 12, 2011
Latest reply on Jul 13, 2011 by ssstanton
I have a simple piece of code that checks whether an envelope overlaps a polygon:

        bool IsOverlap(IPolygon p, IEnvelope e)
            IPolygon pe = new PolygonClass();
            (pe as ISegmentCollection).SetRectangle(e);
            return (pe as IRelationalOperator).Overlaps(p);            

It was working for me this morning. But this afternoon, the call to IRelationalOperator.Overlaps causes a weird exception, apparently due to some problem reflecting on assemblies. The message is Could not load file or assembly 'Inova.Core.DataStore.XmlSerializers' or one of its dependencies.

I also see Exception from HRESULT: 0x80040215| COM Errorcode -2147220971 [FDO_E_BINDING]

My app does reference a DLL called Inova.Core.DataStore.dll (though I don't know where it's getting the XmlSerializers bit from). The stack trace looks like this:

   at System.Reflection.RuntimeAssembly.nLoad(...
   at System.Reflection.RuntimeAssembly.LoadWithPartialNameInternal(...
   at ESRI.ArcGIS.Geometry.PolygonClass.Overlaps(IGeometry other)
   at Firefly.Spatial.Survey.Database.BlockWriter.IsOverlap(IPolygon p, IEnvelope e)

Pity the ArcGIS code is top secret because now I have to ask: what's going on, and what can I do?