You always need to be careful when Windows says it can't find a DLL, because sometimes it finds a DLL with the right name, but the wrong architecture, and fails.
You should make sure that the target directory is before the FileGDB API installation in your PATH when testing locally (actually, even better would to not have the FILEGDBAPI_HOME\bin* in the PATH at all), and to make sure that the required binaries (both the C# wrapper DLL and FileGDBAPI runtime DLL are in the bin folder with your application).
Please check the contents of C:\temp\CityTrackerNav\CityDPW_NavmanTracker\bin64 to make sure all the pieces are present.
Linux has an OS-level tool to inspect binaries for DLL resolution, but Windows requires a third-party tool (I have used Dependency Walker successfully for this purpose).
- V
I'm getting the same error with the latest 1.4 API. I have compiled to x64 and it runs just fine in development in on my VS2013 x64. When I deploy the output to my host x64 or Windows Server 2012 box it won't run at all. I'm using the exact structure as in the sample.
1>------ Rebuild All started: Project: AVL, Configuration: Debug x64 ------
1> 4 File(s) copied
1> 2 File(s) copied
1> AVL -> C:\temp\CityTrackerNav\CityDPW_NavmanTracker\bin64\AVLTracker.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Esri.FileGDBAPI.dll version 1.4.0.183, VS2013 Update 5, Target framework 4.5.1
Error Log:
Quartz.SchedulerException: Job threw an unhandled exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Esri.FileGDBAPI.dll' or one of its dependencies. The specified module could not be found.
at SnowBlower.SnowJob.Execute(IJobExecutionContext context)
at Quartz.Core.JobRunShell.Run() in c:\Program Files (x86)\Jenkins\workspace\Quartz.NET\src\Quartz\Core\JobRunShell.cs:line 187
--- End of inner exception stack trace --- [See nested exception: System.IO.FileNotFoundException: Could not load file or assembly 'Esri.FileGDBAPI.dll' or one of its dependencies. The specified module could not be found.
File name: 'Esri.FileGDBAPI.dll'
Thx in advance!
-BC
using System; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Esri.FileGDB; namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { Geodatabase geodatabase = Geodatabase.Open("California.gdb"); } } }
I have both of those files in the same folder as the application. I also have FileGDBAPID.dll. I removed it now to test but I received the same error.Regarding the C:\Program Files question, when I copy+paste the debug/bin folder from my dev pc to a test pc I'm pasting to the desktop so it's not in C:\Program Files. When I was trying a Setup and Deploy project then it was going to C:\Program Files\Microsoft\<my app name>. Neither worked though.I'm not familiar with the licensing aspect of ArcGIS products... I read an ArcObjects license is not needed to run the API, but does the API require ArcGIS Engine Runtime or ArcGIS Desktop? When we copy+paste our application to a pc with them installed it works correctly.
Hi,Ok, I see. I was able to compile the samples using VS2010 (except for errors for not having the OpenTK namespace).I'm getting the "could not load assembly" errors when I use VS2008 and set the target platform to 32-bit. Since most of our tasks are still in .NET 3.5, I also want to use the FileGDBAPI in 32-bit; but I keep getting this error.Thanks for your prompt response.
Were you able to compile and execute the samples in samplesC#? The samples provide an example of the correct solution set up.
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.