diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index b2b20fe478..02505b0e07 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -22,7 +22,7 @@ jobs: with: submodules: true - name: Cache installers - uses: actions/cache@v2 + uses: actions/cache@v3 with: # Note: the cache path is relative to the workspace directory # https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action @@ -66,11 +66,11 @@ jobs: with: submodules: true - name: Setup .NET - uses: actions/setup-dotnet@v1 + uses: actions/setup-dotnet@v2 with: - dotnet-version: 3.1.x + dotnet-version: 6.x - name: Cache NuGet packages - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.nuget/packages @@ -83,6 +83,6 @@ jobs: - name: Build run: dotnet build --no-restore --verbosity=normal - name: Test - run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework "netcoreapp3.1" + run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework "net6.0" env: RABBITMQ_RABBITMQCTL_PATH: DOCKER:${{job.services.rabbitmq.id}} diff --git a/projects/Benchmarks/Benchmarks.csproj b/projects/Benchmarks/Benchmarks.csproj index 4d7ffbd508..1d0891f8c6 100644 --- a/projects/Benchmarks/Benchmarks.csproj +++ b/projects/Benchmarks/Benchmarks.csproj @@ -1,21 +1,20 @@ - + + net6.0;net472 Exe ../rabbit.snk true - netcoreapp3.1;net48 - 8.0 - - + + - + diff --git a/projects/RabbitMQ.Client/RabbitMQ.Client.csproj b/projects/RabbitMQ.Client/RabbitMQ.Client.csproj index 1f738fc412..f46d6ee29e 100644 --- a/projects/RabbitMQ.Client/RabbitMQ.Client.csproj +++ b/projects/RabbitMQ.Client/RabbitMQ.Client.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1;netstandard2.0 + netstandard2.0 $(NoWarn);CS1591 true RabbitMQ Client Library for .NET @@ -36,11 +36,6 @@ true - - - $(NoWarn);nullable - - $(MinVerMajor).$(MinVerMinor).$(MinVerPatch)-$(MinVerPreRelease)-pr.$(CONCOURSE_PULL_REQUEST_NUMBER) @@ -62,15 +57,12 @@ - - - - - - - - + + + + + diff --git a/projects/RabbitMQ.Client/client/impl/Connection.Commands.cs b/projects/RabbitMQ.Client/client/impl/Connection.Commands.cs index e0389186c5..78f8a7d3e1 100644 --- a/projects/RabbitMQ.Client/client/impl/Connection.Commands.cs +++ b/projects/RabbitMQ.Client/client/impl/Connection.Commands.cs @@ -170,7 +170,7 @@ private IAuthMechanismFactory GetAuthMechanismFactory(string supportedMechanismN // Our list is in order of preference, the server one is not. foreach (var factory in _config.AuthMechanisms) { - if (supportedMechanismNames.Contains(factory.Name, StringComparison.OrdinalIgnoreCase)) + if (supportedMechanismNames.IndexOf(factory.Name, StringComparison.OrdinalIgnoreCase) >= 0) { return factory; } diff --git a/projects/TestApplications/CreateChannel/CreateChannel.csproj b/projects/TestApplications/CreateChannel/CreateChannel.csproj index a3356ad2d1..157ff7d8f0 100644 --- a/projects/TestApplications/CreateChannel/CreateChannel.csproj +++ b/projects/TestApplications/CreateChannel/CreateChannel.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0;net472 diff --git a/projects/TestApplications/MassPublish/MassPublish.csproj b/projects/TestApplications/MassPublish/MassPublish.csproj index a3356ad2d1..157ff7d8f0 100644 --- a/projects/TestApplications/MassPublish/MassPublish.csproj +++ b/projects/TestApplications/MassPublish/MassPublish.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1 + net6.0;net472 diff --git a/projects/Unit/RabbitMQCtl.cs b/projects/Unit/RabbitMQCtl.cs index a311196c7a..8328038d05 100644 --- a/projects/Unit/RabbitMQCtl.cs +++ b/projects/Unit/RabbitMQCtl.cs @@ -43,6 +43,7 @@ namespace RabbitMQ.Client.Unit #nullable enable public static class RabbitMQCtl { + private static readonly char[] newLine = new char[] { '\n' }; private static readonly Func s_invokeRabbitMqCtl = GetRabbitMqCtlInvokeAction(); private static Func GetRabbitMqCtlInvokeAction() @@ -209,7 +210,8 @@ public static void CloseAllConnections() private static string[] EnumerateConnectionsPid() { - return ExecRabbitMQCtl("list_connections --silent pid").Split('\n', StringSplitOptions.RemoveEmptyEntries); + string rabbitmqCtlResult = ExecRabbitMQCtl("list_connections --silent pid"); + return rabbitmqCtlResult.Split(newLine, StringSplitOptions.RemoveEmptyEntries); } public static void RestartRabbitMQ() diff --git a/projects/Unit/TestChannelAllocation.cs b/projects/Unit/TestChannelAllocation.cs index df51ff8d8b..ed1ca99ff4 100644 --- a/projects/Unit/TestChannelAllocation.cs +++ b/projects/Unit/TestChannelAllocation.cs @@ -38,8 +38,6 @@ namespace RabbitMQ.Client.Unit { - - public class TestIModelAllocation : IDisposable { public const int CHANNEL_COUNT = 100; diff --git a/projects/Unit/Unit.csproj b/projects/Unit/Unit.csproj index 32e0b4fb6e..dcc0301893 100644 --- a/projects/Unit/Unit.csproj +++ b/projects/Unit/Unit.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net6.0;net472 ../rabbit.snk true latest @@ -13,15 +13,15 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/run-test.sh b/run-test.sh index c2a2146015..56db81db23 100755 --- a/run-test.sh +++ b/run-test.sh @@ -13,4 +13,4 @@ fi cd "$script_dir" -dotnet test --no-build --logger 'console;verbosity=detailed' --framework 'netcoreapp3.1' ./RabbitMQDotNetClient.sln < /dev/null +dotnet test --no-build --logger 'console;verbosity=detailed' --framework 'net6.0' ./RabbitMQDotNetClient.sln < /dev/null