Could not load assembly "Esri.FileGDBAPI.dll"

11234
22
08-30-2011 12:37 PM
MarilynGambone
New Contributor
Hi,

I'm using Visual Studio 2010 and C#; Windows Server 2008 R2 Standard operating system.

I downloaded FileGDBAPI for VS2010 1.1.  I've set the target platform to x64. I made a reference to the dll.  But when I run the application, I'm getting the error, "Could not load assembly "Esri.FileGDBAPI.dll".

Appreciate any assistance on how to properly load the dll.
0 Kudos
22 Replies
DavidTriggs
New Contributor III
Since I wrote this this mornng I was able to get the 32 bit version up and running.

I have played around with the API but am confused as to how to extract and write a point. From the C# samples, you get the geometry and write it to a PointShapeBuffer, however if I try this in VB.net, I get an error saying that the GetGeometry function returns a ShapeBuffer.

PointShapeBuffer pointGeometry = row.GetGeometry();
point = pointGeometry.point;


It will offer a solution of CType(row.GetGeometry(), PointShapeBuffer) which then fails.

My question is, pardon the thread drift, is how do I get from row.GetGeometry returning a ShapeBuffer to a PointShapeBuffer and then to a point which is what I am trying to extract. There does not appear to be a connection between these three sets of information.

Thanks

David
0 Kudos
BrendanCarroll
New Contributor III

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

0 Kudos
VinceAngelo
Esri Esteemed Contributor

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

0 Kudos