Skip to content

Commit b6884c5

Browse files
authored
Merge pull request #1189 from rabbitmq/rabbitmq-dotnet-client-1172
Ensure target frameworks make sense for 7.0
2 parents 08d4417 + f18c719 commit b6884c5

File tree

13 files changed

+93
-89
lines changed

13 files changed

+93
-89
lines changed

.github/workflows/main.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
with:
2323
submodules: true
2424
- name: Cache installers
25-
uses: actions/cache@v2
25+
uses: actions/cache@v3
2626
with:
2727
# Note: the cache path is relative to the workspace directory
2828
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action
@@ -66,11 +66,11 @@ jobs:
6666
with:
6767
submodules: true
6868
- name: Setup .NET
69-
uses: actions/setup-dotnet@v1
69+
uses: actions/setup-dotnet@v2
7070
with:
71-
dotnet-version: 3.1.x
71+
dotnet-version: 6.x
7272
- name: Cache NuGet packages
73-
uses: actions/cache@v2
73+
uses: actions/cache@v3
7474
with:
7575
path: |
7676
~/.nuget/packages
@@ -83,6 +83,6 @@ jobs:
8383
- name: Build
8484
run: dotnet build --no-restore --verbosity=normal
8585
- name: Test
86-
run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework "netcoreapp3.1"
86+
run: dotnet test --no-restore --no-build --logger "console;verbosity=detailed" --framework "net6.0"
8787
env:
8888
RABBITMQ_RABBITMQCTL_PATH: DOCKER:${{job.services.rabbitmq.id}}

projects/Benchmarks/Benchmarks.csproj

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<TargetFrameworks>net6.0;net472</TargetFrameworks>
45
<OutputType>Exe</OutputType>
56
<AssemblyOriginatorKeyFile>../rabbit.snk</AssemblyOriginatorKeyFile>
67
<SignAssembly>true</SignAssembly>
7-
<TargetFrameworks>netcoreapp3.1;net48</TargetFrameworks>
8-
<ReleaseVersion>8.0</ReleaseVersion>
98
</PropertyGroup>
109

1110
<ItemGroup>
12-
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
13-
<PackageReference Include="Ductus.FluentDocker" Version="2.7.3" />
11+
<PackageReference Include="BenchmarkDotNet" Version="0.13.1" />
12+
<PackageReference Include="Ductus.FluentDocker" Version="2.10.45" />
1413
</ItemGroup>
1514

1615
<ItemGroup>
1716
<ProjectReference Include="..\RabbitMQ.Client\RabbitMQ.Client.csproj" />
18-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
17+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
1918
</ItemGroup>
2019

2120
</Project>

projects/RabbitMQ.Client/RabbitMQ.Client.csproj

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>netcoreapp3.1;netstandard2.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;netstandard2.0</TargetFrameworks>
55
<NoWarn>$(NoWarn);CS1591</NoWarn>
66
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
77
<AssemblyTitle>RabbitMQ Client Library for .NET</AssemblyTitle>
@@ -36,11 +36,6 @@
3636
<Deterministic>true</Deterministic>
3737
</PropertyGroup>
3838

39-
<!-- disable nullable warnings for .NET Standard 2.0 -->
40-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
41-
<NoWarn>$(NoWarn);nullable</NoWarn>
42-
</PropertyGroup>
43-
4439
<Target Name="SetVersionFromConcourseData" AfterTargets="MinVer" Condition="'$(CONCOURSE_PULL_REQUEST_NUMBER)' != ''">
4540
<PropertyGroup>
4641
<PackageVersion>$(MinVerMajor).$(MinVerMinor).$(MinVerPatch)-$(MinVerPreRelease)-pr.$(CONCOURSE_PULL_REQUEST_NUMBER)</PackageVersion>
@@ -62,15 +57,12 @@
6257
</ItemGroup>
6358

6459
<ItemGroup>
65-
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
66-
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All" />
67-
<PackageReference Include="MinVer" Version="2.4.0" PrivateAssets="All" />
68-
<PackageReference Include="System.Threading.Channels" Version="5.0.0" />
69-
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3" PrivateAssets="All" />
70-
</ItemGroup>
71-
72-
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
60+
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="6.0.0" PrivateAssets="All" />
61+
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.2" PrivateAssets="All" />
62+
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
63+
<PackageReference Include="MinVer" Version="3.1.0" PrivateAssets="All" />
7364
<PackageReference Include="System.Memory" Version="4.5.4" />
65+
<PackageReference Include="System.Threading.Channels" Version="6.0.0" />
7466
</ItemGroup>
7567

7668
</Project>

projects/RabbitMQ.Client/client/impl/Connection.Commands.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ private IAuthMechanismFactory GetAuthMechanismFactory(string supportedMechanismN
170170
// Our list is in order of preference, the server one is not.
171171
foreach (var factory in _config.AuthMechanisms)
172172
{
173-
if (supportedMechanismNames.Contains(factory.Name, StringComparison.OrdinalIgnoreCase))
173+
if (supportedMechanismNames.IndexOf(factory.Name, StringComparison.OrdinalIgnoreCase) >= 0)
174174
{
175175
return factory;
176176
}

projects/TestApplications/CreateChannel/CreateChannel.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFrameworks>net6.0;net472</TargetFrameworks>
66
</PropertyGroup>
77

88
<ItemGroup>

projects/TestApplications/MassPublish/MassPublish.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>netcoreapp3.1</TargetFramework>
5+
<TargetFrameworks>net6.0;net472</TargetFrameworks>
66
</PropertyGroup>
77

88
<ItemGroup>

projects/Unit/Fixtures.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ public class TimingFixture
423423
{
424424
public static readonly TimeSpan TimingInterval = TimeSpan.FromMilliseconds(300);
425425
public static readonly TimeSpan TimingInterval_2X = TimeSpan.FromMilliseconds(600);
426+
public static readonly TimeSpan TimingInterval_4X = TimeSpan.FromMilliseconds(1200);
426427
public static readonly TimeSpan SafetyMargin = TimeSpan.FromMilliseconds(150);
427428
public static readonly TimeSpan TestTimeout = TimeSpan.FromSeconds(5);
428429
}

projects/Unit/RabbitMQCtl.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ namespace RabbitMQ.Client.Unit
4343
#nullable enable
4444
public static class RabbitMQCtl
4545
{
46+
private static readonly char[] newLine = new char[] { '\n' };
4647
private static readonly Func<string, Process> s_invokeRabbitMqCtl = GetRabbitMqCtlInvokeAction();
4748

4849
private static Func<string, Process> GetRabbitMqCtlInvokeAction()
@@ -209,7 +210,8 @@ public static void CloseAllConnections()
209210

210211
private static string[] EnumerateConnectionsPid()
211212
{
212-
return ExecRabbitMQCtl("list_connections --silent pid").Split('\n', StringSplitOptions.RemoveEmptyEntries);
213+
string rabbitmqCtlResult = ExecRabbitMQCtl("list_connections --silent pid");
214+
return rabbitmqCtlResult.Split(newLine, StringSplitOptions.RemoveEmptyEntries);
213215
}
214216

215217
public static void RestartRabbitMQ()

projects/Unit/TestBlockingCell.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public void TestBackgroundUpdateSucceedsWithInfiniteTimeoutTimeSpan()
164164
public void TestBackgroundUpdateFails()
165165
{
166166
var k = new BlockingCell<int>();
167-
SetAfter(TimingInterval_2X, k, 123);
167+
SetAfter(TimingInterval_4X, k, 123);
168168

169169
ResetTimer();
170170
Assert.Throws<TimeoutException>(() => k.WaitForValue(TimingInterval));

projects/Unit/TestChannelAllocation.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@
3838

3939
namespace RabbitMQ.Client.Unit
4040
{
41-
42-
4341
public class TestIModelAllocation : IDisposable
4442
{
4543
public const int CHANNEL_COUNT = 100;

0 commit comments

Comments
 (0)