Could not load assembly "Esri.FileGDBAPI.dll"

11228
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
Were you able to compile and execute the samples in samplesC#? The samples provide an example of the correct solution set up.
0 Kudos
MarilynGambone
New Contributor
Were you able to compile and execute the samples in samplesC#? The samples provide an example of the correct solution set up.


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.
0 Kudos
MarilynGambone
New Contributor
Were you able to compile and execute the samples in samplesC#? The samples provide an example of the correct solution set up.


I also tried creating a tool that reads the attribute table of a feature class inside a feature dataset in file geodatabase using just VS2010 and .NET 4, but I'm getting the same error: "Could not load file or assembly Esri.FileGDBAPI.dll or one of its dependencies..."
0 Kudos
LanceShipman
Esri Regular Contributor
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.


The OpenTK error is expected. You must download OpenTK (as noted in the readme document) to get the Display sample to compile. The .NET wrapper works with both 32-bit and 64-bit, but it  is only supported with VS2010. To use VS2008 you will need to download the VS2008 version and use C++.
0 Kudos
MarilynGambone
New Contributor
Thanks for your reply.  I realize that.  So I re-wrote the app in VS2010, and use target platform as .NET 4.  I'm still getting the same error.  My operating system is Windows Server 2008 R2 Standard.  Not sure if that's part of the problem?
0 Kudos
LanceShipman
Esri Regular Contributor
Since the samples are working, I don't think there is anything wrong with your set up. I suspect there is something missing from your solution. Can you post it?
0 Kudos
JeffRogholt
New Contributor II
I'm receiving the same error when I move the bin/debug folder to another pc and attempt to run the application.  Our app and the C# sample app run successfully within Visual Studio 2010 but once I move it to another pc I receive the error.

Does something need to be registered?  What are the steps to deploy an app using Esri.FileGDBAPI.dll?  I've also tried creating a Setup and Deployment project to deploy the app without success.  I've confirmed I'm using the 32-bit dll's and the projects are building as x86.  Nothing is 64-bit.  I'm not sure what else to try.

Thanks,
Jeff
0 Kudos
LanceShipman
Esri Regular Contributor
Esri.FileGDBAPI.dll, FileGDBAPI.dll need to be in the same directory as the executable (in in the system path).

Have you installed under C:\Program Files? We are investigating a possible issue with installing under C:\Program Files.
0 Kudos
JeffRogholt
New Contributor II
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.
0 Kudos