From 1b0061695145b9fd8c9742de66f9aecde9905e36 Mon Sep 17 00:00:00 2001 From: Chad Retz Date: Tue, 11 Jun 2024 10:32:39 -0500 Subject: [PATCH] Update to .NET 8 (#71) --- .github/workflows/ci.yml | 2 +- Directory.Build.props | 2 +- README.md | 2 +- src/Encryption/Codec/EncryptionCodec.cs | 4 ++-- src/WorkerSpecificTaskQueues/Program.cs | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ff9758..9d77145 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,7 +29,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v4 with: - dotnet-version: 7 + dotnet-version: 8 - name: Build run: dotnet build diff --git a/Directory.Build.props b/Directory.Build.props index 7dc1113..59f801a 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -13,7 +13,7 @@ enable MIT https://github.com/temporalio/samples-dotnet - net7.0 + net8.0 true 0.1.0 diff --git a/README.md b/README.md index 976099f..cd6234d 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is the set of .NET samples for the [.NET SDK](https://github.com/temporalio Prerequisites: -* .NET >= 6 +* .NET 8 * [Local Temporal server running](https://docs.temporal.io/application-development/foundations#run-a-development-cluster) ## Samples diff --git a/src/Encryption/Codec/EncryptionCodec.cs b/src/Encryption/Codec/EncryptionCodec.cs index feb8d9f..f8807c8 100644 --- a/src/Encryption/Codec/EncryptionCodec.cs +++ b/src/Encryption/Codec/EncryptionCodec.cs @@ -71,7 +71,7 @@ private byte[] Encrypt(byte[] data) RandomNumberGenerator.Fill(nonceSpan); // Perform encryption - using (var aes = new AesGcm(key)) + using (var aes = new AesGcm(key, TagSize)) { aes.Encrypt(nonceSpan, data, bytes.AsSpan(NonceSize + TagSize), bytes.AsSpan(NonceSize, TagSize)); return bytes; @@ -82,7 +82,7 @@ private byte[] Decrypt(byte[] data) { var bytes = new byte[data.Length - NonceSize - TagSize]; - using (var aes = new AesGcm(key)) + using (var aes = new AesGcm(key, TagSize)) { aes.Decrypt( data.AsSpan(0, NonceSize), data.AsSpan(NonceSize + TagSize), data.AsSpan(NonceSize, TagSize), bytes.AsSpan()); diff --git a/src/WorkerSpecificTaskQueues/Program.cs b/src/WorkerSpecificTaskQueues/Program.cs index 9ca9f9e..776e8fe 100644 --- a/src/WorkerSpecificTaskQueues/Program.cs +++ b/src/WorkerSpecificTaskQueues/Program.cs @@ -49,7 +49,7 @@ async Task RunWorkerAsync() { try { - tokenSource.Cancel(); + await tokenSource.CancelAsync(); await Task.WhenAll(tasks); } catch (Exception ex)