Does the IGeometryServer2 interface work in desktop applications? My solution is an Add-in for ArcGIS 10. I'm currently passing it two valid polygon features that are in a projected coordinate system. I call the GetDistanceGeodesic() method in the following manner but it always returns infinity.
IGeometryServer2 geomServer2 = new GeometryServerClass();
var PCS = distFeat.ShapeCopy.SpatialReference as IProjectedCoordinateSystem;
ILinearUnit unit = PCS.CoordinateUnit;
double _dTestDist = geomServer2.GetDistanceGeodesic(distFeat.ShapeCopy.SpatialReference, distFeat.Shape, distFeat2.Shape, unit);
All the inputs have the expected values while stepping through in debug mode. I also tried using WGS84 but the results were the same.