Browse Source

fixed .net 5 build

release/3.x.x
JanEggers 3 years ago
parent
commit
02e65bca67
5 changed files with 8 additions and 6 deletions
  1. +2
    -2
      Source/MQTTnet.AspnetCore/Client/Tcp/TcpConnection.cs
  2. +2
    -0
      Source/MQTTnet.AspnetCore/Extensions/ConnectionRouteBuilderExtensions.cs
  3. +1
    -1
      Source/MQTTnet.AspnetCore/Extensions/EndpointRouterExtensions.cs
  4. +2
    -2
      Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj
  5. +1
    -1
      Tests/MQTTnet.TestApp.AspNetCore2/Startup.cs

+ 2
- 2
Source/MQTTnet.AspnetCore/Client/Tcp/TcpConnection.cs View File

@@ -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();
}


+ 2
- 0
Source/MQTTnet.AspnetCore/Extensions/ConnectionRouteBuilderExtensions.cs View File

@@ -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<MqttConnectionHandler>(path, options =>
@@ -19,5 +20,6 @@ namespace MQTTnet.AspNetCore.Extensions
options.WebSockets.SubProtocolSelector = MqttSubProtocolSelector.SelectSubProtocol;
});
}
#endif
}
}

+ 1
- 1
Source/MQTTnet.AspnetCore/Extensions/EndpointRouterExtensions.cs View File

@@ -1,5 +1,5 @@

#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0

using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing;


+ 2
- 2
Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj View File

@@ -21,11 +21,11 @@
<DefineConstants>RELEASE;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' ">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.1'">
<ItemGroup Condition="'$(TargetFramework)' != 'netcoreapp3.1' and '$(TargetFramework)' != 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Http.Connections" Version="1.1.0" />
</ItemGroup>



+ 1
- 1
Tests/MQTTnet.TestApp.AspNetCore2/Startup.cs View File

@@ -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();


Loading…
Cancel
Save