diff --git a/Source/MQTTnet.AspnetCore/Client/Tcp/TcpConnection.cs b/Source/MQTTnet.AspnetCore/Client/Tcp/TcpConnection.cs index 0dbe161..7814567 100644 --- a/Source/MQTTnet.AspnetCore/Client/Tcp/TcpConnection.cs +++ b/Source/MQTTnet.AspnetCore/Client/Tcp/TcpConnection.cs @@ -40,7 +40,7 @@ namespace MQTTnet.AspNetCore.Client.Tcp _sender = new SocketSender(_socket, PipeScheduler.ThreadPool); _receiver = new SocketReceiver(_socket, PipeScheduler.ThreadPool); } -#if NETCOREAPP3_1 +#if NETCOREAPP3_1 || NET5_0 public override ValueTask DisposeAsync() #else public Task DisposeAsync() @@ -53,7 +53,7 @@ namespace MQTTnet.AspNetCore.Client.Tcp _socket?.Dispose(); -#if NETCOREAPP3_1 +#if NETCOREAPP3_1 || NET5_0 return base.DisposeAsync(); } diff --git a/Source/MQTTnet.AspnetCore/Extensions/ConnectionRouteBuilderExtensions.cs b/Source/MQTTnet.AspnetCore/Extensions/ConnectionRouteBuilderExtensions.cs index 2736fce..0595b98 100644 --- a/Source/MQTTnet.AspnetCore/Extensions/ConnectionRouteBuilderExtensions.cs +++ b/Source/MQTTnet.AspnetCore/Extensions/ConnectionRouteBuilderExtensions.cs @@ -12,6 +12,7 @@ namespace MQTTnet.AspNetCore.Extensions #if NETCOREAPP3_1 [Obsolete("This class is obsolete and will be removed in a future version. The recommended alternative is to use MapMqtt inside Microsoft.AspNetCore.Builder.UseEndpoints(...).")] #endif +#if NETCOREAPP3_1 || NETCOREAPP2_1 || NETSTANDARD public static void MapMqtt(this ConnectionsRouteBuilder connection, PathString path) { connection.MapConnectionHandler(path, options => @@ -19,5 +20,6 @@ namespace MQTTnet.AspNetCore.Extensions options.WebSockets.SubProtocolSelector = MqttSubProtocolSelector.SelectSubProtocol; }); } +#endif } } diff --git a/Source/MQTTnet.AspnetCore/Extensions/EndpointRouterExtensions.cs b/Source/MQTTnet.AspnetCore/Extensions/EndpointRouterExtensions.cs index d2a2805..7cbed8c 100644 --- a/Source/MQTTnet.AspnetCore/Extensions/EndpointRouterExtensions.cs +++ b/Source/MQTTnet.AspnetCore/Extensions/EndpointRouterExtensions.cs @@ -1,5 +1,5 @@  -#if NETCOREAPP3_1 +#if NETCOREAPP3_1 || NET5_0 using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; diff --git a/Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj b/Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj index 3c9cd22..f2a891d 100644 --- a/Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj +++ b/Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj @@ -1,7 +1,7 @@  - netstandard2.0;netcoreapp2.1;netcoreapp3.1 + netstandard2.0;netcoreapp2.1;netcoreapp3.1;net5.0 @@ -21,11 +21,11 @@ RELEASE;NETSTANDARD2_0 - + - + diff --git a/Source/MQTTnet.Extensions.ManagedClient/MQTTnet.Extensions.ManagedClient.csproj b/Source/MQTTnet.Extensions.ManagedClient/MQTTnet.Extensions.ManagedClient.csproj index 016fd0e..c07aa15 100644 --- a/Source/MQTTnet.Extensions.ManagedClient/MQTTnet.Extensions.ManagedClient.csproj +++ b/Source/MQTTnet.Extensions.ManagedClient/MQTTnet.Extensions.ManagedClient.csproj @@ -1,7 +1,7 @@  - netstandard1.3;netstandard2.0;netstandard2.1 + netstandard1.3;netstandard2.0;netstandard2.1;net5.0 $(TargetFrameworks);net452;net461 $(TargetFrameworks);uap10.0 diff --git a/Source/MQTTnet.Extensions.Rpc/MQTTnet.Extensions.Rpc.csproj b/Source/MQTTnet.Extensions.Rpc/MQTTnet.Extensions.Rpc.csproj index 016fd0e..c07aa15 100644 --- a/Source/MQTTnet.Extensions.Rpc/MQTTnet.Extensions.Rpc.csproj +++ b/Source/MQTTnet.Extensions.Rpc/MQTTnet.Extensions.Rpc.csproj @@ -1,7 +1,7 @@  - netstandard1.3;netstandard2.0;netstandard2.1 + netstandard1.3;netstandard2.0;netstandard2.1;net5.0 $(TargetFrameworks);net452;net461 $(TargetFrameworks);uap10.0 diff --git a/Source/MQTTnet.Extensions.WebSocket4Net/MQTTnet.Extensions.WebSocket4Net.csproj b/Source/MQTTnet.Extensions.WebSocket4Net/MQTTnet.Extensions.WebSocket4Net.csproj index e5bb3be..bd6fbb9 100644 --- a/Source/MQTTnet.Extensions.WebSocket4Net/MQTTnet.Extensions.WebSocket4Net.csproj +++ b/Source/MQTTnet.Extensions.WebSocket4Net/MQTTnet.Extensions.WebSocket4Net.csproj @@ -1,7 +1,7 @@  - netstandard1.3;netstandard2.0;netstandard2.1 + netstandard1.3;netstandard2.0;netstandard2.1;net5.0 $(TargetFrameworks);net452;net461 $(TargetFrameworks);uap10.0 diff --git a/Source/MQTTnet.Server/MQTTnet.Server.csproj b/Source/MQTTnet.Server/MQTTnet.Server.csproj index 8001c80..337a063 100644 --- a/Source/MQTTnet.Server/MQTTnet.Server.csproj +++ b/Source/MQTTnet.Server/MQTTnet.Server.csproj @@ -1,7 +1,7 @@ - netcoreapp3.1 + netcoreapp3.1;net5.0 InProcess MQTTnet.Server MQTTnet.Server @@ -41,11 +41,18 @@ - + + + + + + + + diff --git a/Source/MQTTnet/Diagnostics/TargetFrameworkProvider.cs b/Source/MQTTnet/Diagnostics/TargetFrameworkProvider.cs index 82d133e..a5e181d 100644 --- a/Source/MQTTnet/Diagnostics/TargetFrameworkProvider.cs +++ b/Source/MQTTnet/Diagnostics/TargetFrameworkProvider.cs @@ -22,6 +22,8 @@ return "uap10.0"; #elif NETCOREAPP3_1 return "netcoreapp3.1"; +#elif NET5_0 + return "net5.0"; #endif } } diff --git a/Source/MQTTnet/MQTTnet.csproj b/Source/MQTTnet/MQTTnet.csproj index 66b39fa..42989f3 100644 --- a/Source/MQTTnet/MQTTnet.csproj +++ b/Source/MQTTnet/MQTTnet.csproj @@ -1,7 +1,7 @@  - netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.1 + netstandard1.3;netstandard2.0;netstandard2.1;netcoreapp3.1;net5.0 $(TargetFrameworks);net452;net461 $(TargetFrameworks);uap10.0 MQTTnet diff --git a/Tests/MQTTnet.AspNetCore.Tests/MQTTnet.AspNetCore.Tests.csproj b/Tests/MQTTnet.AspNetCore.Tests/MQTTnet.AspNetCore.Tests.csproj index e743b97..24efb9b 100644 --- a/Tests/MQTTnet.AspNetCore.Tests/MQTTnet.AspNetCore.Tests.csproj +++ b/Tests/MQTTnet.AspNetCore.Tests/MQTTnet.AspNetCore.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net461 + netcoreapp3.1;net461;net5.0 false diff --git a/Tests/MQTTnet.Benchmarks/MQTTnet.Benchmarks.csproj b/Tests/MQTTnet.Benchmarks/MQTTnet.Benchmarks.csproj index e4c8e2f..7551874 100644 --- a/Tests/MQTTnet.Benchmarks/MQTTnet.Benchmarks.csproj +++ b/Tests/MQTTnet.Benchmarks/MQTTnet.Benchmarks.csproj @@ -3,16 +3,23 @@ Exe Full - net461;netcoreapp2.1 + net461;netcoreapp2.1;net5.0 netcoreapp2.1 7.2 - + + + + + + + + diff --git a/Tests/MQTTnet.Core.Tests/MQTTnet.Tests.csproj b/Tests/MQTTnet.Core.Tests/MQTTnet.Tests.csproj index 398a8b8..63244d6 100644 --- a/Tests/MQTTnet.Core.Tests/MQTTnet.Tests.csproj +++ b/Tests/MQTTnet.Core.Tests/MQTTnet.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp3.1;net461 + netcoreapp3.1;net461;net5.0 false diff --git a/Tests/MQTTnet.TestApp.AspNetCore2/MQTTnet.TestApp.AspNetCore2.csproj b/Tests/MQTTnet.TestApp.AspNetCore2/MQTTnet.TestApp.AspNetCore2.csproj index b060967..8b5428b 100644 --- a/Tests/MQTTnet.TestApp.AspNetCore2/MQTTnet.TestApp.AspNetCore2.csproj +++ b/Tests/MQTTnet.TestApp.AspNetCore2/MQTTnet.TestApp.AspNetCore2.csproj @@ -1,7 +1,7 @@  - net461;netcoreapp2.1;netcoreapp3.1 + net461;netcoreapp2.1;netcoreapp3.1;net5.0 Latest diff --git a/Tests/MQTTnet.TestApp.AspNetCore2/Startup.cs b/Tests/MQTTnet.TestApp.AspNetCore2/Startup.cs index 9a240f5..6eb8bfb 100644 --- a/Tests/MQTTnet.TestApp.AspNetCore2/Startup.cs +++ b/Tests/MQTTnet.TestApp.AspNetCore2/Startup.cs @@ -27,7 +27,7 @@ namespace MQTTnet.TestApp.AspNetCore2 } // In class _Startup_ of the ASP.NET Core 3.1 project. -#if NETCOREAPP3_1 +#if NETCOREAPP3_1 || NET5_0 public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { app.UseRouting(); diff --git a/Tests/MQTTnet.TestApp.NetCore/MQTTnet.TestApp.NetCore.csproj b/Tests/MQTTnet.TestApp.NetCore/MQTTnet.TestApp.NetCore.csproj index 3c4c8e8..124452e 100644 --- a/Tests/MQTTnet.TestApp.NetCore/MQTTnet.TestApp.NetCore.csproj +++ b/Tests/MQTTnet.TestApp.NetCore/MQTTnet.TestApp.NetCore.csproj @@ -3,7 +3,7 @@ Exe Full - netcoreapp2.1 + netcoreapp2.1;net5.0 $(TargetFrameworks);net452;net461