Tuesday, July 7, 2015

Running C# Programs on Your Pi

Have you ever wanted to create something awesome with your Pi, but not wanted to use Python? If so, you are in luck. We will be using Mono and GTK to run C# programs on your Pi.

Difficulty: Advanced
Time: 30 Minutes

You Will Need:

  • A way to access your Pi.
  • A way to transfer files to your Pi.
  • A Windows Computer

  1. Log in to your Pi and open the Terminal.
  2. You will need to install GTK and Mono. Use the following commands.
  3. sudo apt-get install mono-complete.
  4. sudo apt-get install gtk-sharp2.
  5. You are done with your Pi for right now.
  6. Now we will install MonoDevelop's Xamarin Studio. It is a C# editor like Visual studio, but it can use GTK, which is what you will need to run GUI programs on the Pi.
  7. To install it, go to their website. You will also need the .NET framework and GTK, which are also available on their website. Website Link Here.
  8. Once that is all set up. Run Xamarin Studio and start a new GTK project.

  1. Now that that's done, you can write a C# program as usual.
  2. Transfer the .exe file to your Pi.
  3. To run it, right click it and click Mono Runtime as the option to open it.
  4. You should see your program.

No comments:

Post a Comment