Ever since I rewrote my ‘Synch’ tool I got some complaints from people that they could no longer run it. All they got was a cryptic message ‘Unable to execute file’.
At first I thought they were just missing the C++ runtime libraries, so I gave them the advice them to install the Visual C++ 8.0 runtime. But they still reported the same problem. So I started enquiring a bit of more background information on their systems.
After some research I found out that only system that did not have the .Net runtime version 2 installed gave this error. But this was strange since the program was native C++. I hadn’t used any .Net classes or libraries. I even compiled it with the option ‘Windows libraries only’.
It took me quite a bit of time to finally figure out that the bastards at Microsoft compile with .Net support by default. So if you include the AFX libraries (which is what I did for some API calls) .Net is automatically included for some reason. I only had the problem with this version since I switched from Visual Studio 2003 to Visual Studio 2005.
And sure after I reverted all projects to Visual Studio 2003 and gave the new program to the people that reported the problem they were able to run it again. So in short Visual Studio 2005 is great for people not developing C++ code.
Using visual studio 2005 means you are bound to include .Net libraries with all your projects, which is something I don’t want for basic console applications!!!! Guess I will be sticking with 2003 for the next couple of decades.