diff --git a/Build/MQTTnet.nuspec b/Build/MQTTnet.nuspec
index 54c4c47..fe5d708 100644
--- a/Build/MQTTnet.nuspec
+++ b/Build/MQTTnet.nuspec
@@ -47,8 +47,8 @@
-
-
+
+
diff --git a/Build/build.ps1 b/Build/build.ps1
index 5e280e2..6284473 100644
--- a/Build/build.ps1
+++ b/Build/build.ps1
@@ -2,12 +2,20 @@ param([string]$version)
if ([string]::IsNullOrEmpty($version)) {$version = "0.0.1"}
-$msbuild = "MSBuild.exe"
-&dotnet build ..\Frameworks\MQTTnet.Netstandard\MQTTnet.Netstandard.csproj -c="Release" /p:FileVersion=$version /p:AssemblyVersion=$version
-&dotnet build ..\Frameworks\MQTTnet.AspNetCore\MQTTnet.AspNetCore.csproj -c="Release" /p:FileVersion=$version /p:AssemblyVersion=$version
-&$msbuild ..\Frameworks\MQTTnet.UniversalWindows\MQTTnet.UniversalWindows.csproj /t:Build /p:Configuration="Release"
-
-Remove-Item .\NuGet -Force -Recurse
-New-Item -ItemType Directory -Force -Path .\NuGet
-.\NuGet.exe pack MQTTnet.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $version
-.\NuGet.exe pack MQTTnet.AspNetCore.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $version
\ No newline at end of file
+$vswhere = ${Env:\ProgramFiles(x86)} + '\Microsoft Visual Studio\Installer\vswhere'
+
+$path = &$vswhere -latest -products * -requires Microsoft.Component.MSBuild -property installationPath
+if ($path) {
+ $msbuild = join-path $path 'MSBuild\15.0\Bin\MSBuild.exe'
+
+ &$msbuild ..\Frameworks\MQTTnet.Netstandard\MQTTnet.Netstandard.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="net451" /p:FileVersion=$version /p:AssemblyVersion=$version /verbosity:m
+ &$msbuild ..\Frameworks\MQTTnet.Netstandard\MQTTnet.Netstandard.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="netstandard1.3" /p:FileVersion=$version /p:AssemblyVersion=$version /verbosity:m
+ &$msbuild ..\Frameworks\MQTTnet.Netstandard\MQTTnet.Netstandard.csproj /t:Build /p:Configuration="Release" /p:TargetFramework="uap10.0" /p:FileVersion=$version /p:AssemblyVersion=$version /verbosity:m
+ &dotnet build ..\Frameworks\MQTTnet.AspNetCore\MQTTnet.AspNetCore.csproj -c="Release" /p:FileVersion=$version /p:AssemblyVersion=$version
+
+ Remove-Item .\NuGet -Force -Recurse
+ New-Item -ItemType Directory -Force -Path .\NuGet
+ .\NuGet.exe pack MQTTnet.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $version
+ .\NuGet.exe pack MQTTnet.AspNetCore.nuspec -Verbosity detailed -Symbols -OutputDir "NuGet" -Version $version
+}
+
diff --git a/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs b/Frameworks/MQTTnet.NetStandard/Implementations/NetStandard/MqttServerAdapter.cs
similarity index 99%
rename from Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs
rename to Frameworks/MQTTnet.NetStandard/Implementations/NetStandard/MqttServerAdapter.cs
index 9e65715..1a6e5b4 100644
--- a/Frameworks/MQTTnet.NetStandard/Implementations/MqttServerAdapter.cs
+++ b/Frameworks/MQTTnet.NetStandard/Implementations/NetStandard/MqttServerAdapter.cs
@@ -1,4 +1,6 @@
-using System;
+#if NET451 || NETSTANDARD1_3
+
+using System;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
@@ -143,4 +145,5 @@ namespace MQTTnet.Implementations
}
}
}
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs b/Frameworks/MQTTnet.NetStandard/Implementations/NetStandard/MqttTcpChannel.cs
similarity index 99%
rename from Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs
rename to Frameworks/MQTTnet.NetStandard/Implementations/NetStandard/MqttTcpChannel.cs
index aac8a3c..62bb878 100644
--- a/Frameworks/MQTTnet.NetStandard/Implementations/MqttTcpChannel.cs
+++ b/Frameworks/MQTTnet.NetStandard/Implementations/NetStandard/MqttTcpChannel.cs
@@ -1,3 +1,5 @@
+#if NET451 || NETSTANDARD1_3
+
using System;
using System.Net.Security;
using System.Net.Sockets;
@@ -155,4 +157,5 @@ namespace MQTTnet.Implementations
}
}
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/Frameworks/MQTTnet.UniversalWindows/Implementations/MqttServerAdapter.cs b/Frameworks/MQTTnet.NetStandard/Implementations/Uap/MqttServerAdapter.cs
similarity index 98%
rename from Frameworks/MQTTnet.UniversalWindows/Implementations/MqttServerAdapter.cs
rename to Frameworks/MQTTnet.NetStandard/Implementations/Uap/MqttServerAdapter.cs
index fc38fdf..7d9d25f 100644
--- a/Frameworks/MQTTnet.UniversalWindows/Implementations/MqttServerAdapter.cs
+++ b/Frameworks/MQTTnet.NetStandard/Implementations/Uap/MqttServerAdapter.cs
@@ -1,3 +1,5 @@
+#if NET451 || NETSTANDARD1_3
+#else
using System;
using System.Threading.Tasks;
using MQTTnet.Core.Adapter;
@@ -69,4 +71,5 @@ namespace MQTTnet.Implementations
}
}
}
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/Frameworks/MQTTnet.UniversalWindows/Implementations/MqttTcpChannel.cs b/Frameworks/MQTTnet.NetStandard/Implementations/Uap/MqttTcpChannel.cs
similarity index 99%
rename from Frameworks/MQTTnet.UniversalWindows/Implementations/MqttTcpChannel.cs
rename to Frameworks/MQTTnet.NetStandard/Implementations/Uap/MqttTcpChannel.cs
index 8fb45ab..6e311d6 100644
--- a/Frameworks/MQTTnet.UniversalWindows/Implementations/MqttTcpChannel.cs
+++ b/Frameworks/MQTTnet.NetStandard/Implementations/Uap/MqttTcpChannel.cs
@@ -1,3 +1,5 @@
+#if NET451 || NETSTANDARD1_3
+#else
using System;
using System.Collections.Generic;
using System.IO;
@@ -133,4 +135,5 @@ namespace MQTTnet.Implementations
return result;
}
}
-}
\ No newline at end of file
+}
+#endif
\ No newline at end of file
diff --git a/Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj b/Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj
index f8dbcc9..37b7e13 100644
--- a/Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj
+++ b/Frameworks/MQTTnet.NetStandard/MQTTnet.Netstandard.csproj
@@ -1,7 +1,7 @@
- netstandard1.3;net451
+ netstandard1.3;net451;uap10.0
MQTTnet
MQTTnet
2.5.0.0
@@ -14,6 +14,19 @@
+
+ false
+ UAP,Version=v10.0
+ UAP
+ 10.0.15063.0
+ 10.0.10240.0
+ .NETCore
+ v5.0
+ $(DefineConstants);WINDOWS_UWP
+ $(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets
+
+
+
@@ -34,4 +47,8 @@
+
+
+
+
\ No newline at end of file
diff --git a/Frameworks/MQTTnet.UniversalWindows/Implementations/MqttWebSocketChannel.cs b/Frameworks/MQTTnet.UniversalWindows/Implementations/MqttWebSocketChannel.cs
deleted file mode 100644
index 6145802..0000000
--- a/Frameworks/MQTTnet.UniversalWindows/Implementations/MqttWebSocketChannel.cs
+++ /dev/null
@@ -1,92 +0,0 @@
-using MQTTnet.Core.Channel;
-using MQTTnet.Core.Client;
-using System;
-using System.IO;
-using System.Net.WebSockets;
-using System.Security.Cryptography.X509Certificates;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace MQTTnet.Implementations
-{
- public sealed class MqttWebSocketChannel : IMqttCommunicationChannel, IDisposable
- {
- private readonly MqttClientWebSocketOptions _options;
- private ClientWebSocket _webSocket = new ClientWebSocket();
-
- public MqttWebSocketChannel(MqttClientWebSocketOptions options)
- {
- _options = options ?? throw new ArgumentNullException(nameof(options));
- }
-
- public Stream RawReceiveStream { get; private set; }
- public Stream SendStream => RawReceiveStream;
- public Stream ReceiveStream => RawReceiveStream;
-
- public async Task ConnectAsync()
- {
- var uri = _options.Uri;
- if (!uri.StartsWith("ws://", StringComparison.OrdinalIgnoreCase))
- {
- uri = "ws://" + uri;
- }
-
- _webSocket = new ClientWebSocket();
-
- if (_options.RequestHeaders != null)
- {
- foreach (var requestHeader in _options.RequestHeaders)
- {
- _webSocket.Options.SetRequestHeader(requestHeader.Key, requestHeader.Value);
- }
- }
-
- if (_options.SubProtocols != null)
- {
- foreach (var subProtocol in _options.SubProtocols)
- {
- _webSocket.Options.AddSubProtocol(subProtocol);
- }
- }
-
- if (_options.CookieContainer != null)
- {
- _webSocket.Options.Cookies = _options.CookieContainer;
- }
-
- if (_options.TlsOptions?.UseTls == true && _options.TlsOptions?.Certificates != null)
- {
- _webSocket.Options.ClientCertificates = new X509CertificateCollection();
- foreach (var certificate in _options.TlsOptions.Certificates)
- {
- _webSocket.Options.ClientCertificates.Add(new X509Certificate(certificate));
- }
- }
-
- await _webSocket.ConnectAsync(new Uri(uri), CancellationToken.None).ConfigureAwait(false);
-
- RawReceiveStream = new WebSocketStream(_webSocket);
- }
-
- public async Task DisconnectAsync()
- {
- RawReceiveStream = null;
-
- if (_webSocket == null)
- {
- return;
- }
-
- if (_webSocket.State == WebSocketState.Open || _webSocket.State == WebSocketState.Connecting)
- {
- await _webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, CancellationToken.None).ConfigureAwait(false);
- }
- }
-
- public void Dispose()
- {
- _webSocket?.Dispose();
- _webSocket = null;
- }
- }
-}
\ No newline at end of file
diff --git a/Frameworks/MQTTnet.UniversalWindows/Implementations/WebSocketStream.cs b/Frameworks/MQTTnet.UniversalWindows/Implementations/WebSocketStream.cs
deleted file mode 100644
index 718b5ee..0000000
--- a/Frameworks/MQTTnet.UniversalWindows/Implementations/WebSocketStream.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-using System;
-using System.IO;
-using System.Net.WebSockets;
-using System.Threading;
-using System.Threading.Tasks;
-using MQTTnet.Core.Exceptions;
-
-namespace MQTTnet.Implementations
-{
- public class WebSocketStream : Stream
- {
- private readonly WebSocket _webSocket;
-
- public WebSocketStream(WebSocket webSocket)
- {
- _webSocket = webSocket ?? throw new ArgumentNullException(nameof(webSocket));
- }
-
- public override void Flush()
- {
- }
-
- public override async Task ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
- {
- var currentOffset = offset;
- var targetOffset = offset + count;
- while (_webSocket.State == WebSocketState.Open && currentOffset < targetOffset)
- {
- var response = await _webSocket.ReceiveAsync(new ArraySegment(buffer, currentOffset, count), cancellationToken).ConfigureAwait(false);
- currentOffset += response.Count;
- count -= response.Count;
-
- if (response.MessageType == WebSocketMessageType.Close)
- {
- await _webSocket.CloseAsync(WebSocketCloseStatus.NormalClosure, string.Empty, cancellationToken).ConfigureAwait(false);
- }
- }
-
- if (_webSocket.State == WebSocketState.Closed)
- {
- throw new MqttCommunicationException("connection closed");
- }
-
- return currentOffset - offset;
- }
-
- public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
- {
- return _webSocket.SendAsync(new ArraySegment(buffer, offset, count), WebSocketMessageType.Binary, true, cancellationToken);
- }
-
- public override int Read(byte[] buffer, int offset, int count)
- {
- return ReadAsync(buffer, offset, count).GetAwaiter().GetResult();
- }
-
- public override void Write(byte[] buffer, int offset, int count)
- {
- WriteAsync(buffer, offset, count).GetAwaiter().GetResult();
- }
-
- public override bool CanRead => true;
- public override bool CanSeek => false;
- public override bool CanWrite => true;
-
- public override long Length => throw new NotSupportedException();
-
- public override long Position
- {
- get => throw new NotSupportedException();
- set => throw new NotSupportedException();
- }
-
- public override long Seek(long offset, SeekOrigin origin)
- {
- throw new NotSupportedException();
- }
-
- public override void SetLength(long value)
- {
- throw new NotSupportedException();
- }
- }
-}
diff --git a/Frameworks/MQTTnet.UniversalWindows/MQTTnet.UniversalWindows.csproj b/Frameworks/MQTTnet.UniversalWindows/MQTTnet.UniversalWindows.csproj
deleted file mode 100644
index d8051f8..0000000
--- a/Frameworks/MQTTnet.UniversalWindows/MQTTnet.UniversalWindows.csproj
+++ /dev/null
@@ -1,200 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}
- Library
- Properties
- MQTTnet
- MQTTnet
- en-US
- UAP
- 10.0.15063.0
- 10.0.10240.0
- 14
- 512
- {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- win10-arm;win10-arm-aot;win10-x86;win10-x86-aot;win10-x64;win10-x64-aot
-
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
- prompt
- 4
- CS1591
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE;NETFX_CORE;WINDOWS_UWP
- prompt
- 4
- CS1591
-
-
- x86
- true
- bin\x86\Debug\
- DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
- ;2008,CS1591
- full
- x86
- false
- prompt
-
-
- x86
- bin\x86\Release\
- TRACE;NETFX_CORE;WINDOWS_UWP
- true
- ;2008,CS1591
- pdbonly
- x86
- false
- prompt
- bin\x86\Release\MQTTnet.XML
-
-
- ARM
- true
- bin\ARM\Debug\
- DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
- ;2008,CS1591
- full
- ARM
- false
- prompt
-
-
- ARM
- bin\ARM\Release\
- TRACE;NETFX_CORE;WINDOWS_UWP
- true
- ;2008,CS1591
- pdbonly
- ARM
- false
- prompt
- bin\ARM\Release\MQTTnet.XML
-
-
- x64
- true
- bin\x64\Debug\
- DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
- ;2008,CS1591
- full
- x64
- false
- prompt
-
-
- x64
- bin\x64\Release\
- TRACE;NETFX_CORE;WINDOWS_UWP
- true
- ;2008,CS1591
- pdbonly
- x64
- false
- prompt
- false
- bin\x64\Release\MQTTnet.XML
-
-
-
-
-
-
-
-
-
-
-
-
-
- {2ecb99e4-72d0-4c23-99ba-93d511d3967d}
- MQTTnet.Core
-
-
-
-
- 1.1.1
-
-
- 1.1.2
-
-
- 5.4.0
-
-
-
- 14.0
-
-
- bin\Any CPU\
- TRACE;NETFX_CORE;WINDOWS_UWP
- true
- true
- pdbonly
- AnyCPU
- false
- prompt
- MinimumRecommendedRules.ruleset
-
-
- bin\x86\Any CPU\
- TRACE;NETFX_CORE;WINDOWS_UWP
- bin\x86\Release\MQTTnet.XML
- true
- ;2008
- true
- pdbonly
- x86
- false
- prompt
- MinimumRecommendedRules.ruleset
-
-
- bin\ARM\Any CPU\
- TRACE;NETFX_CORE;WINDOWS_UWP
- bin\ARM\Release\MQTTnet.XML
- true
- ;2008
- true
- pdbonly
- ARM
- false
- prompt
- MinimumRecommendedRules.ruleset
-
-
- bin\x64\Any CPU\
- TRACE;NETFX_CORE;WINDOWS_UWP
- bin\x64\Release\MQTTnet.XML
- true
- ;2008
- true
- pdbonly
- x64
- false
- prompt
- MinimumRecommendedRules.ruleset
-
-
-
-
\ No newline at end of file
diff --git a/Frameworks/MQTTnet.UniversalWindows/MqttFactory.cs b/Frameworks/MQTTnet.UniversalWindows/MqttFactory.cs
deleted file mode 100644
index 67b8fe6..0000000
--- a/Frameworks/MQTTnet.UniversalWindows/MqttFactory.cs
+++ /dev/null
@@ -1,125 +0,0 @@
-using System;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using Microsoft.Extensions.Options;
-using MQTTnet.Core.Adapter;
-using MQTTnet.Core.Channel;
-using MQTTnet.Core.Client;
-using MQTTnet.Core.ManagedClient;
-using MQTTnet.Core.Serializer;
-using MQTTnet.Core.Server;
-using MQTTnet.Implementations;
-
-namespace MQTTnet
-{
- public class MqttFactory : IMqttCommunicationAdapterFactory, IMqttClientSesssionFactory, IMqttClientFactory, IMqttServerFactory
- {
- private readonly IServiceProvider _serviceProvider;
-
- private static IServiceProvider BuildServiceProvider()
- {
- var serviceProvider = new ServiceCollection()
- .AddMqttClient()
- .AddMqttServer()
- .AddLogging()
- .BuildServiceProvider();
-
- serviceProvider.GetRequiredService()
- .AddMqttTrace();
-
- return serviceProvider;
- }
-
- public MqttFactory()
- : this(BuildServiceProvider())
- {
- }
-
- public MqttFactory(IServiceProvider serviceProvider)
- {
- _serviceProvider = serviceProvider;
- }
-
- public IMqttCommunicationAdapter CreateClientMqttCommunicationAdapter(IMqttClientOptions options)
- {
- var logger = _serviceProvider.GetRequiredService>();
- return new MqttChannelCommunicationAdapter(CreateMqttCommunicationChannel(options.ChannelOptions), CreateSerializer(options.ProtocolVersion), logger);
- }
-
- public IMqttCommunicationAdapter CreateServerMqttCommunicationAdapter(IMqttCommunicationChannel channel)
- {
- var serializer = _serviceProvider.GetRequiredService();
- var logger = _serviceProvider.GetRequiredService>();
- return new MqttChannelCommunicationAdapter(channel, serializer, logger);
- }
-
- public IMqttCommunicationChannel CreateMqttCommunicationChannel(IMqttClientChannelOptions options)
- {
- if (options == null) throw new ArgumentNullException(nameof(options));
-
- switch (options)
- {
- case MqttClientTcpOptions tcpOptions:
- return CreateTcpChannel(tcpOptions);
- case MqttClientWebSocketOptions webSocketOptions:
- return CreateWebSocketChannel(webSocketOptions);
- default:
- throw new NotSupportedException();
- }
- }
-
- public MqttTcpChannel CreateTcpChannel(MqttClientTcpOptions tcpOptions)
- {
- return new MqttTcpChannel(tcpOptions);
- }
-
- public MqttWebSocketChannel CreateWebSocketChannel(MqttClientWebSocketOptions webSocketOptions)
- {
- return new MqttWebSocketChannel(webSocketOptions);
- }
-
- public MqttPacketSerializer CreateSerializer(MqttProtocolVersion protocolVersion)
- {
- return new MqttPacketSerializer
- {
- ProtocolVersion = protocolVersion
- };
- }
-
- public MqttClientSession CreateClientSession(string clientId, MqttClientSessionsManager clientSessionsManager)
- {
- return new MqttClientSession(
- clientId,
- _serviceProvider.GetRequiredService>(),
- clientSessionsManager,
- _serviceProvider.GetRequiredService(),
- _serviceProvider.GetRequiredService>(),
- _serviceProvider.GetRequiredService>());
- }
-
- public IMqttClient CreateMqttClient()
- {
- return _serviceProvider.GetRequiredService();
- }
-
- public IManagedMqttClient CreateManagedMqttClient()
- {
- return _serviceProvider.GetRequiredService();
- }
-
- public IMqttServer CreateMqttServer()
- {
- return _serviceProvider.GetRequiredService();
- }
-
- public IMqttServer CreateMqttServer(Action configure)
- {
- if (configure == null) throw new ArgumentNullException(nameof(configure));
-
- var options = _serviceProvider.GetRequiredService>();
- configure(options.Value);
-
- return _serviceProvider.GetRequiredService();
- }
- }
-}
\ No newline at end of file
diff --git a/Frameworks/MQTTnet.UniversalWindows/Properties/AssemblyInfo.cs b/Frameworks/MQTTnet.UniversalWindows/Properties/AssemblyInfo.cs
deleted file mode 100644
index 5763288..0000000
--- a/Frameworks/MQTTnet.UniversalWindows/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-using System.Reflection;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("MQTTnet")]
-[assembly: AssemblyDescription("MQTTnet for Universal Windows")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("Christian Kratky")]
-[assembly: AssemblyProduct("MQTTnet")]
-[assembly: AssemblyCopyright("Copyright © Christian Kratky 2016-2017")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-[assembly: ComVisible(false)]
-[assembly: AssemblyVersion("2.5.0.0")]
-[assembly: AssemblyFileVersion("2.5.0.0")]
\ No newline at end of file
diff --git a/Frameworks/MQTTnet.UniversalWindows/Properties/MQTTnet.Universal.rd.xml b/Frameworks/MQTTnet.UniversalWindows/Properties/MQTTnet.Universal.rd.xml
deleted file mode 100644
index e6d2494..0000000
--- a/Frameworks/MQTTnet.UniversalWindows/Properties/MQTTnet.Universal.rd.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
-
-
-
diff --git a/Frameworks/MQTTnet.UniversalWindows/ServiceCollectionExtensions.cs b/Frameworks/MQTTnet.UniversalWindows/ServiceCollectionExtensions.cs
deleted file mode 100644
index 362df4d..0000000
--- a/Frameworks/MQTTnet.UniversalWindows/ServiceCollectionExtensions.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using Microsoft.Extensions.DependencyInjection;
-using MQTTnet.Core.Adapter;
-using MQTTnet.Core.Client;
-using MQTTnet.Core.ManagedClient;
-using MQTTnet.Core.Serializer;
-using MQTTnet.Core.Server;
-using MQTTnet.Implementations;
-using System;
-using Microsoft.Extensions.Logging;
-using MQTTnet.Core.Diagnostics;
-
-namespace MQTTnet
-{
- public static class ServiceCollectionExtensions
- {
- public static IServiceCollection AddMqttServer(this IServiceCollection services)
- {
- services.AddMqttServerServices();
-
- services.AddSingleton(s => s.GetService());
- services.AddSingleton();
-
- return services;
- }
-
- public static IServiceCollection AddMqttServerServices(this IServiceCollection services)
- {
- services.AddOptions();
- services.AddSingleton();
- services.AddSingleton(s => s.GetService());
- services.AddSingleton(s => s.GetService());
-
- services.AddTransient();
- services.AddTransient();
-
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- return services;
- }
-
- public static IServiceCollection AddMqttServer(this IServiceCollection services, Action configureOptions)
- {
- return services
- .AddMqttServer()
- .Configure(configureOptions);
- }
-
- public static IServiceCollection AddMqttClient(this IServiceCollection services)
- {
- services.AddSingleton();
- services.AddSingleton(s => s.GetService());
-
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
- services.AddTransient();
-
- return services;
- }
-
- public static ILoggerFactory AddMqttTrace(this ILoggerFactory factory)
- {
- factory.AddProvider(new MqttNetTrace());
- return factory;
- }
- }
-}
diff --git a/MQTTnet.sln b/MQTTnet.sln
index aae1e6e..0bc9920 100644
--- a/MQTTnet.sln
+++ b/MQTTnet.sln
@@ -1,12 +1,10 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
-VisualStudioVersion = 15.0.27004.2005
+VisualStudioVersion = 15.0.27004.2002
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MQTTnet.Core.Tests", "Tests\MQTTnet.Core.Tests\MQTTnet.Core.Tests.csproj", "{A7FF0C91-25DE-4BA6-B39E-F54E8DADF1CC}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MQTTnet.UniversalWindows", "Frameworks\MQTTnet.UniversalWindows\MQTTnet.UniversalWindows.csproj", "{BD60C727-D8E8-40C3-B8E3-C95A864AE611}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{9248C2E1-B9D6-40BF-81EC-86004D7765B4}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Frameworks", "Frameworks", "{32A630A7-2598-41D7-B625-204CD906F5FB}"
@@ -64,22 +62,6 @@ Global
{A7FF0C91-25DE-4BA6-B39E-F54E8DADF1CC}.Release|x64.Build.0 = Release|Any CPU
{A7FF0C91-25DE-4BA6-B39E-F54E8DADF1CC}.Release|x86.ActiveCfg = Release|Any CPU
{A7FF0C91-25DE-4BA6-B39E-F54E8DADF1CC}.Release|x86.Build.0 = Release|Any CPU
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Debug|ARM.ActiveCfg = Debug|ARM
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Debug|ARM.Build.0 = Debug|ARM
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Debug|x64.ActiveCfg = Debug|x64
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Debug|x64.Build.0 = Debug|x64
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Debug|x86.ActiveCfg = Debug|x86
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Debug|x86.Build.0 = Debug|x86
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Release|Any CPU.Build.0 = Release|Any CPU
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Release|ARM.ActiveCfg = Release|ARM
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Release|ARM.Build.0 = Release|ARM
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Release|x64.ActiveCfg = Release|x64
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Release|x64.Build.0 = Release|x64
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Release|x86.ActiveCfg = Release|x86
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611}.Release|x86.Build.0 = Release|x86
{2ECB99E4-72D0-4C23-99BA-93D511D3967D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2ECB99E4-72D0-4C23-99BA-93D511D3967D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2ECB99E4-72D0-4C23-99BA-93D511D3967D}.Debug|ARM.ActiveCfg = Debug|Any CPU
@@ -188,7 +170,6 @@ Global
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{A7FF0C91-25DE-4BA6-B39E-F54E8DADF1CC} = {9248C2E1-B9D6-40BF-81EC-86004D7765B4}
- {BD60C727-D8E8-40C3-B8E3-C95A864AE611} = {32A630A7-2598-41D7-B625-204CD906F5FB}
{FF1F72D6-9524-4422-9497-3CC0002216ED} = {9248C2E1-B9D6-40BF-81EC-86004D7765B4}
{3587E506-55A2-4EB3-99C7-DC01E42D25D2} = {32A630A7-2598-41D7-B625-204CD906F5FB}
{3D283AAD-AAA8-4339-8394-52F80B6304DB} = {9248C2E1-B9D6-40BF-81EC-86004D7765B4}