diff --git a/.editorconfig b/.editorconfig index c4b053935..da3f0a4de 100644 --- a/.editorconfig +++ b/.editorconfig @@ -40,7 +40,6 @@ dotnet_style_qualification_for_method = false:suggestion dotnet_style_qualification_for_property = false:suggestion # ReSharper properties -resharper_autodetect_indent_settings = true resharper_default_private_modifier = implicit resharper_place_accessorholder_attribute_on_same_line = false resharper_use_indent_from_vs = false @@ -61,7 +60,7 @@ resharper_web_config_wrong_module_highlighting = warning [*] charset = utf-8 end_of_line = crlf -trim_trailing_whitespace = false +trim_trailing_whitespace = true insert_final_newline = false indent_style = space indent_size = 4 diff --git a/.github/workflows/ReleaseNotes.md b/.github/workflows/ReleaseNotes.md index b1e9464a8..239b39cf5 100644 --- a/.github/workflows/ReleaseNotes.md +++ b/.github/workflows/ReleaseNotes.md @@ -1,6 +1,7 @@ * [Core] Optimized packet serialization of PUBACK and PUBREC packets for protocol version 5.0.0 (#1939, thanks to @Y-Sindo). * [Core] The package inspector is now fully async (#1941). * [Client] Added a dedicated exception when the client is not connected (#1954, thanks to @marcpiulachs). -* [Server] The server will no longer send _NoMatchingSubscribers_ when the actual subscription was non success (#1965, BREAKING CHANGE!). +* [Server] The server will no longer send _NoMatchingSubscribers_ when the actual subscription was non success (#1965, BREAKING CHANGE!). +* [Server] Fixed broken support for _null_ in _AddServer_ method in ASP.NET integration (#1981). * [ManagedClient] Added a new event (SubscriptionsChangedAsync) which is fired when a subscription or unsubscription was made (#1894, thanks to @pdufrene). * [TopicTemplate] Added new extension which provides a template engine for topics (#1932, thanks to @simonthum). diff --git a/Source/MQTTnet.AspTestApp/MQTTnet.AspTestApp.csproj b/Source/MQTTnet.AspTestApp/MQTTnet.AspTestApp.csproj index e7fb54321..4bcabdd74 100644 --- a/Source/MQTTnet.AspTestApp/MQTTnet.AspTestApp.csproj +++ b/Source/MQTTnet.AspTestApp/MQTTnet.AspTestApp.csproj @@ -1,7 +1,7 @@ - net6.0 + net7.0 enable enable false diff --git a/Source/MQTTnet.AspnetCore/ServiceCollectionExtensions.cs b/Source/MQTTnet.AspnetCore/ServiceCollectionExtensions.cs index 1186baeb7..562ccd3cb 100644 --- a/Source/MQTTnet.AspnetCore/ServiceCollectionExtensions.cs +++ b/Source/MQTTnet.AspnetCore/ServiceCollectionExtensions.cs @@ -40,13 +40,10 @@ public static IServiceCollection AddHostedMqttServer(this IServiceCollection ser throw new ArgumentNullException(nameof(services)); } - if (configure == null) - { - throw new ArgumentNullException(nameof(configure)); - } - var serverOptionsBuilder = new MqttServerOptionsBuilder(); - configure.Invoke(serverOptionsBuilder); + + configure?.Invoke(serverOptionsBuilder); + var options = serverOptionsBuilder.Build(); return AddHostedMqttServer(services, options);