Could not load assembly "Esri.FileGDBAPI.dll"

11235
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
LanceShipman
Esri Regular Contributor
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.


A license should not be required. We have tested on PC's that do not have a license or access to a license without any problems. Are you using ArcObjects code? Can you post (or e-mail me at lshipman@esri.com) the error that you are receiving an example project that returns this error?
0 Kudos
PatricTrollope
New Contributor
I was experiencing the same problem, and it was because the FileGDBAPI.dll was not being picked up in my path. I manually copied it to the bin/x64/debug folder (where my executable is) and everything started working correctly. The Esri.FileGDBAPI.dll was already there since I had added it as a reference in my project.

Make sure both Esri.FileGDBAPI.dll and FileGDBAPI.dll are in the same folder as your executable (make sure you are looking in the correct folder for the platform your project/solution is building...), I suspect this is where your problem lies.

HTH
Patric
0 Kudos
OlivierOlivier
New Contributor III
Thanks Patric, I got the same problem !
0 Kudos
MikeDuppong
New Contributor
I am also having this problem.  My project's only ArcGIS-related reference is Esri.FileGDBAPI.  Project is compiled for x86 under VS2010, targeting .NET 4.  Using the 32-bit assemblies.  Folder contains my EXE, Esri.FileGDBAPI.dll, and FileGDBAPI.dll.  Using v1.2 of the API.  Running in Windows 7 / 32-bit from the folder C:\Temp\Test by double-clicking the EXE from Windows Explorer.  Also tried running from C:\Test and C:\Program Files\Test, as a normal user and "Run as administrator."  In all cases, I get the message:

System.IO.FileNotFoundException: Could not load file or assembly 'Esri.FileGDBAPI.dll' or one of its dependencies. The specified module could not be found.

Any ideas?
0 Kudos
OlivierOlivier
New Contributor III
Hi,

Are you in debug or release mode ? In my case, I was in debug and I copied dll to \fgdb\bin\debug. (fgdb is my VS 2010 project name)

Olivier
0 Kudos
MikeDuppong
New Contributor
Thanks for the reply, Olivier.

Definitely in Release mode, targeting x86.

It works on the development system (W7/64), in either Debug or Release (the Esri.FileGDBAPI.dll and FileGDBAPI.dll files exist in both).

I manually re-copied the DLL's directly from the 'bin' folder of the FGDB API folder to the target machine, still no luck.
0 Kudos
LanceShipman
Esri Regular Contributor
Do you have Visual Studio on your test machine (the machine where the code is failing)? If not you may need to load the Visual Studio C/C++ Runtime.

Can you send us your code so we can try to reproduce yours issue locally (lshipman@esri.com).
MikeDuppong
New Contributor
Lance!  You nailed it!

The VS C/C++ runtime installation did the trick!

Thank you very much for your time.
0 Kudos
WagihHassan
New Contributor
i m having the same error
using asp.net vs2010 win7/64

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 already added the 3 files "Esri.FileGDBAPI.dll" "FileGDBAPI.dll" "FileGDBAPID.dll"  to the bin directory
any help ??
0 Kudos
DavidTriggs
New Contributor III
Hi Lance,

I am trying to run the API in VB.net and have the same problem locating the DLL. I am also using the 64 bit version. I have copied the 3 DLL's to the Debug directory and checked that C++ redist is uptodate.

I then tried the 32-bit version and it comes back with the following errors. It seems to be obsessed with the geodatabase.cpp source file. I can't get this to work in either 32 bit or 64 bit.

Chers

David

Locating source for 'f:\filegdb_api\src\esri.filegdbapi\geodatabase.cpp'. Checksum: MD5 {b4 4d cd c9 dd f8 f3 7b 31 b9 5 e3 d9 33 3f b3}
The file 'f:\filegdb_api\src\esri.filegdbapi\geodatabase.cpp' does not exist.
Looking in script documents for 'f:\filegdb_api\src\esri.filegdbapi\geodatabase.cpp'...
Looking in the projects for 'f:\filegdb_api\src\esri.filegdbapi\geodatabase.cpp'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\vc7\atlmfc'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\vc7\crt'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: f:\filegdb_api\src\esri.filegdbapi\geodatabase.cpp.
The debugger could not locate the source file 'f:\filegdb_api\src\esri.filegdbapi\geodatabase.cpp'.
0 Kudos