1

I was earlier using quickfix_net.dll and quickfix_net_messages.dll in my project. The project was build in Release mode and project properteis -> Platform Target was x86. When I tried to start my windows service which was having above project referenced then I got "An attempt was made to load a program with an incorrect format."

I searched on stackoverflow and most of suggestions were to use QuickFix/n as it is in native .NET and has no complication of c++ having to struggle with 64 bit OS etc

After migrating to QuickFix/n I assumed that Release mode build with and project properteis -> Platform Target to AnyCPU would work on my 64 bit 2008 server but I got same error "An attempt was made to load a program with an incorrect format."

When I changed project properteis -> Platform Target to x86 only then I was able to use QuickFix/n on my windows 2008 64 bit server.

All of my projects (i.e. dlls) are set to Platform Target to AnyCPU but only this specific dll which uses QuickFix/n need to set into x86.

Can anyone explain why the native .net QuickFix is not able to work with x64 (as my server is 64 bit) and why it is working when Target set to x86.

4

1 回答 1

0

确保在执行项目的属性中选中或取消选中“首选 32 位”。如果您的 QuickFix 库是用 32 位编译的,那么您需要选中“首选 32 位”框以防您针对 ANYCPU。这对我有用

于 2015-03-25T10:30:03.950 回答