Can't get File Geodatabase API using .NET wrapper to work with .Net Webservice

3618
3
06-11-2012 06:18 AM
BobCarberry
New Contributor
I'm trying to use the FGDB API .NET wrapper with a .NET webservice.  With the help of this post: http://gis.stackexchange.com/questions/24809/using-file-gdb-api-net-wrapper-in-asp-net-web-service,  I was able to get it working in debug mode, but when I try to deploy, I get the good 'ol Could not load file or assembly 'Esri.FileGDBAPI' or one of its dependencies. An attempt was made to load a program with an incorrect format error.  Does anybody have any ideas?
0 Kudos
3 Replies
VinceAngelo
Esri Esteemed Contributor
Could you have referenced the 32-bit DLL instead of the 64-bit, or vice versa?  Windows
returns a "file not found" code when the first file found has an incompatible architecture.

- V
0 Kudos
BobCarberry
New Contributor
Vince,

Thanks for the reply.

If I'm open up the website in VS 2010, and run it in debug mode, it runs fine.  If I open it up in VS 2010 via Administrator, and then run in debug mode, it crashes like it does when I try and deploy.  Here is the error message:

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  c:\windows\system32\inetsrv\w3wp.exe
--- A detailed error log follows.

=== Pre-bind state information ===
LOG: User = IIS APPPOOL\ASP.NET v4.0
LOG: DisplayName = Esri.FileGDBAPI
(Partial)
WRN: Partial binding information was supplied for an assembly:
WRN: Assembly Name: Esri.FileGDBAPI | Domain ID: 2
WRN: A partial bind occurs when only part of the assembly display name is provided.
WRN: This might result in the binder loading an incorrect assembly.
WRN: It is recommended to provide a fully specified textual identity for the assembly,
WRN: that consists of the simple name, version, culture, and public key token.
WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
LOG: Appbase = file:///C:/inetpub/wwwroot/GIS_Search/
LOG: Initial PrivatePath = C:\inetpub\wwwroot\GIS_Search\bin
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\inetpub\wwwroot\GIS_Search\web.config
LOG: Using host configuration file: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/gis_search/e04b26c6/2261f71a/Esri.FileGDBAPI.DLL.
LOG: Attempting download of new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP.NET Files/gis_search/e04b26c6/2261f71a/Esri.FileGDBAPI/Esri.FileGDBAPI.DLL.
LOG: Attempting download of new URL file:///C:/inetpub/wwwroot/GIS_Search/bin/Esri.FileGDBAPI.DLL.
ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

I'm referencing the 32 bit version of the API, however as you can see, when the web site is delpoyed, it wants to use the Framework for 64 bit. Could this be the problem and do you know how to reference the Framework for 32 bit?
0 Kudos
VinceAngelo
Esri Esteemed Contributor
This way out of my end of the development pool, but it seems as if the non-debug application
is 64-bit, and that you should try building it as a 64-bit app.

- V
0 Kudos