The Story: My website runs in System.Data.OraceClient(I cannot change the dll due to various technical reasons). Now, I have an third party DLL integrated to my website which is 32 bit. When I run from Visual studio everything runs perfectly, but when I publish it to IIS, it throws the above error.
Now Solutions are: Enable 32 bit in IIS Application pool
When 32bit is enabled the Third party DLL will start to work and System.Data.Oracle client fails with BadImageFormat exception
Disable 32 bit in IIS Application pool.
When 32 bit is disabled System.Data.OracleClient
will start to work and the third party DLL will fail with the below error.
Retrieving the COM class factory for component with CLSID {xxxxx} failed due to the following error: xxxxxx Class not registered
-- This class is registered. That is why it works when 32 bit is enabled.
Now, I am in a situation only one dll will work at a time. Is there a workaround to make my System.Data.OracleClient run when 32Bit is enabled in Application pool without trying to migrate my entire application to Oracle Data Access?