Search code examples
monoraspberry-pi3

"mono app.exe" gives error "File does not contain a valid CIL image."


I've made the following as a simple test.

using System;
namespace test
{
    class App
    {
        static void Main(string[] args)
        {
            Console.WriteLine("test");
            Console.ReadLine();
        }
    }
}

Then compiled and moved the entire bin folder to my pi and tried to run it using "mono app.exe" but I get the error in the title. How do I run compiled .Net core executables using mono on raspberry pi?


Solution

  • Realized that mono is .NET framework. I installed .NET core runtime and it worked. I followed this guide