فهرست منبع

freestyle optimize

Lith 10 ماه پیش
والد
کامیت
b27363e1f4
20فایلهای تغییر یافته به همراه140 افزوده شده و 214 حذف شده
  1. 0 31
      Publish/DevOps3/build-cmd/40.Station-publish(net5.0).bat
  2. 0 31
      Publish/DevOps3/build-cmd/40.Station-publish(netcoreapp2.1).bat
  3. 2 2
      dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.csproj
  4. 3 3
      dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.LocalApi.MsTest/Sers.Core.Module.LocalApi.MsTest.csproj
  5. 3 3
      dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.Rpc.MsTest/Sers.Core.Module.Rpc.MsTest.csproj
  6. 3 3
      dotnet/Library/Sers/Sers.Core/Test/Sers.Core.MsTest/Sers.Core.MsTest.csproj
  7. 2 7
      dotnet/Library/Sers/Sers.Gateway/Sers.Gateway/Sers.Gateway.csproj
  8. 3 3
      dotnet/Library/Sers/Sers.Hardware/Sers.Hardware/Usage/WindowsUsageReader.cs
  9. 4 10
      dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/Sers.Serslot.csproj
  10. 2 2
      dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/SerslotServer.ProcessRequestByRpcAsync.cs
  11. 3 2
      dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/SerslotServer.cs
  12. 63 62
      dotnet/Library/Sers/Sers.ServiceStation/Sers.ServiceStation/ServiceStation.cs
  13. 3 3
      dotnet/Library/Vit/Vit.Core/Test/Vit.Core.MsTest/Vit.Core.MsTest.csproj
  14. 3 3
      dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Threading.MsTest/Vit.Core.Util.Threading.MsTest.csproj
  15. 26 26
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Reflection/ObjectLoader.cs
  16. 6 8
      dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Shell/OsShell.cs
  17. 1 1
      dotnet/Library/Vit/Vit.Core/Vit.Core/Vit.Core.csproj
  18. 5 4
      dotnet/Library/Vit/Vit.Net.Http.FormFile/Vit.Net.Http.FormFile.csproj
  19. 4 4
      dotnet/Library/Vit/Vit.WebHost/Host.cs
  20. 4 6
      dotnet/Library/Vit/Vit.WebHost/Vit.WebHost.csproj

+ 0 - 31
Publish/DevOps3/build-cmd/40.Station-publish(net5.0).bat

@@ -1,31 +0,0 @@
-@echo off
-
-
-:: #1 init
-set netVersion=net5.0
-
-
-:: #2 change netcore version
-VsTool.exe replace -r --path "../../.." --file "App.Gateway.csproj|App.Gover.Gateway.csproj|App.ServiceCenter.csproj|Did.SersLoader.Demo.csproj|App.Robot.Station.csproj" --old "<TargetFramework>net6.0</TargetFramework>" --new "<TargetFramework>%netVersion%</TargetFramework>"
-
-
-
-
-
-:: #3 publish
-call "40.Station-publish.bat"
-
-
-
-
-
-
-:: #4 revert netcore version
-VsTool.exe replace -r --path "../../.." --file "App.Gateway.csproj|App.Gover.Gateway.csproj|App.ServiceCenter.csproj|Did.SersLoader.Demo.csproj|App.Robot.Station.csproj" --old "<TargetFramework>%netVersion%</TargetFramework>" --new "<TargetFramework>net6.0</TargetFramework>"
-
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 0 - 31
Publish/DevOps3/build-cmd/40.Station-publish(netcoreapp2.1).bat

@@ -1,31 +0,0 @@
-@echo off
-
-
-:: #1 init
-set netVersion=netcoreapp2.1
-
-
-:: #2 change netcore version
-VsTool.exe replace -r --path "../../.." --file "App.Gateway.csproj|App.Gover.Gateway.csproj|App.ServiceCenter.csproj|Did.SersLoader.Demo.csproj|App.Robot.Station.csproj" --old "<TargetFramework>net6.0</TargetFramework>" --new "<TargetFramework>%netVersion%</TargetFramework>"
-
-
-
-
-
-:: #3 publish
-call "40.Station-publish.bat"
-
-
-
-
-
-
-:: #4 revert netcore version
-VsTool.exe replace -r --path "../../.." --file "App.Gateway.csproj|App.Gover.Gateway.csproj|App.ServiceCenter.csproj|Did.SersLoader.Demo.csproj|App.Robot.Station.csproj" --old "<TargetFramework>%netVersion%</TargetFramework>" --new "<TargetFramework>net6.0</TargetFramework>"
-
-
-
-
-
-echo %~n0.bat success
-cd /d "%curPath%"

+ 2 - 2
dotnet/Library/Sers/Sers.Core/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken/Sers.Core.Module.Api.ApiEvent.BeforeCallApi.JsonWebToken.csproj

@@ -20,8 +20,8 @@
     </ItemGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="6.31.0" />
-        <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.31.0" />
+        <PackageReference Include="Microsoft.IdentityModel.Tokens" Version="7.6.2" />
+        <PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.6.2" />
     </ItemGroup>
 
 </Project>

+ 3 - 3
dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.LocalApi.MsTest/Sers.Core.Module.LocalApi.MsTest.csproj

@@ -7,9 +7,9 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
+        <PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
+        <PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
     </ItemGroup>
 
     <ItemGroup>

+ 3 - 3
dotnet/Library/Sers/Sers.Core/Test/Sers.Core.Module.Rpc.MsTest/Sers.Core.Module.Rpc.MsTest.csproj

@@ -7,9 +7,9 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
+        <PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
+        <PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
     </ItemGroup>
 
     <ItemGroup>

+ 3 - 3
dotnet/Library/Sers/Sers.Core/Test/Sers.Core.MsTest/Sers.Core.MsTest.csproj

@@ -7,9 +7,9 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
+        <PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
+        <PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
     </ItemGroup>
 
     <ItemGroup>

+ 2 - 7
dotnet/Library/Sers/Sers.Gateway/Sers.Gateway/Sers.Gateway.csproj

@@ -5,7 +5,7 @@
     </PropertyGroup>
 
     <PropertyGroup>
-        <TargetFramework>netstandard2.0</TargetFramework>
+        <TargetFramework>net6.0</TargetFramework>
         <Version>2.1.25-temp</Version>
     </PropertyGroup>
 
@@ -17,14 +17,9 @@
 
 
     <PropertyGroup>
-        <DocumentationFile>bin\Debug\netstandard2.0\Sers.Gateway.xml</DocumentationFile>
+        <DocumentationFile>bin\Debug\net6.0\Sers.Gateway.xml</DocumentationFile>
     </PropertyGroup>
 
-
-    <ItemGroup>
-        <PackageReference Include="Microsoft.AspNetCore" Version="2.1.7" />
-    </ItemGroup>
-
     <ItemGroup>
         <ProjectReference Include="..\..\..\Vit\Vit.WebHost\Vit.WebHost.csproj" />
         <ProjectReference Include="..\..\Sers.ServiceStation\Sers.ServiceStation\Sers.ServiceStation.csproj" />

+ 3 - 3
dotnet/Library/Sers/Sers.Hardware/Sers.Hardware/Usage/WindowsUsageReader.cs

@@ -46,7 +46,7 @@ namespace Sers.Hardware.Usage
             return new UsageStatus();
 
             // Cpu:2.8,Memory:34.72,NetworkIn:0,NetworkOut:0
-            string usageInfo=null;           
+            string usageInfo = null;
             try
             {
                 lock (this)
@@ -112,12 +112,12 @@ namespace Sers.Hardware.Usage
 
                 try
                 {
-                    process.Kill(); 
+                    process.Kill();
                 }
                 catch { }
 
                 try
-                {                   
+                {
                     process.Dispose();
                 }
                 catch { }

+ 4 - 10
dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/Sers.Serslot.csproj

@@ -5,29 +5,23 @@
     </PropertyGroup>
 
     <PropertyGroup>
-        <TargetFramework>netstandard2.0</TargetFramework>
+        <TargetFramework>net6.0</TargetFramework>
         <Version>2.1.25-temp</Version>
     </PropertyGroup>
 
     <PropertyGroup>
         <Authors>Lith</Authors>
-        <Description>
-            Sers微服务-Serslot。AspNetCore原生WebApi的接入适配器。
-            更新日志:
-            在兼容AspNetCore2.1的同时,兼容 AspNetCore3.0、 AspNetCore3.1、 AspNetCore5.0、AspNetCore6.0。
-            构造Api描述数据时剔除接口参数中指定FromService的参数。
-        </Description>
+        <Description>Sers Microservices - Serslot. An integration adapter for native AspNetCore WebApi</Description>
         <PackageProjectUrl>https://github.com/serset/Sers</PackageProjectUrl>
     </PropertyGroup>
 
     <PropertyGroup>
-        <DocumentationFile>bin\Debug\netstandard2.0\Sers.Serslot.xml</DocumentationFile>
+        <DocumentationFile>bin\Debug\net6.0\Sers.Serslot.xml</DocumentationFile>
         <Copyright />
     </PropertyGroup>
 
-
     <ItemGroup>
-        <PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.38" />
+        <PackageReference Include="Microsoft.AspNetCore.App" />
     </ItemGroup>
 
 

+ 2 - 2
dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/SerslotServer.ProcessRequestByRpcAsync.cs

@@ -17,7 +17,7 @@ namespace Sers.Serslot
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public byte[] ProcessRequestByRpc(ArraySegment<byte> arg_OriData)
         {
-         
+
             HttpRequestFeature requestFeature = null;
             IHttpResponseFeature responseFeature = null;
             try
@@ -28,7 +28,7 @@ namespace Sers.Serslot
                 requestFeature = rpcContext.BuildHttpRequestFeature();
 
                 //(x.2) ProcessRequest
-                responseFeature = ProcessRequest(requestFeature);         
+                responseFeature = ProcessRequest(requestFeature);
 
 
                 #region (x.3)build reply

+ 3 - 2
dotnet/Library/Sers/Sers.Serslot/Sers.Serslot/SerslotServer.cs

@@ -6,6 +6,7 @@ using System.Threading.Tasks;
 using Microsoft.AspNetCore.Hosting;
 using Microsoft.AspNetCore.Hosting.Server;
 using Microsoft.AspNetCore.Http.Features;
+using Microsoft.Extensions.Hosting;
 
 using Vit.Core.Module.Log;
 using Vit.Extensions;
@@ -32,7 +33,7 @@ namespace Sers.Serslot
 
 
 
-        #region ProcessRequest       
+        #region ProcessRequest
 
         Action<FeatureCollection> OnProcessRequest;
 
@@ -106,7 +107,7 @@ namespace Sers.Serslot
                 ServiceStation.ServiceStation.Init();
                 Sers.Core.Module.App.SersApplication.onStop += () =>
                 {
-                    if (serviceProvider.GetService(typeof(IApplicationLifetime)) is IApplicationLifetime lifetime)
+                    if (serviceProvider.GetService(typeof(IHostApplicationLifetime)) is IHostApplicationLifetime lifetime)
                     {
                         lifetime.StopApplication();
                     }

+ 63 - 62
dotnet/Library/Sers/Sers.ServiceStation/Sers.ServiceStation/ServiceStation.cs

@@ -1,27 +1,28 @@
-using Newtonsoft.Json;
-using Vit.Extensions;
-using Sers.Core.Module.Api;
-using Sers.Core.Module.App;
-using Vit.Core.Module.Log;
-using System;
-using System.Reflection;
-using Sers.Core.Module.Api.LocalApi;
-using Sers.Core.Module.PubSub;
-using Vit.Core.Util.ConfigurationManager;
+using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Reflection;
+using System.Threading.Tasks;
+
+using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
+
 using Sers.Core.CL.CommunicationManage;
 using Sers.Core.CL.MessageOrganize;
+using Sers.Core.Module.Api;
+using Sers.Core.Module.Api.LocalApi;
+using Sers.Core.Module.App;
+using Sers.Core.Module.App.AppEvent;
 using Sers.Core.Module.Env;
 using Sers.Core.Module.Message;
-using Vit.Core.Util.ComponentModel.Data;
-using System.Threading.Tasks;
+using Sers.Core.Module.PubSub;
 using Sers.SersLoader;
-using Sers.Core.Module.App.AppEvent;
-using Newtonsoft.Json.Linq;
-using Vit.Core.Util.Pipelines;
+
+using Vit.Core.Module.Log;
+using Vit.Core.Util.ComponentModel.Data;
+using Vit.Core.Util.ConfigurationManager;
+using Vit.Extensions;
 using Vit.Extensions.Newtonsoft_Extensions;
-using Vit.Extensions.Json_Extensions;
 using Vit.Extensions.Object_Serialize_Extensions;
 
 namespace Sers.ServiceStation
@@ -36,37 +37,37 @@ namespace Sers.ServiceStation
         public static readonly ServiceStation Instance = new ServiceStation();
 
         /// <summary>
-        /// 使用默认步骤启动站点
+        /// Start the station using the default steps
         /// </summary>
         public static void AutoRun()
         {
-            //手动指定Station版本号
+            // Manually specify the Station version number
             //Sers.Core.Module.App.SersApplication.serviceStationInfo.stationVersion = "2.0.1";
 
 
-            //(x.1) Init
+            // #1 Init
             ServiceStation.Init();
 
-            //(x.2) Discovery
+            // #2 Discovery
             //ServiceStation.Instance.LoadSersApi(typeof(Program).Assembly);
             //ServiceStation.Instance.LoadSersApi(typeof(Program).Assembly, new Sers.Core.Module.ApiLoader.ApiLoaderConfig { apiStationName = "Demo" });
             ServiceStation.Instance.LoadApi();
 
-            //(x.3) Start
+            // #3 Start
             ServiceStation.Start();
 
 
-            //(x.4) RunAwait
+            // #4 RunAwait
             ServiceStation.RunAwait();
 
         }
 
 
 
-        #region (x.1) Init
+        #region #1 Init
 
         /// <summary>
-        /// 初始化ServiceStation
+        /// init ServiceStation
         /// </summary>
         public static void Init()
         {
@@ -77,11 +78,11 @@ namespace Sers.ServiceStation
 
 
 
-        #region (x.2) Start
+        #region #2 Start
         /// <summary>
-        /// 是否成功启动站点
+        ///
         /// </summary>
-        /// <returns></returns>
+        /// <returns>Whether the station started successfully</returns>
         public static bool Start()
         {
             return Instance.StartStation();
@@ -90,14 +91,14 @@ namespace Sers.ServiceStation
 
 
 
-        //(x.3) Stop
+        // #3 Stop
         public static void Stop()
         {
             Instance.StopStation();
         }
 
 
-        //(x.4) RunAwait
+        // #4 RunAwait
         public static void RunAwait()
         {
             SersApplication.RunAwait();
@@ -113,7 +114,7 @@ namespace Sers.ServiceStation
         }
 
 
-        #region (x.1) 成员对象
+        #region #1 成员对象
 
         List<IAppEvent> appEventList { get; set; }
 
@@ -125,17 +126,17 @@ namespace Sers.ServiceStation
 
 
 
-        #region (x.2) InitStation
+        #region #2 InitStation
 
         public void InitStation()
         {
             Logger.Info("[ServiceStation] initializing", new { AssemblyVersion = SersEnvironment.GetEntryAssemblyVersion() });
 
-            //(x.0) appEvent BeforeStart
+            // ##1 appEvent BeforeStart
             appEventList?.ForEach(ev => ev.BeforeStart());
 
 
-            #region (x.1)CL add builder for Iocp/ThreadWait
+            #region ##2 CL add builder for Iocp/ThreadWait
             communicationManage.BeforeBuildOrganize = (configs, organizeList) =>
             {
                 var builderTypeList = new[] {
@@ -158,10 +159,10 @@ namespace Sers.ServiceStation
             };
             #endregion
 
-            //(x.2) localApiService
+            // ##3 localApiService
             localApiService.Init();
 
-            //(x.3) UsageReporter
+            // ##4 UsageReporter
             UsageReporter.UseUsageReporter();
 
         }
@@ -169,11 +170,11 @@ namespace Sers.ServiceStation
 
 
 
-        #region (x.3) LoadApi
+        #region #3 LoadApi
 
         /// <summary>
-        /// 从配置文件(appsettings.json::Sers.LocalApiService.ApiLoaders )  加载api加载器并加载api
-        /// 从配置文件(appsettings.json::Sers.LocalApiService.StaticFileMap)加载静态文件映射器
+        /// Load ApiLoaders and load the APIs from the configuration file (appsettings.json::Sers.LocalApiService.ApiLoaders)
+        /// Load API for static files from the configuration file (appsettings.json::Sers.LocalApiService.StaticFileMap)
         /// </summary>
         public void LoadApi()
         {
@@ -183,7 +184,7 @@ namespace Sers.ServiceStation
 
 
         /// <summary>
-        /// 调用SsApi加载器加载api
+        /// Invoke the SsApi loader to load the APIs
         /// </summary> 
         /// <param name="config"></param>
         public void LoadSersApi(ApiLoaderConfig config)
@@ -193,7 +194,7 @@ namespace Sers.ServiceStation
 
 
         /// <summary>
-        /// 调用SsApi加载器加载api
+        /// Invoke the SsApi loader to load the APIs
         /// </summary>
         /// <param name="assembly"></param>
         /// <param name="config"></param>
@@ -208,27 +209,27 @@ namespace Sers.ServiceStation
 
 
 
-        #region (x.4) StartStation
+        #region #4 StartStation
 
         /// <summary>
-        /// 是否成功启动站点
+        ///
         /// </summary>
-        /// <returns></returns>
+        /// <returns>Whether the station started successfully</returns>
         public bool StartStation()
         {
             Logger.Info("[ServiceStation] starting ...");
 
-            //(x.0) appEvent OnStart
+            // #0 appEvent OnStart
             appEventList?.ForEach(ev => ev.OnStart());
 
-            #region (x.1)注册主程序退出回调
+            #region #1 Register the main program exit callback
             AppDomain.CurrentDomain.ProcessExit += (s, e) =>
             {
                 StopStation();
             };
             #endregion
 
-            #region (x.2) CL 注册回调
+            #region #2 CL Register callback
 
             communicationManage.conn_OnGetMessage = MessageClient.Instance.OnGetMessage;
 
@@ -247,7 +248,7 @@ namespace Sers.ServiceStation
             #endregion
 
 
-            #region (x.3) CL 连接服务器
+            #region #3 CL connect to server
 
             Logger.Info("[CL] Connect - trying...");
 
@@ -262,7 +263,7 @@ namespace Sers.ServiceStation
 
 
 
-            #region (x.4) 初始化ApiClient
+            #region #4  init ApiClient
             ApiClient.SetOnSendRequest(
                 communicationManage.organizeList.Select(organize => organize.conn)
                 .Select<IOrganizeConnection, Action<ApiMessage, Action<ArraySegment<byte>>>>(
@@ -280,10 +281,10 @@ namespace Sers.ServiceStation
             #endregion
 
 
-            //(x.5) 启动 localApiService服务
+            // #5 start localApiService
             localApiService.Start();
 
-            #region (x.6)向服务中心注册localApiService
+            #region #6 register localApiService to ServiceCenter
             //if (0 < localApiMng.apiCount)
             {
                 Logger.Info("[ServiceStation] regist serviceStation to ServiceCenter...");
@@ -316,22 +317,22 @@ namespace Sers.ServiceStation
                     }
 
 
-                    #region (x.x.2)后台获取机器码,并向服务中心提交(获取机器码比较耗时,故后台获取)
+                    #region  Retrieve the machine code in the background and push it to the service center (since retrieving the machine code is time-consuming, so it's done in the background).
                     Task.Run(() =>
                     {
                         try
                         {
-                            //(x.x.x.1)计算  DeviceUnqueKey 和 ServiceStationUnqueKey
+                            // ##1 calculate DeviceUnqueKey and ServiceStationUniqueKey
                             SersApplication.CalculateUniquekey();
 
-                            //(x.x.x.2)构建api参数
+                            // ##2 get arguments
                             var strServiceStationData = new
                             {
                                 serviceStationInfo = SersApplication.serviceStationInfo,
                                 deviceInfo = SersApplication.deviceInfo
                             }.Serialize();
 
-                            //(x.x.x.3)调用api
+                            // ##3 call api to update station info
                             foreach (var apiClient in ApiClient.Instances)
                             {
                                 ApiReturn ret = apiClient.CallApi<ApiReturn>("/_sys_/serviceStation/updateStationInfo", strServiceStationData);
@@ -362,18 +363,18 @@ namespace Sers.ServiceStation
             #endregion
 
 
-            #region (x.7)PubSub 初始化消息订阅 PubSubClient          
+            #region #7 PubSub init MessageSubscriber PubSubClient
             MessageClient.Instance.OnSendMessage = communicationManage.SendMessageAsync;
             #endregion
 
 
-            //(x.8) 调用SersApp事件
+            // #8 invoke SersApp OnStart event
             SersApplication.ResistConsoleCancelKey(Stop);
             SersApplication.OnStart();
 
             Logger.Info("[ServiceStation] started", SersApplication.serviceStationInfo.serviceStationName);
 
-            //(x.9) appEvent AfterStart
+            // #9 appEvent AfterStart
             appEventList?.ForEach(ev => ev.AfterStart());
 
             return true;
@@ -382,17 +383,17 @@ namespace Sers.ServiceStation
 
 
 
-        #region (x.5) StopStation
+        #region #5 StopStation
 
 
         public void StopStation()
         {
             Logger.Info("[ServiceStation] stoping...");
 
-            //(x.1) appEvent BeforeStop
+            // ##1 appEvent BeforeStop
             appEventList?.ForEach(ev => ev.BeforeStop());
 
-            //(x.2)stop service
+            // ##2 stop service
             if (SersApplication.IsRunning)
             {
                 #region CommunicationManage Stop
@@ -422,10 +423,10 @@ namespace Sers.ServiceStation
 
             Logger.Info("[ServiceStation] stoped");
 
-            //(x.3) appEvent AfterStop
+            // ##3 appEvent AfterStop
             appEventList?.ForEach(ev => ev.AfterStop());
 
-            //(x.4)调用SersApp 事件
+            // ##4 Invoke SersApp Stop events
             SersApplication.OnStop();
         }
         #endregion

+ 3 - 3
dotnet/Library/Vit/Vit.Core/Test/Vit.Core.MsTest/Vit.Core.MsTest.csproj

@@ -16,9 +16,9 @@
     </ItemGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
+        <PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
+        <PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
     </ItemGroup>
 
     <ItemGroup>

+ 3 - 3
dotnet/Library/Vit/Vit.Core/Test/Vit.Core.Util.Threading.MsTest/Vit.Core.Util.Threading.MsTest.csproj

@@ -5,9 +5,9 @@
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
-        <PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
-        <PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
+        <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
+        <PackageReference Include="MSTest.TestAdapter" Version="3.4.3" />
+        <PackageReference Include="MSTest.TestFramework" Version="3.4.3" />
     </ItemGroup>
 
     <ItemGroup>

+ 26 - 26
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Reflection/ObjectLoader.cs

@@ -1,11 +1,11 @@
-#region << 版本注释 >>
+#region << Version-v4 >>
 /*
  * ========================================================================
- * 版本:v4
- * 时间:2021-04-26
- * 作者:lith
- * 邮箱:serset@yeah.net
- * 说明
+ * Version: v4
+ * Time   : 2021-04-26
+ * Author : lith
+ * Email  : serset@yeah.net
+ * Remarks
  * ========================================================================
 */
 #endregion
@@ -28,15 +28,15 @@ namespace Vit.Core.Util.Reflection
     {
 
 
-        #region (x.1)Assembly
+        #region #1 Assembly
 
 
-        #region LoadAssembly       
+        #region LoadAssembly
         /// <summary>
         /// 
         /// </summary>
-        /// <param name="assemblyFile">如: "Vit.Core.dll"</param>
-        /// <param name="assemblyName">如: "Vit.Core"</param>
+        /// <param name="assemblyFile">for example : "Vit.Core.dll"</param>
+        /// <param name="assemblyName">for example : "Vit.Core"</param>
         /// <returns></returns>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static Assembly LoadAssembly(string assemblyFile = null, string assemblyName = null)
@@ -56,7 +56,7 @@ namespace Vit.Core.Util.Reflection
         /// <summary>
         /// 
         /// </summary>
-        /// <param name="assemblyFile">如: "Vit.Core.dll"</param>
+        /// <param name="assemblyFile">for example : "Vit.Core.dll"</param>
         /// <returns></returns>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static Assembly LoadAssemblyFromFile(string assemblyFile)
@@ -86,7 +86,7 @@ namespace Vit.Core.Util.Reflection
 
             var assemblyFileName = Path.GetFileNameWithoutExtension(assemblyFile);
 
-            #region (x.2)Get from DependencyContext               
+            #region (x.2)Get from DependencyContext
             if (assembly == null)
             {
                 assembly = DependencyContext.Default.RuntimeLibraries
@@ -119,20 +119,20 @@ namespace Vit.Core.Util.Reflection
         #endregion
 
 
-        #region (x.2)Class
+        #region #2 Class
 
         /// <summary>
-        /// 若未指定assembly,则从当前加载的所有Assembly中查找
+        /// If no assembly is specified, it will search through all currently loaded assemblies
         /// </summary>
-        /// <param name="className">如: "Vit.Core.Util.ConfigurationManager.JsonFile"、"Vit.Core.Util.ConfigurationManager.JsonFile,Vit.Core"</param>
+        /// <param name="className">for example : "Vit.Core.Util.ConfigurationManager.JsonFile" , "Vit.Core.Util.ConfigurationManager.JsonFile,Vit.Core"</param>
         /// <param name="assembly"></param>
-        /// <param name="assemblyFile">如: "Vit.Core.dll"</param>
-        /// <param name="assemblyName">如: "Vit.Core"</param>
+        /// <param name="assemblyFile">for example : "Vit.Core.dll"</param>
+        /// <param name="assemblyName">for example : "Vit.Core"</param>
         /// <returns></returns>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static Type GetType(string className, Assembly assembly = null, string assemblyFile = null, string assemblyName = null)
         {
-            #region (x.1) get assembly
+            #region #1 get assembly
             if (assembly == null)
             {
                 assembly = LoadAssembly(assemblyFile, assemblyName);
@@ -140,17 +140,17 @@ namespace Vit.Core.Util.Reflection
             #endregion
 
 
-            #region (x.2) get type from assembly
+            #region #2 get type from assembly
             if (assembly == null)
             {
-                //(x.x.1)
+                // ##1
                 {
                     var obj = Type.GetType(className, false);
                     if (obj != null) return obj;
                 }
 
 
-                //(x.x.2)load from CurrentDomain
+                // ##2 load from CurrentDomain
                 foreach (var asm in System.AppDomain.CurrentDomain.GetAssemblies())
                 {
                     var obj = asm?.GetType(className);
@@ -177,14 +177,14 @@ namespace Vit.Core.Util.Reflection
 
 
 
-        #region (x.3)CreateInstance
+        #region #3 CreateInstance
 
         /// <summary>
-        /// 若未指定assembly,则从当前加载的所有Assembly中查找
+        /// If no assembly is specified, it will search through all currently loaded assemblies
         /// </summary>
-        /// <param name="className">如: "Vit.Core.Util.ConfigurationManager.JsonFile"、"Vit.Core.Util.ConfigurationManager.JsonFile,Vit.Core"</param>
-        /// <param name="assemblyFile">如: "Vit.Core.dll"</param>
-        /// <param name="assemblyName">如: "Vit.Core"</param>
+        /// <param name="className">for example : "Vit.Core.Util.ConfigurationManager.JsonFile" , "Vit.Core.Util.ConfigurationManager.JsonFile,Vit.Core"</param>
+        /// <param name="assemblyFile">for example : "Vit.Core.dll"</param>
+        /// <param name="assemblyName">for example : "Vit.Core"</param>
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public static object CreateInstance(string className, string assemblyFile = null, string assemblyName = null)
         {

+ 6 - 8
dotnet/Library/Vit/Vit.Core/Vit.Core/Util/Shell/OsShell.cs

@@ -70,7 +70,7 @@ namespace Vit.Core.Util.Shell
 
 
                 //(x.x.2)write
-                if (input != null) 
+                if (input != null)
                 {
                     process.StandardInput.Write(input);
                 }
@@ -83,7 +83,7 @@ namespace Vit.Core.Util.Shell
                 var task = process.StandardOutput.ReadToEndAsync();
                 if (millisecondsOfWait.HasValue)
                 {
-                    task.Wait(millisecondsOfWait.Value); 
+                    task.Wait(millisecondsOfWait.Value);
                 }
                 else
                 {
@@ -133,7 +133,7 @@ namespace Vit.Core.Util.Shell
             }
 
 
-            #region (x.2)ProcessExit,确保程序退出时会关闭process          
+            #region (x.2)ProcessExit,确保程序退出时会关闭process
             EventHandler stopProcess = null;
             stopProcess = (s, e) =>
             {
@@ -153,18 +153,16 @@ namespace Vit.Core.Util.Shell
                             process = null;
                         }
                     }
-                    catch (System.Exception ex)
-                    {
-                    }
+                    catch { }
                 }
             };
             AppDomain.CurrentDomain.ProcessExit += stopProcess;
             #endregion
 
 
-            #region (x.3)启动Process           
+            #region (x.3)启动Process
             try
-            {             
+            {
 
                 //(x.x.1)
                 process.Start();

+ 1 - 1
dotnet/Library/Vit/Vit.Core/Vit.Core/Vit.Core.csproj

@@ -31,7 +31,7 @@
     <ItemGroup>
         <PackageReference Include="System.Buffers" Version="4.5.1" />
         <PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
-        <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
+        <PackageReference Include="Microsoft.Extensions.DependencyModel" Version="8.0.0" />
         <PackageReference Include="System.Memory" Version="4.5.5" />
     </ItemGroup>
 

+ 5 - 4
dotnet/Library/Vit/Vit.Net.Http.FormFile/Vit.Net.Http.FormFile.csproj

@@ -5,8 +5,8 @@
     </PropertyGroup>
 
     <PropertyGroup>
-        <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.22</Version>
+        <TargetFramework>net6.0</TargetFramework>
+        <Version>6.0.0</Version>
     </PropertyGroup>
 
     <PropertyGroup>
@@ -17,13 +17,14 @@
 
 
     <PropertyGroup>
-        <DocumentationFile>bin\Debug\netstandard2.0\Vit.Net.Http.FormFile.xml</DocumentationFile>
+        <DocumentationFile>bin\Debug\net6.0\Vit.Net.Http.FormFile.xml</DocumentationFile>
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.AspNetCore.Http" Version="2.1.34" />
+        <PackageReference Include="Microsoft.AspNetCore.App" />
     </ItemGroup>
 
+
     <ItemGroup>
         <ProjectReference Include="..\Vit.Core\Vit.Core\Vit.Core.csproj" />
     </ItemGroup>

+ 4 - 4
dotnet/Library/Vit/Vit.WebHost/Host.cs

@@ -32,7 +32,7 @@ namespace Vit.WebHost
 
 
 
-            #region (x.1)允许跨域访问
+            #region #1 AllowAnyOrigin
             if (arg.allowAnyOrigin)
             {
                 OnConfigureServices += IServiceCollectionExtensions_AllowAnyOrigin.AllowAnyOrigin_ConfigureServices;
@@ -40,7 +40,7 @@ namespace Vit.WebHost
             }
             #endregion
 
-            #region (x.2)UseStaticFiles
+            #region #2 UseStaticFiles
             if (arg.staticFiles != null)
             {
                 OnConfigure += (app) =>
@@ -51,7 +51,7 @@ namespace Vit.WebHost
             #endregion 
 
 
-            #region (x.3) Build host
+            #region #3 Build host
 
             OnConfigureServices += arg.OnConfigureServices;
             OnConfigure += arg.OnConfigure;
@@ -65,7 +65,7 @@ namespace Vit.WebHost
             #endregion
 
 
-            #region (x.4) Run
+            #region #4 Run
             if (arg.RunAsync)
             {
                 host.RunAsync();

+ 4 - 6
dotnet/Library/Vit/Vit.WebHost/Vit.WebHost.csproj

@@ -5,8 +5,8 @@
     </PropertyGroup>
 
     <PropertyGroup>
-        <TargetFramework>netstandard2.0</TargetFramework>
-        <Version>2.1.22</Version>
+        <TargetFramework>net6.0</TargetFramework>
+        <Version>6.0.0</Version>
     </PropertyGroup>
 
     <PropertyGroup>
@@ -16,13 +16,11 @@
     </PropertyGroup>
 
     <PropertyGroup>
-        <DocumentationFile>bin\Debug\netstandard2.0\Vit.WebHost.xml</DocumentationFile>
+        <DocumentationFile>bin\Debug\net6.0\Vit.WebHost.xml</DocumentationFile>
     </PropertyGroup>
 
     <ItemGroup>
-        <PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.1.0" />
-        <PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.1.3" />
-        <PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="2.1.1" />
+        <PackageReference Include="Microsoft.AspNetCore.App" />
     </ItemGroup>
 
     <ItemGroup>