I'm getting following exception on a production machine for a Windows desktop app:
Could not load file or assembly 'System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. File is corrupt. (Exception from HRESULT: 0x8013110E)
I understand there can be multiple reasons like platform mismatch, targeted .net framework mismatch, etc. But, what tools/checks can I run on production machine to pin-point the cause?
The fact is that the app is in 64-bits. So look into that and find an option in the advanced settings of an app pool in IIS7, named "Enable 32-Bit Applications".
After setting it to true, everything will normally work.
Note: If you want to use this in IIS6, be aware that IIS6 does not support this on a "per app pool" basis. So if you set IIS6 to 32 bit, all its app pools will run in 32 bit mode. If you want to set this on a "per app pool" basis, you will have to upgrade to IIS7. To set IIS6 to 32 bit, do the following:
cscript.exe adsutil.vbs set W3SVC/AppPools/Enable32BitAppOnWin64 "true" It seems that in some cases, the "true" from the above command needs to be replaced with a 1. Sometimes it is also necessary to reset IIS.
User contributions licensed under CC BY-SA 3.0