From fbe8013ff92c7ecd931fa07ce5e338d6075d2465 Mon Sep 17 00:00:00 2001 From: tmoonlight Date: Sun, 18 Aug 2024 23:51:19 +0800 Subject: [PATCH] downgrade to .net 6.0 fix trimmed problem --- .../NSmartProxy.ClientRouter.csproj | 2 +- src/NSmartProxy.Data/NSmartProxy.Data.csproj | 2 +- .../NSmartProxy.Infrastructure.csproj | 3 +-- src/NSmartProxy.Infrastructure/Shared/NSPVersion.cs | 4 ++-- src/NSmartProxy.Infrastructure/Shared/NSPVersion.tt | 4 ++-- src/NSmartProxy.Infrastructure/StringUtil.cs | 5 ----- src/NSmartProxy.ServerHost/Dockerfile | 2 +- .../NSmartProxy.ServerHost.csproj | 4 ++-- src/NSmartProxy/NSmartProxy.csproj | 2 +- src/NSmartProxyClient/Dockerfile | 2 +- src/NSmartProxyClient/NSmartProxyClient.csproj | 4 ++-- .../NSmartProxy.ConsoleTest.csproj | 2 +- src/build.cmd | 12 ++++++------ 13 files changed, 21 insertions(+), 27 deletions(-) diff --git a/src/NSmartProxy.ClientRouter/NSmartProxy.ClientRouter.csproj b/src/NSmartProxy.ClientRouter/NSmartProxy.ClientRouter.csproj index deb7e6c..58102fb 100644 --- a/src/NSmartProxy.ClientRouter/NSmartProxy.ClientRouter.csproj +++ b/src/NSmartProxy.ClientRouter/NSmartProxy.ClientRouter.csproj @@ -1,7 +1,7 @@  - net8.0;netstandard2.0 + net6.0;netstandard2.0 diff --git a/src/NSmartProxy.Data/NSmartProxy.Data.csproj b/src/NSmartProxy.Data/NSmartProxy.Data.csproj index b98d7ca..899c684 100644 --- a/src/NSmartProxy.Data/NSmartProxy.Data.csproj +++ b/src/NSmartProxy.Data/NSmartProxy.Data.csproj @@ -1,7 +1,7 @@  - netstandard2.0;net8.0 + netstandard2.0;net6.0 diff --git a/src/NSmartProxy.Infrastructure/NSmartProxy.Infrastructure.csproj b/src/NSmartProxy.Infrastructure/NSmartProxy.Infrastructure.csproj index c8159bc..f61be2c 100644 --- a/src/NSmartProxy.Infrastructure/NSmartProxy.Infrastructure.csproj +++ b/src/NSmartProxy.Infrastructure/NSmartProxy.Infrastructure.csproj @@ -1,12 +1,11 @@ - netstandard2.0;net8.0 + netstandard2.0;net6.0 True - diff --git a/src/NSmartProxy.Infrastructure/Shared/NSPVersion.cs b/src/NSmartProxy.Infrastructure/Shared/NSPVersion.cs index 4d7a480..81fb4ff 100644 --- a/src/NSmartProxy.Infrastructure/Shared/NSPVersion.cs +++ b/src/NSmartProxy.Infrastructure/Shared/NSPVersion.cs @@ -2,6 +2,6 @@ public sealed class NSPVersion { public const string NO_TOKEN_STRING = "notoken"; - public const string NSmartProxyClientName = "NSmartProxy Client v1.3.7231.7118"; - public const string NSmartProxyServerName = "NSmartProxy Server v1.3.7231.7118"; + public const string NSmartProxyClientName = "NSmartProxy Client v1.4.8596.1967"; + public const string NSmartProxyServerName = "NSmartProxy Server v1.4.8596.1967"; } \ No newline at end of file diff --git a/src/NSmartProxy.Infrastructure/Shared/NSPVersion.tt b/src/NSmartProxy.Infrastructure/Shared/NSPVersion.tt index 25822f5..ee15da4 100644 --- a/src/NSmartProxy.Infrastructure/Shared/NSPVersion.tt +++ b/src/NSmartProxy.Infrastructure/Shared/NSPVersion.tt @@ -11,6 +11,6 @@ public sealed class NSPVersion { public const string NO_TOKEN_STRING = "notoken"; - public const string NSmartProxyClientName = "NSmartProxy Client v1.3.<#=v1#>.<#=v2#>"; - public const string NSmartProxyServerName = "NSmartProxy Server v1.3.<#=v1#>.<#=v2#>"; + public const string NSmartProxyClientName = "NSmartProxy Client v1.4.<#=v1#>.<#=v2#>"; + public const string NSmartProxyServerName = "NSmartProxy Server v1.4.<#=v1#>.<#=v2#>"; } \ No newline at end of file diff --git a/src/NSmartProxy.Infrastructure/StringUtil.cs b/src/NSmartProxy.Infrastructure/StringUtil.cs index a62339d..277401f 100644 --- a/src/NSmartProxy.Infrastructure/StringUtil.cs +++ b/src/NSmartProxy.Infrastructure/StringUtil.cs @@ -7,7 +7,6 @@ using System.Text; using NSmartProxy.Data; using NSmartProxy.Infrastructure; -using EasyCompressor; using System.Threading; using System.Threading.Tasks; using Snappy.Sharp; @@ -16,10 +15,6 @@ namespace NSmartProxy { public static class StringUtil { - //Lazy初始化一个snappier - private static Lazy _snappyCompressor = new Lazy(() => SnappierCompressor.Shared); - - /// /// 整型转双字节 /// diff --git a/src/NSmartProxy.ServerHost/Dockerfile b/src/NSmartProxy.ServerHost/Dockerfile index 171ea98..9884c1d 100644 --- a/src/NSmartProxy.ServerHost/Dockerfile +++ b/src/NSmartProxy.ServerHost/Dockerfile @@ -16,7 +16,7 @@ #ENTRYPOINT ["dotnet", "NSmartProxy.ServerHost.dll"] #need combile 1st. -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS runtime +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS runtime WORKDIR /app COPY / /app/ EXPOSE 12300-22300 diff --git a/src/NSmartProxy.ServerHost/NSmartProxy.ServerHost.csproj b/src/NSmartProxy.ServerHost/NSmartProxy.ServerHost.csproj index 2dbfd03..f1ac570 100644 --- a/src/NSmartProxy.ServerHost/NSmartProxy.ServerHost.csproj +++ b/src/NSmartProxy.ServerHost/NSmartProxy.ServerHost.csproj @@ -2,8 +2,8 @@ Exe - net8.0 - True + net6.0 + diff --git a/src/NSmartProxy/NSmartProxy.csproj b/src/NSmartProxy/NSmartProxy.csproj index e3b166f..76b4bfe 100644 --- a/src/NSmartProxy/NSmartProxy.csproj +++ b/src/NSmartProxy/NSmartProxy.csproj @@ -2,7 +2,7 @@ Library - net8.0 + net6.0 diff --git a/src/NSmartProxyClient/Dockerfile b/src/NSmartProxyClient/Dockerfile index 0fc2479..07dc330 100644 --- a/src/NSmartProxyClient/Dockerfile +++ b/src/NSmartProxyClient/Dockerfile @@ -1,6 +1,6 @@  #need combile 1st. -FROM mcr.microsoft.com/dotnet/sdk:8.0 AS runtime +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS runtime WORKDIR /app COPY / /app/ ENTRYPOINT ["dotnet", "NSmartProxyClient.dll"] \ No newline at end of file diff --git a/src/NSmartProxyClient/NSmartProxyClient.csproj b/src/NSmartProxyClient/NSmartProxyClient.csproj index 71207ea..db1a13e 100644 --- a/src/NSmartProxyClient/NSmartProxyClient.csproj +++ b/src/NSmartProxyClient/NSmartProxyClient.csproj @@ -2,8 +2,7 @@ Exe - net8.0 - True + net6.0 @@ -20,6 +19,7 @@ + diff --git a/src/TestBed/NSmartProxy.ConsoleTest/NSmartProxy.ConsoleTest.csproj b/src/TestBed/NSmartProxy.ConsoleTest/NSmartProxy.ConsoleTest.csproj index b26c5b9..f7aff01 100644 --- a/src/TestBed/NSmartProxy.ConsoleTest/NSmartProxy.ConsoleTest.csproj +++ b/src/TestBed/NSmartProxy.ConsoleTest/NSmartProxy.ConsoleTest.csproj @@ -2,7 +2,7 @@ Exe - net8.0 + net6.0 diff --git a/src/build.cmd b/src/build.cmd index 6c8203f..fce1c54 100644 --- a/src/build.cmd +++ b/src/build.cmd @@ -1,12 +1,12 @@ rem windows only -rem NSP v1.4.0 +rem NSP v1.4.1 @ECHO on -set Ver=v1.4.0 +set Ver=v1.4.1 set BuildPath=%~dp0../build -set nsp_client_path=%BuildPath%/nspclient_%Ver% -set nsp_server_path=%BuildPath%/nspserver_%Ver% +set nsp_client_path=%BuildPath%/nspclient_unity_%Ver% +set nsp_server_path=%BuildPath%/nspserver_unity_%Ver% set nsp_client_scd_linux_path=%BuildPath%/nspclient_scd_linux_%Ver% set nsp_client_scd_win_path=%BuildPath%/nspclient_scd_win_x86_%Ver% @@ -25,10 +25,10 @@ set nsp_client_winfform_path=%BuildPath%/nspclient_winform_%Ver% rem del %~dp0/../build/*.* rem NSPClient -dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -c release -o %nsp_client_path% +dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -c release -o %nsp_client_path% /p:PublishTrimmed=false rem NSPServer -dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -c release -o %nsp_server_path% +dotnet publish .\NSmartProxy.ServerHost\NSmartProxy.ServerHost.csproj -c release -o %nsp_server_path% /p:PublishTrimmed=false rem NSPClient_SCD dotnet publish .\NSmartProxyClient\NSmartProxyClient.csproj -r linux-x64 -c Release /p:PublishSingleFile=true -o %nsp_client_scd_linux_path%