how to run a VS2015 c++ console application on raspberry pi 2. I installed mono, copied the .exe file and try to run it. But it said "Cannot open assembly abc.exe: File does not contain a valid CIL image."

I am new to this method. I couldn't able to try with VisualGDB as my trail license got expired.

Is this method correct?

  • what does Mono a .NET compiler have to do with compiling an ARM C++ application? – Ramhound Aug 22 '15 at 3:29

Mono can only run .NET applications. C++ applications are usually compiled to native (x86) code for Windows.

Windows code can sometimes be run on Linux using Wine, burbthis only works if the architecture the program was compiled for is the same as the one Linux runs on. Because the Raspberry Pi has an ARM processor, Wine is not an option here.

Mono doesn't have this limitation because .NET apps aren't compiled to native code, but to bytecode for use with the .NET framework (like Java does). This means .NET code can run on almost any processor architecture because the byte code ian't processor dependend.

This is why Mono can only run .NET code. If Mono can't execute your program, this is because it was not compiled to .NET code (or you used a library that isn't implemented in Mono, but that's very unlikely in this scenario).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.