Before starting development on the Azure IoT SDK for C# you will need to install a few frameworks and tools. Please follow the instructions within devbox_setup.
Please read and apply our coding style when proposing PRs against the Azure repository.
git clone https://github.com/Azure/azure-iot-sdk-csharp.git
- Windows:
build.cmd
- Linux:
./build.sh
For more information on running more complex scenarios (like e2e or stress testing) please add the -h
argument to the build command.
During development you can use Visual Studio by loading the azureiot.sln
solution.
If you are using a different editor, you can use the dotnet
CLI to build (in Windows, Linux or OSX). Here are a few commands. For a complete list see the .NET Core CLI tools
- Build a library csproj:
dotnet build
- Run tests from a test csproj:
dotnet test
- Run an application from a csproj (e.g. a sample):
dotnet run
Our NuGet-packaged SDK can be used certain ARM32-based devices. Since the .NET SDKs are not available on this platform, you will need to cross-compile your application.
Instructions are available here: https://github.com/dotnet/core/blob/master/samples/RaspberryPiInstructions.md
Please follow the devbox-setup "Optional Setup" for Xamarin before trying to build. To build and test, run the following Jenkins script from the root of the repository:
jenkins\windows_csharp_xamarin.cmd
Please follow the [devbox-setup][devbox_setup.md] "Optional Setup" for .NET Micro Framework before trying to build. To build and test, run the following Jenkins script from the root of the repository:
jenkins\windows_csharp_mf.cmd
Before being able to run our tests, please make sure you read, modify if necessary and run the scripts within the /test/prerequisites
folders. (e.g. e2e/test/prerequisites
and iothub/service/test/prerequisites
).
The CI system will run the jenkins
scripts from the root folder. (e.g. jenkins\windows_csharp.cmd
).
Testing requires an Azure subscription and IoT Hub and Provisioning services.
The build
command will always try to produce packages and place them within bin\pkg
.
Please see build -h
for instructions on how to set up a local NuGet source and run the e2e tests against the packages instead of the .dll binaries.
Contains development instructions for building and changing the Azure IoT SDK for C#.
If you would like to develop an application using the Azure IoT SDK for C# (using pre-built binaries), please follow the dev-guide here: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-sdks
Contains the IoT Hub Device SDK source, unit-tests and samples.
This produces the Microsoft.Azure.Devices.Client
NuGet package.
The src.NetMF folder contains the .NET Microframework port.
Contains the IoT Hub Service SDK source, unit-tests and samples.
This produces the Microsoft.Azure.Devices
NuGet package.
Contains the Provisioning Device SDK source, unit-tests and samples.
This produces the Microsoft.Azure.Devices.Provisioning.Client
NuGet package.
Contains the Provisioning Device SDK transport libraries source and unit-tests.
/http
produces the Microsoft.Azure.Devices.Provisioning.Transport.Http
NuGet package.
/amqp
produces the Microsoft.Azure.Devices.Provisioning.Transport.Amqp
NuGet package.
/mqtt
produces the Microsoft.Azure.Devices.Provisioning.Transport.Mqtt
NuGet package.
Contains the Provisioning Service SDK source, unit-tests and samples.
This produces the Microsoft.Azure.Devices.Provisioning.Service
NuGet package.
Contains the SecurityProvider components for Hardware Security Modules.
/tpm
produces the Microsoft.Azure.Devices.Provisioning.Security.Tpm
NuGet package.
This contains public API shared across the SDK components.
This produces the Microsoft.Azure.Devices.Shared
NuGet package.
Contains common code shared between multiple components. This doesn't generate a separate library and instead may get built-in more than one library.
/test
contains end-to-end tests run before each PR integration by our internal CI system.
/stress
contains SDK stress-test applications.
Contains scripts used by our internal Continuous Integration system (Jenkins).
/DeviceExplorer
contains the source code for the Azure IoT Device Explorer tool. Please see further dev documentation within this folder on how to build and debug.
/CaptureLogs
contains scripts for capturing SDK traces.