From 8ecf658059c9fcb2e245210eebd24f870ab8bfc5 Mon Sep 17 00:00:00 2001 From: Christian Date: Sat, 28 Dec 2019 14:05:24 +0100 Subject: [PATCH 1/2] Update MQTTnet.nuspec --- Build/MQTTnet.nuspec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Build/MQTTnet.nuspec b/Build/MQTTnet.nuspec index cc9aeaa..963ee06 100644 --- a/Build/MQTTnet.nuspec +++ b/Build/MQTTnet.nuspec @@ -11,6 +11,7 @@ false MQTTnet is a high performance .NET library for MQTT based communication. It provides a MQTT client and a MQTT server (broker) and supports v3.1.0, v3.1.1 and v5.0.0 of the MQTT protocol. +* [ManagedClient] Added support for persisted sessions (thansk to @PMExtra). * [Server] Added support for assigned client IDs (MQTTv5 only) (thanks to @bcrosnier). Copyright Christian Kratky 2016-2019 @@ -55,4 +56,4 @@ - \ No newline at end of file + From ce51d12a03a99dc4f04f351d82c36ebe3a7e401d Mon Sep 17 00:00:00 2001 From: Christian Kratky Date: Fri, 10 Jan 2020 22:16:31 +0100 Subject: [PATCH 2/2] Update SDK versions. --- Build/build.ps1 | 16 ++++++++-------- Source/MQTTnet.Server/MQTTnet.Server.csproj | 2 +- Source/MQTTnet.Server/Web/Startup.cs | 19 ++++++++++--------- .../MQTTnet.AspNetCore.Tests.csproj | 2 +- Tests/MQTTnet.Core.Tests/MQTTnet.Tests.csproj | 2 +- .../MQTTnet.TestApp.AspNetCore2.csproj | 2 +- .../MQTTnet.TestApp.UniversalWindows.csproj | 2 +- 7 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Build/build.ps1 b/Build/build.ps1 index bd193d6..36c6eab 100644 --- a/Build/build.ps1 +++ b/Build/build.ps1 @@ -13,11 +13,11 @@ Write-Host "MSBuild path = $msbuild" Write-Host # Build and execute tests -&$msbuild ..\Tests\MQTTnet.Core.Tests\MQTTnet.Tests.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netcoreapp2.1" /verbosity:m -&$msbuild ..\Tests\MQTTnet.AspNetCore.Tests\MQTTnet.AspNetCore.Tests.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netcoreapp2.1" /verbosity:m +&$msbuild ..\Tests\MQTTnet.Core.Tests\MQTTnet.Tests.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netcoreapp3.1" /verbosity:m +&$msbuild ..\Tests\MQTTnet.AspNetCore.Tests\MQTTnet.AspNetCore.Tests.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netcoreapp3.1" /verbosity:m -vstest.console.exe ..\Tests\MQTTnet.Core.Tests\bin\Release\netcoreapp2.1\MQTTnet.Tests.dll -vstest.console.exe ..\Tests\MQTTnet.AspNetCore.Tests\bin\Release\netcoreapp2.1\MQTTnet.AspNetCore.Tests.dll +vstest.console.exe ..\Tests\MQTTnet.Core.Tests\bin\Release\netcoreapp3.1\MQTTnet.Tests.dll +vstest.console.exe ..\Tests\MQTTnet.AspNetCore.Tests\bin\Release\netcoreapp3.1\MQTTnet.AspNetCore.Tests.dll # Build the core library &$msbuild ..\Source\MQTTnet\MQTTnet.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="net452" /p:FileVersion=$assemblyVersion /p:AssemblyVersion=$assemblyVersion /verbosity:m /p:SignAssembly=true /p:AssemblyOriginatorKeyFile=".\..\..\Build\codeSigningKey.pfx" @@ -84,7 +84,7 @@ Remove-Item "nuget.exe" -Force -Recurse -ErrorAction SilentlyContinue # Build MQTTnet.Server Portable &dotnet publish ..\Source\MQTTnet.Server\MQTTnet.Server.csproj --configuration Release /p:FileVersion=$assemblyVersion /p:Version=$nugetVersion -$source = "..\Source\MQTTnet.Server\bin\Release\netcoreapp2.2\publish" +$source = "..\Source\MQTTnet.Server\bin\Release\netcoreapp3.1\publish" $destination = "..\Source\MQTTnet.Server\bin\MQTTnet.Server-Portable-v$nugetVersion.zip" If(Test-path $destination) {Remove-item $destination} Add-Type -assembly "system.io.compression.filesystem" @@ -95,7 +95,7 @@ If(Test-path $destination) {Remove-item $destination} # Build MQTTnet.Server Linux-x64 &dotnet publish ..\Source\MQTTnet.Server\MQTTnet.Server.csproj --configuration Release /p:FileVersion=$assemblyVersion /p:Version=$nugetVersion --self-contained --runtime linux-x64 -$source = "..\Source\MQTTnet.Server\bin\Release\netcoreapp2.2\linux-x64\publish" +$source = "..\Source\MQTTnet.Server\bin\Release\netcoreapp3.1\linux-x64\publish" $destination = "..\Source\MQTTnet.Server\bin\MQTTnet.Server-Linux-x64-v$nugetVersion.zip" If(Test-path $destination) {Remove-item $destination} Add-Type -assembly "system.io.compression.filesystem" @@ -106,7 +106,7 @@ If(Test-path $destination) {Remove-item $destination} # Build MQTTnet.Server Linux-ARM &dotnet publish ..\Source\MQTTnet.Server\MQTTnet.Server.csproj --configuration Release /p:FileVersion=$assemblyVersion /p:Version=$nugetVersion --self-contained --runtime linux-arm -$source = "..\Source\MQTTnet.Server\bin\Release\netcoreapp2.2\linux-ARM\publish" +$source = "..\Source\MQTTnet.Server\bin\Release\netcoreapp3.1\linux-ARM\publish" $destination = "..\Source\MQTTnet.Server\bin\MQTTnet.Server-Linux-ARM-v$nugetVersion.zip" If(Test-path $destination) {Remove-item $destination} Add-Type -assembly "system.io.compression.filesystem" @@ -117,7 +117,7 @@ If(Test-path $destination) {Remove-item $destination} # Build MQTTnet.Server Windows-x64 &dotnet publish ..\Source\MQTTnet.Server\MQTTnet.Server.csproj --configuration Release /p:FileVersion=$assemblyVersion /p:Version=$nugetVersion --self-contained --runtime win-x64 -$source = "..\Source\MQTTnet.Server\bin\Release\netcoreapp2.2\win-x64\publish" +$source = "..\Source\MQTTnet.Server\bin\Release\netcoreapp3.1\win-x64\publish" $destination = "..\Source\MQTTnet.Server\bin\MQTTnet.Server-Windows-x64-v$nugetVersion.zip" If(Test-path $destination) {Remove-item $destination} Add-Type -assembly "system.io.compression.filesystem" diff --git a/Source/MQTTnet.Server/MQTTnet.Server.csproj b/Source/MQTTnet.Server/MQTTnet.Server.csproj index bbd3ceb..4235315 100644 --- a/Source/MQTTnet.Server/MQTTnet.Server.csproj +++ b/Source/MQTTnet.Server/MQTTnet.Server.csproj @@ -1,7 +1,7 @@ - netcoreapp2.2 + netcoreapp3.1 InProcess MQTTnet.Server MQTTnet.Server diff --git a/Source/MQTTnet.Server/Web/Startup.cs b/Source/MQTTnet.Server/Web/Startup.cs index 8ef622e..2beb771 100644 --- a/Source/MQTTnet.Server/Web/Startup.cs +++ b/Source/MQTTnet.Server/Web/Startup.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; @@ -16,7 +12,12 @@ using MQTTnet.Server.Logging; using MQTTnet.Server.Mqtt; using MQTTnet.Server.Scripting; using MQTTnet.Server.Scripting.DataSharing; +using Newtonsoft.Json.Converters; using Swashbuckle.AspNetCore.SwaggerUI; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; namespace MQTTnet.Server.Web { @@ -88,10 +89,10 @@ namespace MQTTnet.Server.Web services.AddCors(); services.AddMvc() - .SetCompatibilityVersion(CompatibilityVersion.Version_2_2) - .AddJsonOptions(options => + .SetCompatibilityVersion(CompatibilityVersion.Version_3_0) + .AddNewtonsoftJson(o => { - options.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter()); + o.SerializerSettings.Converters.Add(new StringEnumConverter()); }); ReadMqttSettings(services); @@ -116,7 +117,7 @@ namespace MQTTnet.Server.Web services.AddSwaggerGen(c => { c.DescribeAllEnumsAsStrings(); - + var securityScheme = new OpenApiSecurityScheme { Scheme = "Basic", diff --git a/Tests/MQTTnet.AspNetCore.Tests/MQTTnet.AspNetCore.Tests.csproj b/Tests/MQTTnet.AspNetCore.Tests/MQTTnet.AspNetCore.Tests.csproj index 4569af3..c81f91c 100644 --- a/Tests/MQTTnet.AspNetCore.Tests/MQTTnet.AspNetCore.Tests.csproj +++ b/Tests/MQTTnet.AspNetCore.Tests/MQTTnet.AspNetCore.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + netcoreapp3.1 false diff --git a/Tests/MQTTnet.Core.Tests/MQTTnet.Tests.csproj b/Tests/MQTTnet.Core.Tests/MQTTnet.Tests.csproj index 830051d..07812bc 100644 --- a/Tests/MQTTnet.Core.Tests/MQTTnet.Tests.csproj +++ b/Tests/MQTTnet.Core.Tests/MQTTnet.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + netcoreapp3.1 false diff --git a/Tests/MQTTnet.TestApp.AspNetCore2/MQTTnet.TestApp.AspNetCore2.csproj b/Tests/MQTTnet.TestApp.AspNetCore2/MQTTnet.TestApp.AspNetCore2.csproj index b8a9307..2139c7f 100644 --- a/Tests/MQTTnet.TestApp.AspNetCore2/MQTTnet.TestApp.AspNetCore2.csproj +++ b/Tests/MQTTnet.TestApp.AspNetCore2/MQTTnet.TestApp.AspNetCore2.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + netcoreapp3.1 Latest diff --git a/Tests/MQTTnet.TestApp.UniversalWindows/MQTTnet.TestApp.UniversalWindows.csproj b/Tests/MQTTnet.TestApp.UniversalWindows/MQTTnet.TestApp.UniversalWindows.csproj index 243c9c5..f31fe3b 100644 --- a/Tests/MQTTnet.TestApp.UniversalWindows/MQTTnet.TestApp.UniversalWindows.csproj +++ b/Tests/MQTTnet.TestApp.UniversalWindows/MQTTnet.TestApp.UniversalWindows.csproj @@ -11,7 +11,7 @@ MQTTnet.TestApp.UniversalWindows en-US UAP - 10.0.17134.0 + 10.0.18362.0 10.0.10240.0 14 512