ArcGIS Pro 2.9 API Reference Guide
SpatialReferenceBuilder Constructor(String)
Example 

ArcGIS.Core.Geometry Namespace > SpatialReferenceBuilder Class > SpatialReferenceBuilder Constructor : SpatialReferenceBuilder Constructor(String)
The well-known text that represents the spatial reference.
Initializes a new instance of the SpatialReferenceBuilder class. This method must be called on the MCT. Use QueuedTask.Run.
Syntax
public SpatialReferenceBuilder( 
   string wkt
)
Public Function New( _
   ByVal wkt As String _
)

Parameters

wkt
The well-known text that represents the spatial reference.
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.

string wkt = "GEOGCS[\"MyGCS84\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137.0,298.257223563]],PRIMEM[\"Greenwich\",0.0],UNIT[\"Radian\",1.0]]";

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

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

    SpatialReference anotherSR = builder.ToSpatialReference();
  }
});
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

SpatialReferenceBuilder Class
SpatialReferenceBuilder Members
Overload List