Simple C# application for Raspberry pi 3. Windows 10 IoT

If you want develop desktop application on C# for Raspberry PI, but don’t know how, then read below.

1.  Installing Windows 10 IoT.

First what you need to do, it’s download and install microsoft tool “Windows 10 IoT Core Dashboard” for burn MS Windows 10 IoT image to SD Card from microsoft web site and install it on your PC. After when installation successfully completed, connect your SD card to PC and run this tool.

On the left side in window tool choose “Setup new device” or “Настройка нового устроства” if your system language is Russian. Then choose from combobox “Device type” Raspberry Pi 2 & 3, from combobox “Assembly” choose “Windows 10 IoT Core” or if you like testing new features “Windows Insader Preview”, but be cearefull, preview version can work not how expecting. Choose your connected before SD card on “Disk” combobox. Change if needed defaulte device name and define password for administrator user accaunt. If needed you can setup wi-fi access point on this step, but if you skip this, you can easely setup it leater from IoT interface. Click on licensing checkbox and “Download and setup” button will available, press it and wait… at some moment system can ask you administrator password, input password and wait when operation will be seccessfuly completed.

2. Connect mouse, keyboard and monitor to your raspberry, insert SD card and power on.

During booting you can choose system language and setup Cortana if you like or skip this steps. After booting you can see on your screen something like this:

Find and click settings button for define your wi-fi access point.

3. Download C# examples for Visual Studio.

You can download a lot of source code examples for Windows 10 Iot from github.

4. Dedug “Hello World” example.

After downloaded examples from github, use MS Visual Studio 2017 or leater for run this solution: Windows-iotcore-samples-develop\Samples\HelloWorld\CS\HelloWorld.sln. This solution have only one Universal Windows Platform project. More details about this project type and other types you can find here and here.

For launch this project your Visual Studio can require some new components.

Install all them, but pay attention, installation can require a lot of disk space.

After installation start Visual Studio and open Hello World project again. During project open, you can see on screen automatically opened window “For developers” settings, if it is true, then switch radiobutton to “Developer mode”.  This operation may take some time.

Now go to Visual Studio and choose “Remote Machine” from Run combobox:

Type Raspberry ip address to “Address” textbox:

And press “Select” button.

Build project and run. You can see on connected to raspberry pi monitor running Hello World application.

Now you may developing projects on your PC and debug it remotely on Raspberry.

With this configuration i use bluetooth keyboard.

Bluetooth keyboard Raspberry pi3 Windows 10 IoT

Benefits: it’s very easy connection to raspberry without any problems and free usb ports (no need connecting mouse and keyboard). It can be use for simple operations, but for complicated work, like typing a lot of text not recomended.

Categories: C#

Leave a Comment