I wrote with VS10 the following projects:
The compilation (x64 for each of the three projects) is ok, and the program works on my pc (Windows 7 64bit). I tested the program on some other computers (all Windows 7 64bit) and I noted that:
I think the problem is that some boost Dll is missing. Am I right? Or the problem could be related to VS?
edit:
I have to mention that the structure of the program is the following:
Also, when I get the error, the main form correctly loads and the parameters could be set. The error happens when the backgroundworker starts his work (calling the C++ DLL).
So I'm quite sure that there is no problem with the framework installation.
Update:
It turns out that I forgot to include some DLLs in the setup project. Now, including them the error changed.
Now, at the same point as before (and on the same computers) I get another error:
BadImageFormatException: An attempt was made to load a program with an incorrect format
I read this article, but I have set x64 in both C# project and in C++ DLL and the setup project has as TargetPlatform x64. Any idea?
I finally found the solution!
The C++ DLL needs the mpfr library for multiple precision floating point computations with correct rounding.
I was including (shame on me!) the incorrect version of the library (x86) and this was the motivation for the error:
BadImageFormatException: An attempt was made to load a program with an incorrect format
Then in all the computers (three different computers!) in which the program was ok there were both (unlucky and misleading coincidence):
Including the right version of the library in the Setup Project fixed the problem. Thanks to Kamil Klimek, Stephane Rolland and Mr.C64 for their precious suggestions.