|Applies To||RKM C# Client 2.7 SP1|
|Issue||RKM: "Exception: An attempt was made to load a program with an incorrect format." on Windows 64-bit|
4:00 PM - Exception: The type initializer for 'kmPINVOKE' threw an exception.
4:00 PM - StackTrace: at kmPINVOKE.R_KM_CTX_new_from_file__SWIG_1(String jarg1, Int32& jarg2)
at Rsa.KeyManagerClient.RkmContext..ctor(String configurationFileName, String credentialPassword, String cachePassword)
4:00 PM - Exception: The type initializer for 'SWIGExceptionHelper' threw an exception.
4:00 PM - StackTrace: at kmPINVOKE.SWIGExceptionHelper..ctor()
4:00 PM - Exception: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
4:00 PM - StackTrace: at kmPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_km(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate)
Installed RKM C# Client on a 64-bit server, set Web application to run as a 32-bit application (from IIS7, right click on the application's application pool, go to "Advanced Settings" and change "Enable 32-Bit Applications" to "TRUE").
|Cause||IIS is expecting the application to be entirely 32 bit, including the libraries that get loaded, and may be interfering with any 64-bit execution.|
|Resolution||Turn off the 32-bit option (from IIS7, right click on the application's application pool, go to "Advanced Settings" and change "Enable 32-Bit Applications" to "FALSE") in order to get the Web application along with RKM Client to execute properly as a 64-bit Web application.|
|Legacy Article ID||a56922|