iotedge/samples
Damon Barry 7508ffc6ab
Upgrade to .NET 8 + latest LTS of IoT SDKs (#7262)
In preparation for v1.5, this change updates our C# code to .NET 8.0. It also updates our dependency on the IoT SDKs to the latest LTS versions (Microsoft.Azure.Devices.Client 1.36.10, Microsoft.Azure.Devices 1.31.6).

I had to upgrade our dependency on Azure.Storage.Blobs because the device SDK upgraded theirs. This required that I upgrade the code in Edge Agent and some test modules to use newer storage blob libraries that aren't deprecated. I did local testing of the Edge Agent code to ensure that the new calls work as expected.

I updated the buildBranch.sh and runTests.sh scripts. buildBranch.sh was building two different ways: (1) it was doing a standard build of all .NET components from the repo root (`dotnet build -c Release`), and (2) it was publishing each "app" in a manner suitable for including in Docker images. I simplified it to just focus on the second scenario. For the first, I updated dotnet.yaml to call `dotnet test` directly. I simplified runTests.sh to use `dotnet test` instead of `dotnet vstest` (which is being deprecated) because `dotnet test` now supports running pre-built binaries instead of always building the binaries itself. Note that `dotnet test` apparently doesn't support some of the parallelization features that vstest did, but the time difference is minimal and the script logic is vastly simplified.

I updated EdgeHubTriggerCsharp.csproj to specify its own TargetFramework property, rather than including netcoreappVersion.props, because it has dependedencies that don't yet support .NET 8.

I successfully ran the CI Build pipeline with these changes. To test, I ran the end-to-end tests, nested end-to-end tests, connectivity tests, and ISA-95 smoke tests against the new bits.

## Azure IoT Edge PR checklist:
2024-04-12 00:03:54 +00:00
..
dotnet Upgrade to .NET 8 + latest LTS of IoT SDKs (#7262) 2024-04-12 00:03:54 +00:00