hello
i am getting a serious problem with executing geoprocessing tools.
any time i compile the code it send me (An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in ESRI.ArcGIS.Geoprocessor.dll) with the error code number -2147467259.
i am working with arcengine 10.3.1 on vb.net
here is an exemple of code:
Imports ESRI.ArcGIS.AnalysisTools
Public Class Form2
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim gp As ESRI.ArcGIS.Geoprocessor.Geoprocessor = New ESRI.ArcGIS.Geoprocessor.Geoprocessor()
Dim nearTool As Near = New Near()
nearTool.in_features = "C:\bd\New_Shapefile.shp"
nearTool.near_features = "C:\New_Shapefile(2).shp"
nearTool.out_feature_class = "C:\bb.dbf"
gp.Execute(nearTool, Nothing)
End Sub
End Class
Have you tried running the Near tool manually in ArcMap or ArcCatalog, using the same parameters to make sure there is nothing odd going on with any of the input or output shapefiles?
actually its working fine with arcmap. i changed Near tool with GenerateNearTable and i execute it with arcmap and its work but not with the code.
the problem persist for all geoprocessing tools except buffer which worked good.
thanks for responding.
Looking at your screen shots I would say you need to define a full path to your output dbf file. Also I can tell you are using Windows 10. Now I've discovered that even as the administrator is nearly impossible to write to the root c:\ drive, I think it's a windows thing. So make sure you write to a sub-folder that you have permission to write to. On my works machine I have a folder called c:\Local that I am able to write to.