Cjen1
Cjen1

Reputation: 1746

Can I run a C# application on a Raspberry Pi?

I'm working on a project that means that I will need a Raspberry Pi; however, I have very limited programming experience in Python or Lua.

Is it possible to run a program compiled in VS2013 using C# on a Raspberry Pi?

Upvotes: 5

Views: 17731

Answers (5)

mainmind83
mainmind83

Reputation: 589

You can install Windows 10 IoT: https://learn.microsoft.com/en-us/windows/iot-core/tutorials/rpi

Or supported Linux and last version of .NET or .NET Core https://www.raspberrypi.com/software/operating-systems/

Upvotes: 1

Quinch
Quinch

Reputation: 171

You can use VS2019 to compile your C# application to .NET Core 3.1. Once your application is compiled open the directory with the .csproj file in command promt. type in dotnet publish -c release -r linux-arm in command promt. put the compiled files onto the pi then open a terminal window on the py and type chmod u+x <YourProjectName> then ./<YourProjectName> Enjoy!

Upvotes: 6

Blazin potato
Blazin potato

Reputation: 44

Yes, although you have to use the mono framework to basically emulate .net, it works for most method calls but not all. Have a look at

http://logicalgenetics.com/raspberry-pi-and-mono-hello-world/

Upvotes: 2

Liath
Liath

Reputation: 10191

If you install the mono framework and follow their guidelines there's no reason your application won't run (obviously within the limits of the framework and hardware). There are quite a few resources on it. I've seen it done in a demo without too many problems.

Writing on the pi would be harder!

Upvotes: 0

Loofer
Loofer

Reputation: 6963

You can run Mono on your Pi, then develop in C# if you want.

http://www.raspberry-sharp.org/eric-bezine/2012/10/mono-framework/installing-mono-raspberry-pi/

Upvotes: 3

Related Questions