Compare commits

...

3 Commits

Author SHA1 Message Date
2248356998 qq.com
976323a716 适配net10 2025-09-28 13:06:39 +08:00
2248356998 qq.com
3c9e397403 10.11.76 2025-09-28 00:33:56 +08:00
2248356998 qq.com
79406ad4a0 更新依赖 2025-09-27 23:59:38 +08:00
33 changed files with 103 additions and 88 deletions

View File

@@ -10,7 +10,6 @@
// ------------------------------------------------------------------------
using System.Security.Cryptography;
using System.Text;
namespace ThingsGateway.DataEncryption;
@@ -36,7 +35,7 @@ public static class PBKDF2Encryption
var salt = new byte[saltSize];
rng.GetBytes(salt);
#if NET10_0_OR_GREATER
var hash = Rfc2898DeriveBytes.Pbkdf2(Encoding.UTF8.GetBytes(text), salt, iterationCount, HashAlgorithmName.SHA256, derivedKeyLength);
var hash = Rfc2898DeriveBytes.Pbkdf2(System.Text.Encoding.UTF8.GetBytes(text), salt, iterationCount, HashAlgorithmName.SHA256, derivedKeyLength);
#else
using var pbkdf2 = new Rfc2898DeriveBytes(text, salt, iterationCount, HashAlgorithmName.SHA256);
var hash = pbkdf2.GetBytes(derivedKeyLength);
@@ -70,10 +69,10 @@ public static class PBKDF2Encryption
return false;
#if NET10_0_OR_GREATER
var computedHash = Rfc2898DeriveBytes.Pbkdf2(Encoding.UTF8.GetBytes(text), saltBytes, iterationCount, HashAlgorithmName.SHA256, derivedKeyLength);
var computedHash = Rfc2898DeriveBytes.Pbkdf2(System.Text.Encoding.UTF8.GetBytes(text), saltBytes, iterationCount, HashAlgorithmName.SHA256, derivedKeyLength);
#else
using var pbkdf2 = new Rfc2898DeriveBytes(text, saltBytes, iterationCount, HashAlgorithmName.SHA256);
var computedHash = pbkdf2.GetBytes(derivedKeyLength);
using var pbkdf2 = new Rfc2898DeriveBytes(text, saltBytes, iterationCount, HashAlgorithmName.SHA256);
var computedHash = pbkdf2.GetBytes(derivedKeyLength);
#endif
return computedHash.SequenceEqual(storedHashBytes);

View File

@@ -1,9 +1,9 @@
<Project>
<PropertyGroup>
<PluginVersion>10.11.73</PluginVersion>
<ProPluginVersion>10.11.73</ProPluginVersion>
<DefaultVersion>10.11.73</DefaultVersion>
<PluginVersion>10.11.77</PluginVersion>
<ProPluginVersion>10.11.77</ProPluginVersion>
<DefaultVersion>10.11.77</DefaultVersion>
<AuthenticationVersion>10.11.6</AuthenticationVersion>
<SourceGeneratorVersion>10.11.6</SourceGeneratorVersion>
<NET8Version>8.0.20</NET8Version>
@@ -12,7 +12,7 @@
<IsTrimmable>false</IsTrimmable>
<ManagementProPluginVersion>10.11.70</ManagementProPluginVersion>
<ManagementPluginVersion>10.11.70</ManagementPluginVersion>
<TSVersion>4.0.0-beta.57</TSVersion>
<TSVersion>4.0.0-beta.70</TSVersion>
</PropertyGroup>

View File

@@ -36,7 +36,7 @@
<EditorItem @bind-Field="@context.StopBits" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.DtrEnable" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.RtsEnable" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.StreamAsync" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.Handshake" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.CacheTimeout" Ignore=@(context.ChannelType == ChannelTypeEnum.UdpSession || context.ChannelType == ChannelTypeEnum.Other) />

View File

@@ -42,7 +42,7 @@
"PortName": "COM Port",
"RemoteUrl": "Remote IP Address",
"RtsEnable": "Rts",
"StreamAsync": "StreamAsync",
"Handshake": "Handshake",
"SaveChannel": "Add/Modify Channel",
"StopBits": "Stop Bits"
},
@@ -102,7 +102,7 @@
"PortName": "PortName",
"RemoteUrl": "RemoteUrl",
"RtsEnable": "RtsEnable",
"StreamAsync": "StreamAsync",
"Handshake": "Handshake",
"StopBits": "StopBits"
}
}

View File

@@ -40,7 +40,7 @@
"PortName": "COM口",
"RemoteUrl": "远程url",
"RtsEnable": "Rts",
"StreamAsync": "串口流读写",
"Handshake": "Handshake",
"SaveChannel": "添加/修改通道",
"StopBits": "停止位"
},
@@ -100,7 +100,7 @@
"PortName": "COM口",
"RemoteUrl": "远程url",
"RtsEnable": "Rts",
"StreamAsync": "串口流读写",
"Handshake": "串口流读写",
"StopBits": "停止位"
}
}

View File

@@ -69,9 +69,9 @@ namespace ThingsGateway.Foundation
public virtual bool DtrEnable { get; set; } = true;
/// <summary>
/// StreamAsync
/// Handshake
/// </summary>
public virtual bool StreamAsync { get; set; } = false;
public virtual Handshake Handshake { get; set; }
/// <summary>
/// RtsEnable

View File

@@ -9,7 +9,6 @@
//------------------------------------------------------------------------------
using ThingsGateway.Foundation.Extension.String;
using ThingsGateway.NewLife;
using TouchSocket.SerialPorts;
@@ -141,10 +140,19 @@ public static class ChannelOptionsExtensions
/// <returns></returns>
private static SerialPortChannel GetSerialPort(this TouchSocketConfig config, IChannelOptions channelOptions)
{
var serialPortOption = FastMapper.Mapper<IChannelOptions,SerialPortOption>(channelOptions);
serialPortOption.ThrowIfNull(nameof(SerialPortOption));
channelOptions.ThrowIfNull(nameof(SerialPortOption));
channelOptions.Config = config;
config.SetSerialPortOption(serialPortOption);
config.SetSerialPortOption(options =>
{
options.PortName = channelOptions.PortName;
options.BaudRate = channelOptions.BaudRate;
options.DataBits = channelOptions.DataBits;
options.Parity = channelOptions.Parity;
options.StopBits = channelOptions.StopBits;
options.DtrEnable = channelOptions.DtrEnable;
options.RtsEnable = channelOptions.RtsEnable;
options.Handshake = channelOptions.Handshake;
});
//载入配置
SerialPortChannel serialPortChannel = new SerialPortChannel(channelOptions);
return serialPortChannel;

View File

@@ -72,11 +72,7 @@ public interface IChannelOptions
/// </summary>
bool RtsEnable { get; set; }
/// <summary>
/// StreamAsync
/// </summary>
bool StreamAsync { get; set; }
Handshake Handshake { get; set; }
#endregion
/// <summary>
/// 最大并发数量

View File

@@ -182,7 +182,7 @@ public class DeviceSingleStreamDataHandleAdapter<TRequest> : CustomDataHandlingA
Span<byte> span = default;
if (Logger?.LogLevel <= LogLevel.Trace)
{
span = writer.GetSpan(sendMessage.MaxLength);
span = writer.GetSpan(sendMessage.MaxLength);
}
sendMessage.Build(ref writer);

View File

@@ -18,8 +18,6 @@ using ThingsGateway.NewLife;
using ThingsGateway.NewLife.Collections;
using ThingsGateway.NewLife.Extension;
using TouchSocket.SerialPorts;
namespace ThingsGateway.Foundation;
/// <summary>

View File

@@ -22,7 +22,7 @@
"PortName": "PortName",
"RemoteUrl": "RemoteUrl",
"RtsEnable": "RtsEnable",
"StreamAsync": "StreamAsync",
"Handshake": "Handshake",
"StopBits": "StopBits"
},
"ThingsGateway.Foundation.ConverterConfig": {

View File

@@ -22,7 +22,7 @@
"PortName": "COM口",
"RemoteUrl": "远程url",
"RtsEnable": "Rts",
"StreamAsync": "串口流读写",
"Handshake": "Handshake",
"StopBits": "停止位"
},
"ThingsGateway.Foundation.ConverterConfig": {

View File

@@ -145,6 +145,7 @@ public class TextFileLogger : ThingsGateway.NewLife.Log.TextFileLog, TouchSocket
}
WriteLog(logLevel, source, message, exception);
}
protected override void Dispose(bool disposing)
{
cache.Remove(CacheKey);

View File

@@ -16,8 +16,6 @@ using ThingsGateway.NewLife.Json.Extension;
using TouchSocket.Core;
using static System.Net.Mime.MediaTypeNames;
namespace ThingsGateway.Gateway.Application;
/// <summary>

View File

@@ -378,6 +378,8 @@ public abstract class DriverBase : AsyncDisposableObject, IDriver
// 记录设备线程已停止的信息
LogMessage?.LogInformation(string.Format(AppResource.DeviceTaskStop, DeviceName));
await Task.Delay(1000).ConfigureAwait(false);
// 执行资源释放操作
await this.SafeDisposeAsync().ConfigureAwait(false);

View File

@@ -138,11 +138,11 @@ public class Channel : ChannelOptionsBase, IPrimaryIdEntity, IBaseDataEntity, IB
public override bool RtsEnable { get; set; }
/// <summary>
/// StreamAsync
/// Handshake
/// </summary>
[SugarColumn(ColumnDescription = "StreamAsync", IsNullable = true)]
[SugarColumn(ColumnDescription = "Handshake", IsNullable = true)]
[AutoGenerateColumn(Visible = false, Filterable = true, Sortable = true)]
public override bool StreamAsync { get; set; } = false;
public override Handshake Handshake { get; set; }
/// <summary>
/// 缓存超时

View File

@@ -307,7 +307,7 @@
"PortName": "PortName",
"RemoteUrl": "RemoteUrl",
"RtsEnable": "RtsEnable",
"StreamAsync": "StreamAsync",
"Handshake": "Handshake",
"SaveChannel": "Add/Modify Channel",
"SortCode": "SortCode",
"StopBits": "StopBits",

View File

@@ -306,7 +306,7 @@
"PortName": "COM口",
"RemoteUrl": "远程url",
"RtsEnable": "Rts",
"StreamAsync": "串口流读写",
"Handshake": "Handshake",
"SaveChannel": "添加/修改通道",
"SortCode": "排序",
"StopBits": "停止位",

View File

@@ -176,8 +176,8 @@ public class ChannelRuntimeService : IChannelRuntimeService
if (restart)
{
await GlobalData.ChannelThreadManage.RestartChannelAsync(newChannelRuntimes).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(_logger).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a=> !newDeviceRuntimes.Contains(a)).ToArray(),_logger).ConfigureAwait(false);
}
return true;
@@ -209,7 +209,7 @@ public class ChannelRuntimeService : IChannelRuntimeService
{
await GlobalData.ChannelThreadManage.RestartChannelAsync(newChannelRuntimes).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(_logger).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => !newDeviceRuntimes.Contains(a)).ToArray(),_logger).ConfigureAwait(false);
}
return true;
@@ -241,7 +241,7 @@ public class ChannelRuntimeService : IChannelRuntimeService
{
await GlobalData.ChannelThreadManage.RestartChannelAsync(newChannelRuntimes).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(_logger).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => !newDeviceRuntimes.Contains(a)).ToArray(),_logger).ConfigureAwait(false);
}
return true;

View File

@@ -110,7 +110,11 @@ internal sealed class ChannelService : BaseService<Channel>, IChannelService
var device = devices.Keys.ToList();
ManageHelper.CheckDeviceCount(device.Count);
foreach (var item in device)
{
item.RedundantEnable = false;
item.RedundantDeviceId = null;
}
await db.Insertable(device).ExecuteCommandAsync().ConfigureAwait(false);
var variable = devices.SelectMany(a => a.Value).ToList();

View File

@@ -205,7 +205,7 @@ public class DeviceRuntimeService : IDeviceRuntimeService
if (restart)
{
await RuntimeServiceHelper.RestartDeviceAsync(newDeviceRuntimes).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(_logger).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => !newDeviceRuntimes.Contains(a)).ToArray(),_logger).ConfigureAwait(false);
}
return true;

View File

@@ -53,7 +53,11 @@ internal sealed class DeviceService : BaseService<Device>, IDeviceService
{
var device = devices.Keys.ToList();
ManageHelper.CheckDeviceCount(device.Count);
foreach (var item in device)
{
item.RedundantEnable = false;
item.RedundantDeviceId = null;
}
await db.Insertable(device).ExecuteCommandAsync().ConfigureAwait(false);
var variable = devices.SelectMany(a => a.Value).ToList();
@@ -263,6 +267,9 @@ internal sealed class DeviceService : BaseService<Device>, IDeviceService
else
ManageHelper.CheckDeviceCount(1);
if (input.RedundantEnable && GlobalData.IsRedundant(input.RedundantDeviceId ?? 0))
throw Oops.Bah($"Redundancy configuration error, backup device has been planned into another redundancy group");
if (await base.SaveAsync(input, type).ConfigureAwait(false))
{

View File

@@ -239,7 +239,7 @@ internal static class RuntimeServiceHelper
if (group.Key != null)
await group.Key.RestartDeviceAsync(group.Value, false).ConfigureAwait(false);
}
foreach (var group in GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => a.Driver?.DeviceThreadManage != null).GroupBy(a => a.Driver.DeviceThreadManage))
foreach (var group in GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a=>!newDeviceRuntimes.Contains(a)).Where(a => a.Driver?.DeviceThreadManage != null).GroupBy(a => a.Driver.DeviceThreadManage))
{
if (group.Key != null)
await group.Key.RestartDeviceAsync(group.ToArray(), false).ConfigureAwait(false);
@@ -260,7 +260,7 @@ internal static class RuntimeServiceHelper
await group.Key.RemoveDeviceAsync(group.Value.Select(a => a.Id).ToArray()).ConfigureAwait(false);
}
foreach (var group in GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => a.Driver?.DeviceThreadManage != null).GroupBy(a => a.Driver.DeviceThreadManage))
foreach (var group in GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => !deviceRuntimes.Contains(a)).Where(a => a.Driver?.DeviceThreadManage != null).GroupBy(a => a.Driver.DeviceThreadManage))
{
if (group.Key != null)
await group.Key.RestartDeviceAsync(group.ToArray(), false).ConfigureAwait(false);
@@ -268,9 +268,9 @@ internal static class RuntimeServiceHelper
}
public static async Task ChangedDriverAsync(ILogger logger)
public static async Task ChangedDriverAsync(DeviceRuntime[] channelDevice, ILogger logger)
{
var channelDevice = GlobalData.GetAllVariableBusinessDeviceRuntime();
await channelDevice.ParallelForEachAsync(async (item, token) =>
{

View File

@@ -398,22 +398,22 @@ public class VariableRuntimeService : IVariableRuntimeService
//批量修改之后,需要重新加载通道
RuntimeServiceHelper.Init(newChannelRuntimes);
{
var newDeviceRuntimes = datas.Item2.AdaptListDeviceRuntime();
RuntimeServiceHelper.Init(newDeviceRuntimes);
}
{
var newVariableRuntimes = datas.Item3.AdaptListVariableRuntime();
RuntimeServiceHelper.Init(newVariableRuntimes);
}
var newDeviceRuntimes = datas.Item2.AdaptListDeviceRuntime();
RuntimeServiceHelper.Init(newDeviceRuntimes);
var newVariableRuntimes = datas.Item3.AdaptListVariableRuntime();
RuntimeServiceHelper.Init(newVariableRuntimes);
//根据条件重启通道线程
if (restart)
{
await GlobalData.ChannelThreadManage.RestartChannelAsync(newChannelRuntimes).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(_logger).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => !newDeviceRuntimes.Contains(a)).ToArray(), _logger).ConfigureAwait(false);
}
}
}
@@ -437,22 +437,21 @@ public class VariableRuntimeService : IVariableRuntimeService
//批量修改之后,需要重新加载通道
RuntimeServiceHelper.Init(newChannelRuntimes);
{
var newDeviceRuntimes = datas.Item2.AdaptListDeviceRuntime();
RuntimeServiceHelper.Init(newDeviceRuntimes);
}
{
var newVariableRuntimes = datas.Item3.AdaptListVariableRuntime();
RuntimeServiceHelper.Init(newVariableRuntimes);
}
var newDeviceRuntimes = datas.Item2.AdaptListDeviceRuntime();
RuntimeServiceHelper.Init(newDeviceRuntimes);
var newVariableRuntimes = datas.Item3.AdaptListVariableRuntime();
RuntimeServiceHelper.Init(newVariableRuntimes);
//根据条件重启通道线程
if (restart)
{
await GlobalData.ChannelThreadManage.RestartChannelAsync(newChannelRuntimes).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(_logger).ConfigureAwait(false);
await RuntimeServiceHelper.ChangedDriverAsync(GlobalData.GetAllVariableBusinessDeviceRuntime().Where(a => !newDeviceRuntimes.Contains(a)).ToArray(), _logger).ConfigureAwait(false);
}
}
}

View File

@@ -114,7 +114,7 @@
<EditorItem @bind-Field="@context.StopBits" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.DtrEnable" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.RtsEnable" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.StreamAsync" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.Handshake" Ignore=@(context.ChannelType != ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.CacheTimeout" Ignore=@(context.ChannelType == ChannelTypeEnum.UdpSession || context.ChannelType == ChannelTypeEnum.Other) />

View File

@@ -82,7 +82,7 @@
<EditorItem @bind-Field="@context.StopBits" Ignore=@(context.ChannelType!=ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.DtrEnable" Ignore=@(context.ChannelType!=ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.RtsEnable" Ignore=@(context.ChannelType!=ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.StreamAsync" Ignore=@(context.ChannelType!=ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.Handshake" Ignore=@(context.ChannelType!=ChannelTypeEnum.SerialPort) />
<EditorItem @bind-Field="@context.CacheTimeout" Ignore=@(context.ChannelType==ChannelTypeEnum.UdpSession||context.ChannelType==ChannelTypeEnum.Other) />

View File

@@ -35,7 +35,8 @@ public partial class RulesPage : ThingsGatewayModuleComponentBase
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
if (firstRender) {
if (firstRender)
{
StateHasChanged();
}
}

View File

@@ -57,10 +57,10 @@ public class ModbusBenchmark : IDisposable
ModbusType = ModbusTypeEnum.ModbusTcp,
};
thingsgatewaymodbus.InitChannel(clientChannel);
await clientChannel.SetupAsync(clientChannel.Config);
await clientChannel.SetupAsync(clientChannel.Config);
clientChannel.Logger.LogLevel = LogLevel.Warning;
await thingsgatewaymodbus.ConnectAsync(CancellationToken.None);
await thingsgatewaymodbus.ReadAsync("40001", 100);
await thingsgatewaymodbus.ConnectAsync(CancellationToken.None);
await thingsgatewaymodbus.ReadAsync("40001", 100);
thingsgatewaymodbuss.Add(thingsgatewaymodbus);
}
@@ -70,7 +70,7 @@ public class ModbusBenchmark : IDisposable
var factory = new NModbus.ModbusFactory();
var nmodbus = factory.CreateMaster(new TcpClient("127.0.0.1", 502));
await nmodbus.ReadHoldingRegistersAsync(1, 0, 100);
await nmodbus.ReadHoldingRegistersAsync(1, 0, 100);
nmodbuss.Add(nmodbus);
}
//for (int i = 0; i < Program.ClientCount; i++)
@@ -86,10 +86,10 @@ public class ModbusBenchmark : IDisposable
for (int i = 0; i < Program.ClientCount; i++)
{
var client = new ModbusTcpMaster();
await client.SetupAsync(new TouchSocketConfig()
.SetRemoteIPHost("127.0.0.1:502"));
await client.ConnectAsync(CancellationToken.None);
await client.ReadHoldingRegistersAsync(0, 100);
await client.SetupAsync(new TouchSocketConfig()
.SetRemoteIPHost("127.0.0.1:502"));
await client.ConnectAsync(CancellationToken.None);
await client.ReadHoldingRegistersAsync(0, 100);
modbusTcpMasters.Add(client);
}
@@ -104,8 +104,8 @@ public class ModbusBenchmark : IDisposable
for (int i = 0; i < Program.ClientCount; i++)
{
var client = factory.GetOrCreateTcpMaster();
await client.ConnectAsync("127.0.0.1", 502);
await client.ReadHoldingRegistersAsync(0x01, 0x00, 10);
await client.ConnectAsync("127.0.0.1", 502);
await client.ReadHoldingRegistersAsync(0x01, 0x00, 10);
_lgbModbusClients.Add(client);
}

View File

@@ -49,12 +49,12 @@ namespace BenchmarkConsoleApp
BenchmarkRunner.Run<MapperBench>(
ManualConfig.Create(DefaultConfig.Instance)
.WithOptions(ConfigOptions.DisableOptimizationsValidator)
);
);
// BenchmarkRunner.Run<ModbusBenchmark>(
// ManualConfig.Create(DefaultConfig.Instance)
// .WithOptions(ConfigOptions.DisableOptimizationsValidator)
//);
// BenchmarkRunner.Run<ModbusBenchmark>(
// ManualConfig.Create(DefaultConfig.Instance)
// .WithOptions(ConfigOptions.DisableOptimizationsValidator)
//);
// BenchmarkRunner.Run<S7Benchmark>(
//ManualConfig.Create(DefaultConfig.Instance)
//.WithOptions(ConfigOptions.DisableOptimizationsValidator)

View File

@@ -14,7 +14,7 @@
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.4">
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>

View File

@@ -14,7 +14,6 @@ using ThingsGateway.Common;
using ThingsGateway.DB;
using ThingsGateway.Debug;
using ThingsGateway.Foundation;
using ThingsGateway.Gateway.Application;
using ThingsGateway.NewLife;
using ThingsGateway.NewLife.Extension;
using ThingsGateway.NewLife.Threading;

View File

@@ -11,8 +11,12 @@
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
#if NET10_0_OR_GREATER
using Microsoft.Extensions.Hosting;
#endif
using MQTTnet.AspNetCore;
using ThingsGateway.Foundation;

View File

@@ -12,7 +12,6 @@ using CSScripting;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using MQTTnet;
using MQTTnet.Internal;
@@ -43,7 +42,7 @@ public partial class MqttServer : BusinessBaseWithCacheIntervalScriptAll
#if NET10_0_OR_GREATER
private IHost _webHost { get; set; }
private Microsoft.Extensions.Hosting.IHost _webHost { get; set; }
#else
private IWebHost _webHost { get; set; }