Reputation: 791
I have an ASP.NET application, which has two references added: MapServer and GDAL. These two DLL's uses a bunch of other DLL's, and all of them are in my applications /bin
directory.
When I run the application on my own PC in Visual Studio 2010 it runs fine. When I upload it to my Windows 2008 server with IIS it throws this exception:
Could not load file or assembly 'gdal_csharp' or one of its dependencies.
An attempt was made to load a program with an incorrect format.
When running the application through Visual Studio on the server it runs fine.
I've even tried adding the /bin
directory to the PATH enviroment variable, and restarting the server. No luck though.
Upvotes: 1
Views: 1325
Reputation: 735
My guess is that the DLL is a 32-bit only DLL that you are trying to run in a x64-environment. Can you try to set the app-pool to 32-bit only?
Update: a simple instruction is here: http://help.webcontrolcenter.com/KB/a1114/how-to-enable-a-32-bit-application-pool-in-iis7-dedicatedvps.aspx
Upvotes: 4
Reputation: 16018
As already mentioned you may be missing something from the GAC.
To see whats happening you could try turning on Fusion Logging, this will enable you to view all of the assembly load failures.
Back to Basics: Using Fusion Log Viewer to Debug Obscure Loader Errors
Upvotes: 0
Reputation: 1025
You need to register the dll at GAC: http://en.wikipedia.org/wiki/Global_Assembly_Cache
Upvotes: 0