I recently migrated my desktop from ArcGIS 10.1 to 10.3.1 and visual studio from 2010 to 2013. I am now getting a problem trying to run an Engine application. It builds fine but when I try to debug it I get the above error. The error occurs right at the start when trying to get a list of installed environments "For Each item As ESRI.ArcGIS.RuntimeInfo In irs":
Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup Dim irs As Generic.IEnumerable(Of ESRI.ArcGIS.RuntimeInfo) irs = ESRI.ArcGIS.RuntimeManager.InstalledRuntimes For Each item As ESRI.ArcGIS.RuntimeInfo In irs System.Diagnostics.Debug.Print(item.Path) System.Diagnostics.Debug.Print(item.Version) System.Diagnostics.Debug.Print(item.Product.ToString()) Next Dim bInit As Boolean bInit = ESRI.ArcGIS.RuntimeManager.Bind(ESRI.ArcGIS.ProductCode.EngineOrDesktop) End Sub
From what I've read the problem is not that the ArcGISVersion.dll cannot be found (it imports into the solution no problem) it is that this .dll seems to call another .dll that cannot be found. The stack trace from the error is:
at ESRI.ArcGIS.NativeInterop.DllGetClassObject(Guid& rclsid, Guid& riid, Object& ppv) at ESRI.ArcGIS.RuntimeManager.GetArcGISVersion() at ESRI.ArcGIS.RuntimeManager.<get_InstalledRuntimes>d__0.MoveNext() at SanGIS_RoadMaintenance.My.MyApplication.MyApplication_Startup(Objectsender, StartupEventArgs e) in R:\Work\Sangis\SanGISEditTools\SanGIS_RoadMaintenance\SanGIS_RoadMaintenance\Utilities\ApplicationEvents.vb:line 24
I'm not familiar with ESRI.ArcGIS.NativeInterop and I don't know how to add a reference to it.
Also I created a new ArcEngine project from scratch and that runs fine, no errors when debugging or binding to the license manager.
Does anybody know why this app might be failing after migration?