.NET gRPC Project

Create the Service

https://github.com/jfcarr/dotnet-iot-tui/tree/main/src/SenseHatGrpcProvider

Steps:

  1. Create the project, using grpc as the project type.
  2. Add a project reference to SenseHatLib.csproj
  3. Add .NET IoT bindings.
  4. Configure the project for remote access (in launchsettings.json)
  5. Update the protocol buffer file with sensor-specific request and response messages.
  6. Implement the service messages.

Service Startup

Open a terminal in the project directory and run:

dotnet run

If you want to start the service and leave it running in the background, add an ampersand to your command:

dotnet run &

Testing

We won't implement a tester as part of this discussion, but if you want to explore this further on your own, here are some options for implementing a gRPC test runner: