asp.net site and Could not load file or assembly 'Esri.FileGDBAPI.DLL'

9749
11
09-19-2012 06:30 AM
JohnCampbell2
New Contributor
Hi People,

I've been stumped over this issue for days now... Was hoping someone has come across this...

Receiving this error when I build my asp.net site....

Could not load file or assembly 'Esri.FileGDBAPI.DLL' or one of its dependencies. The specified module could not be found. 

The file is in the bin directory and is referenced in my project...

Thanks,
John
0 Kudos
11 Replies
JasonCleaver
Occasional Contributor
John, did you ever figure this out?  I am having the same issue with a WCF service.

Jason
0 Kudos
ARNOLDOVANGRIEKEN
New Contributor
The samehappens to me,any solution?.
0 Kudos
RichardWatson
Frequent Contributor
If the file is in the bin directory then it is something that it is referencing. 

You can run the SysInternals Process Monitor tool in order to see what the missing file (or permission error) is.

fuglogvw is another useful utility.
0 Kudos
ARNOLDOVANGRIEKEN
New Contributor
Do not generate any errors.
Thanks for your cooperation.


If the file is in the bin directory then it is something that it is referencing. 

You can run the SysInternals Process Monitor tool in order to see what the missing file (or permission error) is.

fuglogvw is another useful utility.
0 Kudos
RichardWatson
Frequent Contributor
When you download the API it delivers a bin and bin64 directory.  I am just wondering whether or not you using the correct one.  I would assume that you are using 64 bit ASP.NET worker processes?

You did copy all the ESRI files from bin or bin64 into your bin directory, correct?

If you have done all of that correctly then I suggest to open the C++ DLL in the Depends utility (Google it).  The thing that I want you to check is whether or not MSVCP110.DLL and MSVCR110.DLL can be found.  If not then that is your problem.  One think that you didn't say is whether your code is C++ or .NET.  If it is C++ and you linked with the debug library then the problem is probably that the server machine does not have the debug CRT.
0 Kudos
LanceShipman
Esri Regular Contributor
'Esri.FileGDBAPI.DLL' is the C# wrapper. Do you also copy  'FileGDBAPI.dll'?
0 Kudos
ARNOLDOVANGRIEKEN
New Contributor
Hi Richard,

Not if I said it works fine in a windows form application, which tells me there is no problem with the dll, is so or not?. The problem is when I try to create a web application or a WCF and references added, throws me the following error:

Error de servidor en la aplicación '/'.
--------------------------------------------------------------------------------


No se puede cargar el archivo o ensamblado 'Esri.FileGDBAPI' ni una de sus dependencias. Se ha intentado cargar un programa con un formato incorrecto.
Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.

Detalles de la excepción: System.BadImageFormatException: No se puede cargar el archivo o ensamblado 'Esri.FileGDBAPI' ni una de sus dependencias. Se ha intentado cargar un programa con un formato incorrecto.

Error de código fuente:




Se ha generado una excepción no controlada durante la ejecución de la solicitud Web actual. La información sobre el origen y la ubicación de la excepción pueden identificarse utilizando la excepción del seguimiento de la pila siguiente.


Rastro al cargar el ensamblado: La información siguiente puede ser útil para determinar porqué no se cargó el ensamblado 'Esri.FileGDBAPI'.





=== Información de estado anterior al enlace ===
LOG: DisplayName = Esri.FileGDBAPI
(Partial)
AVS: Se proporcionó información de enlace parcial para un ensamblado:
AVS: Nombre de ensamblado: Esri.FileGDBAPI | Id. de dominio: 5
AVS: Un enlace parcial tiene lugar cuando solo se proporciona parte del nombre para mostrar del ensamblado.
AVS: Esto puede dar lugar a que el enlazador cargue un ensamblado incorrecto.
AVS: Se recomienda proporcionar una identidad textual completamente especificada para el ensamblado,
AVS: que consta del nombre simple, la versión, la referencia cultural y el token de clave pública.
AVS: Vea las notas del producto http://go.microsoft.com/fwlink/?LinkId=109270 para obtener más información y soluciones comunes a este problema.
LOG: Appbase = file:///D:/SIG/Desarrollo/SIGWEB/WCF/WcfServValidarGDB/
LOG: PrivatePath inicial = D:\SIG\Desarrollo\SIGWEB\WCF\WcfServValidarGDB\bin
Ensamblado de llamada : (Unknown).
===
LOG: Este enlace empieza en el contexto de carga default.
LOG: Utilización del archivo de configuración de la aplicación: D:\SIG\Desarrollo\SIGWEB\WCF\WcfServValidarGDB\web.config
LOG: Utilizando el archivo de configuración de host: d:\avan-grieken\Documents\IISExpress\config\aspnet.config
LOG: Utilizando el archivo de configuración del equipo en C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: La directiva no se está aplicando a la referencia en este momento (enlace de ensamblado privado, personalizado, parcial o basado en la ubicación).
LOG: Intento de descarga de la nueva dirección URL file:///C:/Users/avan-grieken/AppData/Local/Temp/Temporary ASP.NET Files/root/7be9dad3/776439a8/Esri.FileGDBAPI.DLL.
LOG: Intento de descarga de la nueva dirección URL file:///C:/Users/avan-grieken/AppData/Local/Temp/Temporary ASP.NET Files/root/7be9dad3/776439a8/Esri.FileGDBAPI/Esri.FileGDBAPI.DLL.
LOG: Intento de descarga de la nueva dirección URL file:///D:/SIG/Desarrollo/SIGWEB/WCF/WcfServValidarGDB/bin/Esri.FileGDBAPI.DLL.
ERR: Error al completar la instalación del ensamblado (hr = 0x8007000b). Finalizó la búsqueda.




When you download the API it delivers a bin and bin64 directory.  I am just wondering whether or not you using the correct one.  I would assume that you are using 64 bit ASP.NET worker processes?

You did copy all the ESRI files from bin or bin64 into your bin directory, correct?

If you have done all of that correctly then I suggest to open the C++ DLL in the Depends utility (Google it).  The thing that I want you to check is whether or not MSVCP110.DLL and MSVCR110.DLL can be found.  If not then that is your problem.  One think that you didn't say is whether your code is C++ or .NET.  If it is C++ and you linked with the debug library then the problem is probably that the server machine does not have the debug CRT.
0 Kudos
RichardWatson
Frequent Contributor
'Esri.FileGDBAPI.DLL' is the C# wrapper. Do you also copy  'FileGDBAPI.dll'?


I would copy them all.

The standard ESRI pattern is to develop the APIs in C++ and then provide a .NET wrapper assembly which calls these.
0 Kudos
RichardWatson
Frequent Contributor

Not if I said it works fine in a windows form application, which tells me there is no problem with the dll, is so or not?. The problem is when I try to create a web application or a WCF and references added, throws me the following error:


I assume that you have a 64 bit ASP.NET worker.  In this case, make sure that your ASP.NET project adds a reference to bin64\Esri.FileGDBAPI.dll and that Copy Local is set to true.  Also, you need to manually copy the other DLLs in the bin64 directory such that they are in this directory.

My guess is that your windows form application is x86, i.e. 32 bit.
0 Kudos