System.ArgumentException' in ProjNet.dll (Transformation cannot be computed at the poles)

Jan 28 at 11:00 AM
Hi.

I have this exception frecuently, I am using TileLayer and also a Vector Layer with a Blank Provider.
Like this.

    public class BlankProvider: IProvider
    {
        #region Private Constants
        private const double DEFAULT_X_MIN = -180;
        private const double DEFAULT_X_MAX =  180;
        private const double DEFAULT_Y_MIN = -90;
        private const double DEFAULT_Y_MAX =  90;
        private const int WGSG84_ESRI_CODE = 4326;

        private const string DEFAULT_CONNECTION_ID = "BlankProvider";
        #endregion
        #region Private Variables
        private Envelope envelope;
        #endregion
        
        public BlankProvider()
        {
            envelope = new Envelope(DEFAULT_X_MIN, DEFAULT_X_MAX, DEFAULT_Y_MIN, DEFAULT_Y_MAX);
        }
        public string ConnectionID 
        {
            get
            {
                return DEFAULT_CONNECTION_ID;
            }
        }

        /// <summary>
        /// Returns true if the datasource is currently open
        /// </summary>
       public bool IsOpen 
       {
           get
           {
               return true;
           }
           
       }

        /// <summary>
        /// The spatial reference ID (CRS)
        /// </summary>
       public int SRID 
        { 
            get
            {
                return WGSG84_ESRI_CODE;
            }
            set
            {

            }
           
        
        }

        /// <summary>
        /// Gets the features within the specified <see cref="GeoAPI.Geometries.Envelope"/>
        /// </summary>
        /// <param name="bbox"></param>
        /// <returns>Features within the specified <see cref="GeoAPI.Geometries.Envelope"/></returns>
        public Collection<IGeometry> GetGeometriesInView(Envelope bbox)
        {
            return new Collection<IGeometry>();
        }

        /// <summary>
        /// Returns all objects whose <see cref="GeoAPI.Geometries.Envelope"/> intersects 'bbox'.
        /// </summary>
        /// <remarks>
        /// This method is usually much faster than the QueryFeatures method, because intersection tests
        /// are performed on objects simplified by their <see cref="GeoAPI.Geometries.Envelope"/>, and using the Spatial Index
        /// </remarks>
        /// <param name="bbox">Box that objects should intersect</param>
        /// <returns></returns>
        public Collection<uint> GetObjectIDsInView(Envelope bbox)
        {
            return new Collection<uint>() ;
        }

        /// <summary>
        /// Returns the geometry corresponding to the Object ID
        /// </summary>
        /// <param name="oid">Object ID</param>
        /// <returns>geometry</returns>
        public IGeometry GetGeometryByID(uint oid)
        {
            return null;
        }

        /// <summary>
        /// Returns the data associated with all the geometries that are intersected by 'geom'
        /// </summary>
        /// <param name="geom">Geometry to intersect with</param>
        /// <param name="ds">FeatureDataSet to fill data into</param>
        public void ExecuteIntersectionQuery(IGeometry geom, FeatureDataSet ds)
        {

        }

        /// <summary>
        /// Returns the data associated with all the geometries that are intersected by 'geom'
        /// </summary>
        /// <param name="box">Geometry to intersect with</param>
        /// <param name="ds">FeatureDataSet to fill data into</param>
        public void ExecuteIntersectionQuery(Envelope box, FeatureDataSet ds)
        {

        }

        /// <summary>
        /// Returns the number of features in the dataset
        /// </summary>
        /// <returns>number of features</returns>
        public int GetFeatureCount()
        {
            return 0;
        }

        /// <summary>
        /// Returns a <see cref="SharpMap.Data.FeatureDataRow"/> based on a RowID
        /// </summary>
        /// <param name="rowId">The id of the row.</param>
        /// <returns>datarow</returns>
        public FeatureDataRow GetFeature(uint rowId)
        {
            return null;
        }

        /// <summary>
        /// <see cref="Envelope"/> of dataset
        /// </summary>
        /// <returns>The 2d extent of the layer</returns>
        public Envelope GetExtents()
        {
            return envelope;
        }

        /// <summary>
        /// Opens the datasource
        /// </summary>
        public void Open()
        {

        }

        /// <summary>
        /// Closes the datasource
        /// </summary>
        public void Close()
        {

        }

        public void Dispose()
        {

        }
    }
When I load the Vector layer with blank provider I change its coordinate system to webMercator for compatibility with the TileLayer.

The expection occurs on Transform in the following lines (GeometryTransform.cs).
public static Envelope TransformBox(Envelope box, IMathTransform transform)
        {
            if (box == null)
                return null;
            
            var corners = new [] {
                transform.Transform(new Coordinate(box.MinX, box.MinY)),
                transform.Transform(new Coordinate(box.MinX, box.MaxY)),
                transform.Transform(new Coordinate(box.MaxX, box.MinY)),
                transform.Transform(new Coordinate(box.MaxX, box.MaxY)) };

            var result = new Envelope(corners[0]);
            for (var i = 1; i < 4; i++)
                result.ExpandToInclude(corners[i]);
            return result;
        }
What I'm doing wrong with this custom blank Provider to have that exception??