.NET Core on IoT: Overview
dotnetcoreiot csharp dnetcore appdev rpi iot-core raspbian iothub azure device service streaming devicestreaming telemetry
This is a set of articles about developing and running .NET Core apps on the Raspberry Pi whether running Win 10 IoT-Core or Raspbian. This article sets the scene for these articles.
.NET is a Framework (.NET Framework) of APIs, runtime components and development tools first announced by Microsoft in 2000. .NET Framework has evolved since then but only runs on Windows devices. Mono is an Open Source implementation of .NET, runs on a much wider variety of systems, and is designed to allow developers to create cross platform .NET applications. It runs on macOS, Linux, Windows and is used with Xamarin for mobile apps .NET Standard is a formal specification of .NET APIs that are intended to be available on all .NET implementations. Whilst you can create and build .NET Standard libraries tough, there isn’t a runtime included (repeat, it is only a standard) and so they need to be built and linked to a runtime such as .NET Framework, Mono, or .NET Core. .NET Core is a Cross-platform framework of .NET and runs across a range of operating system and processors (including x64, x86, and ARM). A project without any platform specifics can be built, deployed and run on all .NET Core platforms. It includes, runtimes, command-line tools and has simple deployment (file copy is enough). .NET Core is Open Source and is supported by Microsoft.
On a desktop, app development requires coding, then you build and run it. The app’s API development tools (framework SDKs) need to be installed on the development machine. For general deployment, you require the built app and libraries as well as the framework runtime resources. Alternatively, you can cross compile for another targeted system and remotely deploy to the target, remotely. With the various versions of .NET, at a minimum, you need the relevant Framework SDKs installed. The build and run can then be command line actions. The SDK includes the runtime components for the framework that need to be deployed with the app when it is deployed. You can also use Visual Studio or VS Code, but these still use the same underlying Framework SDK tools. Whilst VS and VS Code can be installed on Linux and MacOS, .NET Framework apps can only run on a Windows device with the Framework installed for which the app was built. VS for Mac contains Mono tools and so can build Mono apps for macOS. Xamarin (including on Windows), can use Mono as its .NET framework for IOS and Android app. Development. (.NET Core is now an option for these).
.NET Core apps though can run on a variety of OS systems and be built there as well. .NET Core will run on Windows, Raspbian, Linux and macOS. .NET Core apps can be built with command line tools, VS or VS Code. For remote systems, when using Visual Studio, you can do a targeted build and publish to a folder that can simply be copied and pasted to the target system; no installation mechanism is required. Hint: You can simply publish to a File Share on the target. The folder can be a larger complete folder (and therefore targeted) with all of the components necessary so that it can run on a system that does not have .NET Core installed. Alternatively, you can create a smaller “Framework Dependant” package that will run only on any supported OS, that has .NET Core installed.
For IoT devices such as Windows 10 IoT-Core and Raspbian, where .NET Core previously could not be installed, the complete, targeted folder copy method was the only option. You could not deploy and debug .NET Core to these devices directly from previous versions of VS as you can with some other app types. (For example, you could always deploy and debug UWP apps to IoT-Core for all recent versions of VS). With .NET Core 3 (which is now out of Preview) it just got simpler. You can do in situ command line builds on those devices. Also, Visual Studio version 16.3 supports .NET Core 3 out of the box from which you now can remotely deploy and debug a .NET Core 3 app to Win 10 IoT-Core and RPI Raspian.
About these articles
These articles are about being able to develop .NET Core IoT apps that will seamlessly run from the same code on IoT devices running Windows 10 IoT-Core, Raspbian and Linux on ARM and x86/64 architectures. As a starting point, the focus is upon using IoT-Core and Raspbian running on the Raspberry Pi with the same code as much as is possible. It is intended that the code authoring not be on the device, but the build and initiation of the app execution can be from a command line on the device once the app project has been copied to the device. Ideally the app will have GPIO access, which may result in target specific options to implement that. Debugging is desirable. As a starter, the options for developing .NET Core apps in general will be looked at using .NET Core 3.x command line SDK tools as well as the Visual Studio 16.3+ and Visual Studio Code contexts.
|Next: >||.NET Core on IoT||Quickstart Apps|
|< Prev:||AzureAdventCalendar||Azure IoT Hub Super Quickstart in 5 minutes!|
|This Category:||.NET Core on IoT|
|Next: >||.NET Core on IoT|