Azure / iotedge

The IoT Edge OSS project
MIT License
1.45k stars 457 forks source link

Upgrade to .NET 8 + latest LTS of IoT SDKs #7262

Closed damonbarry closed 3 months ago

damonbarry commented 3 months ago

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:

This checklist is used to make sure that common guidelines for a pull request are followed.

General Guidelines and Best Practices

Testing Guidelines

yophilav commented 3 months ago

FYI, the long haul test still looking good after 25h.

damonbarry commented 3 months ago

[like] Damon Barry reacted to your message:


From: yophilav @.> Sent: Thursday, April 11, 2024 9:57:10 PM To: Azure/iotedge @.> Cc: Damon Barry @.>; Author @.> Subject: Re: [Azure/iotedge] Upgrade to .NET 8 + latest LTS of IoT SDKs (PR #7262)

FYI, the long haul test still looking good after 25h.

— Reply to this email directly, view it on GitHubhttps://github.com/Azure/iotedge/pull/7262#issuecomment-2050626680, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ACE7UJJ4JTAIJPCYYIBVEL3Y44BLNAVCNFSM6AAAAABF7C275CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANJQGYZDMNRYGA. You are receiving this because you authored the thread.Message ID: @.***>