I'm trying to create a Feature class. It shows the error
X Y domain on the spatial reference system is not set or in valid
Here is my code attempt:
IWorkspaceFactory wsf = new FileGDBWorkspaceFactory();
IWorkspace ws = wsf.OpenFromFile(@"D:\ARC OBJECTS\Newgdb.gdb",
ArcMap.Application.hWnd);
IFeatureWorkspace fws = ws as IFeatureWorkspace;
IFields flds = new FieldsClass();
IFieldsEdit fldsedit = flds as IFieldsEdit;
IField fld = new FieldClass();
IFieldEdit fldedit = fld as IFieldEdit;
fldedit.AliasName_2 = "Shape";
fldedit.IsNullable_2 = false;
fldedit.Name_2 = "Shape";
fldedit.Type_2 = esriFieldType.esriFieldTypeGeometry;
IGeometryDef gdef = new GeometryDefClass();
IGeometryDefEdit gdedit = gdef as IGeometryDefEdit;
gdedit.GeometryType_2 = esriGeometryType.esriGeometryPolygon;
gdedit.SpatialReference_2 = new UnknownCoordinateSystemClass();
fldedit.GeometryDef_2 = gdedit;
fldsedit.AddField(fld);
IFeatureClass feacls= fws.CreateFeatureClass("Error", flds, null,
null,esriFeatureType.esriFTSimple, "shape", "");
Where did I go wrong?