Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"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?

like image 985
Tony Liu Avatar asked Sep 05 '25 02:09

Tony Liu


1 Answers

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

like image 55
Tony Liu Avatar answered Sep 07 '25 23:09

Tony Liu