Windows IoT - Visual Studio

"Free for individual developers, open source projects, academic research, education, and small professional teams."

On this page

Installing Visual Studio

With the 2015 edition, the free version of Visual Studio is now called Visual Studio Community. You can download the installer from the Visual Studio site.

When you select which options to install, make sure "Universal Windows App Development Tools" is included.

Now is also a good time to enable Developer Mode in Windows 10. To do this, open Settings from the Start menu, choose "Update & Security", select "For Developers" in the left bar, and change the selection to "Developer Mode". Confirm when asked.

Writing Your First Program

A good introduction to programming for Windows IoT is by writing a (very) simple program that displays some text on your Pi's screen. Start up Visual Studio if you haven't already.

Click the New Project button in the toolbar or select it from the File menu. Create a Blank Universal Windows App.

Create a blank Universal Windows App
Create a blank Universal Windows App in Visual Studio

Then open MainPage.xaml from the Solution Explorer on the right, and replace the <Grid></Grid> part with this:

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
	<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
		<TextBlock x:Name="lblMessage" Text="I am Pi" FontSize="64" />
	</StackPanel>
</Grid>

To test it on your desktop PC, just click the play button in the top toolbar, next to where it says "Local Machine".

To test it on your Pi, change the dropdown to the left of the play button to ARM, and the "Device" dropdown to "Remote Machine". A dialog will show that lets you choose the remote machine. Your Pi might show up under Auto Detected. If so, select it and ignore the warning about authentication.

If not, enter its IP address and select "None" as Authentication Mode. Clicking the play button will compile and deploy the app. After a while you should be able to see it on the screen connected to your Pi.

The result
The result you should see on the screen connected to your Pi

To stop it, click the stop button in the toolbar in Visual Studio

Deploying Your Program

In the Visual Studio top toolbar, switch from Debug to Release. Make sure ARM and the Remote Machine are still selected in the other dropdowns.

Selecting the right deploy options in the Visual Studio toolbar
Selecting the right deploy options in the Visual Studio toolbar

In the Build menu, first choose Build Solution to make sure everything compiles. When that's done, choose Deploy Solution. This might take a while.

From the Win IoT web interface (http://<IP address of your Pi>:8080), go to Apps in the left bar. Under "Installed Apps" DefaultApp will be selected. Change it to your app and click Start. This is also where you can set it to start by default.

Win IoT web interface - app selection
Your app might not have a nice name in this list but just a long ID (a GUID). It's probably the last one in the list with the ugly name.

Back

Back to Guides