ArcGIS Pro 2.7 API Reference Guide
ToSpatialReference Method
Example 

ArcGIS.Core.Geometry Namespace > SpatialReferenceBuilder Class : ToSpatialReference Method
Returns a SpatialReference instance representing the current state of the builder. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public SpatialReference ToSpatialReference()
Public Function ToSpatialReference() As SpatialReference

Return Value

Exceptions
ExceptionDescription
This method or property must be called within the lambda passed to QueuedTask.Run.
Example
// Use a builder convenience method or use a builder constructor.

// Builder convenience methods don't need to run on the MCT.
SpatialReference sr3857 = SpatialReferenceBuilder.CreateSpatialReference(3857);

// Builder constructors need to run on the MCT.
ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
{
  using (SpatialReferenceBuilder srBuilder = new SpatialReferenceBuilder(3857))
  {
    // do something with the builder

    sr3857 = srBuilder.ToSpatialReference();
  }
});
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

SpatialReferenceBuilder Class
SpatialReferenceBuilder Members