Create First .NET Core application in Raspberry Pi with examples
In our previous articles Setting up Raspberry Pi – Step by step and Build .NET Core IoT App on Raspberry Pi we learned how to get started with Raspberry Pi and install the setup for .NET Core. In today’s article, we shall continue our journey and will learn how to use Raspberry Pi in .NET Core and create a simple “Hello World” application.
Today in this article, we will cover below aspects,
Prerequisites:
Create “Hello World” application
Remember since we have .NET Core SDK installed, we can now create a .NET Core app right within Raspberry Pi.
Let quickly check the .NET Core version on Pi,
dotnet --info
Please note that you might go out of space soon using Raspberry Pi. The easy approach would be to create, build, and compile the project on your LaptopDesktop and then copy it over to Pi. Once copied binaries can be executed on Raspberry Pi.
Let’s create a console application using the below command in a Raspberry Pi terminal window.
dontet new console
Above command shall add .csproj file and Program.cs file.
Add “Hello World” to the Main() method. and That’s all.
Let’s run our first .NET Core app using the below command,
dotnet run [app-path]
You shall see below on the terminal window.
That’s all! Enjoy coding!
Useful references :
Do you have any comments or ideas or any better suggestions to share?
Please sound off your comments below.
Happy Coding !!
Please bookmark this page and share it with your friends. Please Subscribe to the blog to receive notifications on freshly published(2024) best practices and guidelines for software design and development.
Thanks . I tried to follow the mentioned steps but got error – Unable to locate libunwind. Install libunwind to continue. Any idea if I m doing anything different.
Sorry Amida for the delay. Kindly visit the article to configure the raspberry step by step Setting up Raspberry Pi – Step by step