System.OutOfMemoryException When Compiling Code With a COM Component in 32 bit and Using On a 64 bit System
My code works fine on a 32 bit s开发者_JS百科ystem. I am simply referencing a COM component that reads/writes xml. So, I tried compiling in 'X86' and then running on a 64 bit system when I received the error below.
The following exception occurred: System.OutOfMemoryException: Creating an instance of the COM component with CLSID {59D5FDED-B01B-47F4-BBBC-56941A2F4873} from the IClassFactory failed due to the following error: 8007000e.
Random suggestions:
- Attach debugger as native and see if there are interesting native exceptions.
- Try to make your exe "not large memory space aware".
- Verify if app loads as 32 bit one.
- Try to create the component with native code to verify it is properly installed on the system.
Note: if your COM component uses MSXML to work with XML loading it into managed application is not supported due to incomaptibilities between memory management. It is unlikely to be cause problem you are seeing, but more for general reference.
For me this was happening because the C++ COM Component was calling a C# library and not handling the exception it raised.
精彩评论