瀏覽代碼

fixed .net 5 build

release/3.x.x
JanEggers 3 年之前
父節點
當前提交
02e65bca67
共有 5 個文件被更改,包括 8 次插入6 次删除
  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 查看文件

@@ -40,7 +40,7 @@ namespace MQTTnet.AspNetCore.Client.Tcp
_sender = new SocketSender(_socket, PipeScheduler.ThreadPool); _sender = new SocketSender(_socket, PipeScheduler.ThreadPool);
_receiver = new SocketReceiver(_socket, PipeScheduler.ThreadPool); _receiver = new SocketReceiver(_socket, PipeScheduler.ThreadPool);
} }
#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0
public override ValueTask DisposeAsync() public override ValueTask DisposeAsync()
#else #else
public Task DisposeAsync() public Task DisposeAsync()
@@ -53,7 +53,7 @@ namespace MQTTnet.AspNetCore.Client.Tcp


_socket?.Dispose(); _socket?.Dispose();


#if NETCOREAPP3_1
#if NETCOREAPP3_1 || NET5_0


return base.DisposeAsync(); return base.DisposeAsync();
} }


+ 2
- 0
Source/MQTTnet.AspnetCore/Extensions/ConnectionRouteBuilderExtensions.cs 查看文件

@@ -12,6 +12,7 @@ namespace MQTTnet.AspNetCore.Extensions
#if NETCOREAPP3_1 #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(...).")] [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 #endif
#if NETCOREAPP3_1 || NETCOREAPP2_1 || NETSTANDARD
public static void MapMqtt(this ConnectionsRouteBuilder connection, PathString path) public static void MapMqtt(this ConnectionsRouteBuilder connection, PathString path)
{ {
connection.MapConnectionHandler<MqttConnectionHandler>(path, options => connection.MapConnectionHandler<MqttConnectionHandler>(path, options =>
@@ -19,5 +20,6 @@ namespace MQTTnet.AspNetCore.Extensions
options.WebSockets.SubProtocolSelector = MqttSubProtocolSelector.SelectSubProtocol; options.WebSockets.SubProtocolSelector = MqttSubProtocolSelector.SelectSubProtocol;
}); });
} }
#endif
} }
} }

+ 1
- 1
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.Builder;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;


+ 2
- 2
Source/MQTTnet.AspnetCore/MQTTnet.AspNetCore.csproj 查看文件

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


<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' or '$(TargetFramework)' == 'net5.0' ">
<FrameworkReference Include="Microsoft.AspNetCore.App" /> <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup> </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" /> <PackageReference Include="Microsoft.AspNetCore.Http.Connections" Version="1.1.0" />
</ItemGroup> </ItemGroup>




+ 1
- 1
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. // 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) public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{ {
app.UseRouting(); app.UseRouting();


Loading…
取消
儲存