mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-25 20:53:10 +08:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac3525a953 | ||
|
|
c8c3f5b134 | ||
|
|
51319c0718 | ||
|
|
43399b8b47 | ||
|
|
a6596042b7 | ||
|
|
23ae85fc9c | ||
|
|
2da54862f1 | ||
|
|
f272fb0559 | ||
|
|
bd04e33586 | ||
|
|
b09b9752ca | ||
|
|
a810a48158 | ||
|
|
b4f5792aa8 |
@@ -6,7 +6,7 @@
|
||||
<LangVersion>11.0</LangVersion>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Version>5.0.0.10</Version>
|
||||
<Version>5.0.0.12</Version>
|
||||
<Authors>Diego</Authors>
|
||||
<Company>Diego</Company>
|
||||
<Product>Diego</Product>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net6.0;net7.0;net8.0;</TargetFrameworks>
|
||||
<TargetFrameworks>net6.0;</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -43,7 +43,7 @@ public static class LiteDBCacheUtil
|
||||
var dir = GetFilePath(id);
|
||||
var fileStart = GetFileStartName(typeName);
|
||||
var maxNum = GetMaxNumFileName(id, typeName);
|
||||
var fullName = dir.CombinePath($"{fileStart}{maxNum}{ex}");
|
||||
var fullName = dir.CombinePath($"{fileStart}_{maxNum}{ex}");
|
||||
if (isDeleteRule)
|
||||
{
|
||||
//磁盘使用率限制
|
||||
@@ -59,9 +59,14 @@ public static class LiteDBCacheUtil
|
||||
foreach (var d in dirs)
|
||||
{
|
||||
string[] files = Directory.GetFiles(d);
|
||||
//如果文件数量小于4的,退出循环
|
||||
if (files.Length < 4)
|
||||
{
|
||||
break;
|
||||
}
|
||||
//数量超限就删除旧文件
|
||||
//按文件更改时间降序排序
|
||||
var sortedFiles = files.OrderByDescending(file => File.GetLastWriteTime(file));
|
||||
//按文件更改时间排序
|
||||
var sortedFiles = files.OrderBy(file => File.GetLastWriteTime(file)).ToArray();
|
||||
|
||||
// 需要删除的文件数量
|
||||
int filesToDeleteCount = files.Length - Math.Max(2, (int)(files.Length * 0.1));
|
||||
@@ -69,14 +74,14 @@ public static class LiteDBCacheUtil
|
||||
// 删除较旧的文件
|
||||
for (int i = 0; i < filesToDeleteCount; i++)
|
||||
{
|
||||
var fileName = sortedFiles.ElementAt(i);
|
||||
var fileName = sortedFiles[i];
|
||||
if (_dict.TryGetValue(fileName, out object cache1))
|
||||
{
|
||||
DisposeAndDeleteFile(fileName, cache1);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteFile(fullName);
|
||||
DeleteFile(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,7 +95,7 @@ public static class LiteDBCacheUtil
|
||||
{
|
||||
//数量超限就删除旧文件
|
||||
//按文件更改时间降序排序
|
||||
var sortedFiles = files.OrderByDescending(file => File.GetLastWriteTime(file));
|
||||
var sortedFiles = files.OrderBy(file => File.GetLastWriteTime(file)).ToArray();
|
||||
|
||||
// 需要删除的文件数量
|
||||
int filesToDeleteCount = files.Length - LiteDBCacheUtil.config.MaxFileCount;
|
||||
@@ -98,14 +103,14 @@ public static class LiteDBCacheUtil
|
||||
// 删除较旧的文件
|
||||
for (int i = 0; i < filesToDeleteCount; i++)
|
||||
{
|
||||
var fileName = sortedFiles.ElementAt(i);
|
||||
var fileName = sortedFiles[i];
|
||||
if (_dict.TryGetValue(fileName, out object cache1))
|
||||
{
|
||||
DisposeAndDeleteFile(fileName, cache1);
|
||||
}
|
||||
else
|
||||
{
|
||||
DeleteFile(fullName);
|
||||
DeleteFile(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,7 +131,7 @@ public static class LiteDBCacheUtil
|
||||
if (mb1 > LiteDBCacheUtil.config.MaxFileLength)
|
||||
{
|
||||
//大小超限就返回新的文件
|
||||
var newFullName = dir.CombinePath($"{fileStart}{maxNum + 1}{ex}");
|
||||
var newFullName = dir.CombinePath($"{fileStart}_{maxNum + 1}{ex}");
|
||||
{
|
||||
if (_dict.TryGetValue(fullName, out object cache1))
|
||||
{
|
||||
@@ -239,14 +244,14 @@ public static class LiteDBCacheUtil
|
||||
var fileStart = GetFileStartName(typeName);
|
||||
|
||||
//搜索全部符合条件的文件
|
||||
if (!File.Exists(dir.CombinePath($"{fileStart}{ex}")))
|
||||
if (!File.Exists(dir.CombinePath($"{fileStart}_{ex}")))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
var index = 1;
|
||||
while (true)
|
||||
{
|
||||
var newFileName = dir.CombinePath($"{fileStart}{index}{ex}");
|
||||
var newFileName = dir.CombinePath($"{fileStart}_{index}{ex}");
|
||||
if (System.IO.File.Exists(newFileName))
|
||||
{
|
||||
index++;
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
<Import Project="$(SolutionDir)PackNuget.props" />
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.1.27" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.1.27" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.1.27" />
|
||||
<PackageReference Include="Furion.Pure" Version="4.9.1.28" />
|
||||
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.9.1.28" />
|
||||
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.9.1.28" />
|
||||
<PackageReference Include="NewLife.Redis" Version="5.6.2024.105" />
|
||||
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
|
||||
<PackageReference Include="LiteDB" Version="5.0.17" />
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewLife.Core" Version="10.6.2024.101" />
|
||||
<PackageReference Include="NewLife.Core" Version="10.7.2024.202" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
|
||||
|
||||
#aspnetcore6.0环境
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
EXPOSE 80
|
||||
#linux安装
|
||||
EXPOSE 7200
|
||||
#图像库
|
||||
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ sid main contrib non-free" > /etc/apt/sources.list
|
||||
RUN apt-get update && apt-get -y install libfontconfig1
|
||||
ENTRYPOINT ["dotnet", "ThingsGateway.Web.Server.dll","--urls","http://*:7200"]
|
||||
|
||||
#7200端口
|
||||
ENTRYPOINT ["dotnet", "ThingsGateway.Web.Entry.dll","--urls","http://*:7200"]
|
||||
@@ -22,7 +22,7 @@ public interface IChannel : IConnectObject, ICloseObject, ISetupConfigObject, ID
|
||||
/// <summary>
|
||||
/// 该通道下的所有设备
|
||||
/// </summary>
|
||||
public List<IProtocol> Collects { get; }
|
||||
public ConcurrentList<IProtocol> Collects { get; }
|
||||
|
||||
/// <summary>
|
||||
/// CanSend
|
||||
|
||||
@@ -139,14 +139,14 @@ namespace ThingsGateway.Foundation
|
||||
var byteBlock = new ByteBlock(this.ReceiveBufferSize);
|
||||
try
|
||||
{
|
||||
var r = await Task<int>.Factory.FromAsync(this.m_serialPort.BaseStream.BeginRead, this.m_serialPort.BaseStream.EndRead, byteBlock.Buffer, 0, byteBlock.Capacity, default).ConfigureFalseAwait();
|
||||
var r = await this.m_serialPort.BaseStream.ReadAsync(byteBlock.Buffer, 0, byteBlock.Capacity, default).ConfigureFalseAwait();
|
||||
if (r == 0)
|
||||
{
|
||||
this.PrivateBreakOut(false, FoundationConst.RemoteClose);
|
||||
return;
|
||||
}
|
||||
if (m_serialPort.BytesToRead > 0)
|
||||
r += await Task<int>.Factory.FromAsync(this.m_serialPort.BaseStream.BeginRead, this.m_serialPort.BaseStream.EndRead, byteBlock.Buffer, r, byteBlock.Capacity - r, default);
|
||||
r += await this.m_serialPort.BaseStream.ReadAsync(byteBlock.Buffer, r, byteBlock.Capacity - r, default).ConfigureFalseAwait();
|
||||
|
||||
byteBlock.SetLength(r);
|
||||
this.HandleBuffer(byteBlock);
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace ThingsGateway.Foundation
|
||||
public EasyLock WaitLock { get; } = new EasyLock();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public List<IProtocol> Collects { get; } = new();
|
||||
public ConcurrentList<IProtocol> Collects { get; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// 接收到数据
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace ThingsGateway.Foundation
|
||||
public EasyLock WaitLock { get; } = new EasyLock();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public List<IProtocol> Collects { get; } = new();
|
||||
public ConcurrentList<IProtocol> Collects { get; } = new();
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override void Dispose(bool disposing)
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace ThingsGateway.Foundation
|
||||
public class TgTcpClient : TgTcpClientBase, IClientChannel
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public List<IProtocol> Collects { get; } = new();
|
||||
public ConcurrentList<IProtocol> Collects { get; } = new();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public EasyLock WaitLock { get; } = new EasyLock();
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace ThingsGateway.Foundation
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public List<IProtocol> Collects { get; } = new();
|
||||
public ConcurrentList<IProtocol> Collects { get; } = new();
|
||||
|
||||
#region 事件
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace ThingsGateway.Foundation
|
||||
DataHandlingAdapter IClientChannel.DataHandlingAdapter => DataHandlingAdapter;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public List<IProtocol> Collects { get; } = new();
|
||||
public ConcurrentList<IProtocol> Collects { get; } = new();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public void SetDataHandlingAdapter(DataHandlingAdapter adapter)
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NewLife.Core" Version="10.6.2024.101" />
|
||||
<PackageReference Include="NewLife.Core" Version="10.7.2024.202" />
|
||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||
<PackageReference Include="TouchSocket" Version="2.0.0-beta.270" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*Dlt645*.dll" %25dir%25






cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*Dlt645*.dll" "!dir!"
)

endlocal
" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*Kafka*.dll" %25dir%25


cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*Kafka*.dll" "!dir!"
)

endlocal
" />
|
||||
</Target>
|
||||
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*Modbus*.dll" %25dir%25





cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*Modbus*.dll" "!dir!"
)

endlocal

" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -110,7 +110,7 @@ public partial class MqttClient : BusinessBaseWithCacheIntervalScript<VariableDa
|
||||
success = clientResult.IsSuccess;
|
||||
}
|
||||
await Delay(cancellationToken);
|
||||
return;
|
||||
//return;
|
||||
}
|
||||
|
||||
await Update(cancellationToken);
|
||||
|
||||
@@ -295,7 +295,7 @@ public partial class MqttClient : BusinessBaseWithCacheIntervalScript<VariableDa
|
||||
if (isConnect.IsSuccess)
|
||||
{
|
||||
var variableMessage = new MqttApplicationMessageBuilder()
|
||||
.WithTopic(topic)
|
||||
.WithTopic(topic).WithRetainFlag(true)
|
||||
.WithPayload(payLoad).Build();
|
||||
var result = await _mqttClient.PublishAsync(variableMessage, cancellationToken);
|
||||
if (result.IsSuccess)
|
||||
|
||||
@@ -207,13 +207,19 @@ public partial class MqttServer : BusinessBaseWithCacheIntervalScript<VariableDa
|
||||
arg.ReasonCode = MqttConnectReasonCode.BadUserNameOrPassword;
|
||||
return;
|
||||
}
|
||||
|
||||
List<MqttApplicationMessage> data = GetRetainedMessages();
|
||||
foreach (var item in data)
|
||||
{
|
||||
await _mqttServer.UpdateRetainedMessageAsync(item);
|
||||
}
|
||||
LogMessage?.LogInformation($"{ToString()}-{arg.ClientId}-客户端已连接成功");
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
//延时发送
|
||||
await Task.Delay(1000);
|
||||
List<MqttApplicationMessage> data = GetRetainedMessages();
|
||||
foreach (var item in data)
|
||||
{
|
||||
await _mqttServer.InjectApplicationMessage(
|
||||
new InjectedMqttApplicationMessage(item));
|
||||
//await _mqttServer.UpdateRetainedMessageAsync(item);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*Mqtt*.dll" %25dir%25


cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)
for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)
" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*Mqtt*.dll" "!dir!"
)

endlocal
" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*OpcDa*.dll" %25dir%25






cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*OpcDa*.dll" "!dir!"
)

endlocal


" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*OpcUa*.dll" %25dir%25
copy "$(TargetDir)*Opc.Ua*.dll" %25dir%25
copy "$(TargetDir)*System.Formats.Asn1*.dll" %25dir%25

cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)
for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*OpcUa*.dll" "!dir!"
 copy "$(TargetDir)*Opc.Ua*.dll" "!dir!"
 copy "$(TargetDir)*System.Formats.Asn1*.dll" "!dir!"
)

endlocal


" />
|
||||
</Target>
|
||||
<ItemGroup>
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*QuestDB*.dll" %25dir%25





cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*QuestDB*.dll" "!dir!"
)

endlocal
" />
|
||||
</Target>
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*RabbitMQ*.dll" %25dir%25


cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)
" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*RabbitMQ*.dll" "!dir!"
)

endlocal
" />
|
||||
</Target>
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*Siemens*.dll" %25dir%25





cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*Siemens*.dll" "!dir!"

)

endlocal


" />
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*SqlDB*.dll" %25dir%25




cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*SqlDB*.dll" "!dir!"
)

endlocal
" />
|
||||
</Target>
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*SqlHisAlarm*.dll" %25dir%25




cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*SqlHisAlarm*.dll" "!dir!"
)

endlocal
" />
|
||||
</Target>
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*TDengineDB*.dll" %25dir%25






cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*TDengineDB*.dll" "!dir!"
)

endlocal
" />
|
||||
</Target>
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||
|
||||
<Exec Command=" set dir="$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\$(TargetFramework)\Plugins\$(AssemblyName)"
 if not exist %25dir%25 md %25dir%25 
copy "$(TargetDir)*VariableExpression*.dll" %25dir%25







cd /d "$(TargetDir)"
::设置要排除的文件格式,多个格式之间使用英文逗号隔开
set Ext=dll
::删除文件
for /f "delims=" %25%25a in ('dir /a-d/s/b') do (
 if /i not "%25%25~a"=="%25~f0" (
 set "Skip="
 for %25%25i in (%25Ext%25) do (
 if /i ".%25%25~i"=="%25%25~xa" (
 set Skip=OK
 )
 )
 if not defined Skip (
 del /f /q "%25%25~a"
 )
 )
)

for /d %25%25i in (*) do (
 rd /s /q "%25%25i"
)

" />
|
||||
<Exec Command="@echo off
setlocal enabledelayedexpansion

set "targetFWS=net6.0 net7.0 net8.0"
for %25%25f in (%25targetFWS%25) do (
 set "dir=$(SolutionDir)bin\$(Configuration)\ThingsGateway.Web.Entry\%25%25f\Plugins\$(AssemblyName)"
 if not exist "!dir!" md "!dir!"
 copy "$(TargetDir)*VariableExpression*.dll" "!dir!"

)

endlocal


" />
|
||||
</Target>
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user