lith 5 lat temu
rodzic
commit
10c5d30a17

+ 4 - 1
dotnet/Doc/UpgradeLog/Sers2.1.1.txt

@@ -95,6 +95,9 @@ ServiceCenter
 ------------------------------------------------------------------------------------------------------------------
 服务中心添加按照服务站点统计qps功能
 
+[tag]Sers2.1.1.316
+------------------------------------------------------------------------------------------------------------------
+修复程序退出函数在没正常启动程序时不正确退出的bug(StopStation StopCenter)
 
-tag]Sers2.1.1.316
+[tag]Sers2.1.1.318
 ------------------------------------------------------------------------------------------------------------------

+ 24 - 23
dotnet/Sers/Sers.ServiceCenter/Sers.ServiceCenter/ServiceCenter.cs

@@ -340,35 +340,36 @@ namespace Sers.ServiceCenter
 
         #region (x.5) StopCenter
         public void StopCenter()
-        {
-            if (!SersApplication.IsRunning) return;
-
+        { 
             Logger.Info("[ServiceCenter] stop...");
 
-
-            #region CommunicationManage Close
-            Logger.Info("[CL] stop...");
-            try
-            {
-                communicationManage.Stop();
-            }
-            catch (Exception ex)
+            if (SersApplication.IsRunning)
             {
-                Logger.Error(ex);
-            }
-            Logger.Info("[CL] stoped");
-            #endregion
+                #region CommunicationManage stop
+                Logger.Info("[CL] stop...");
+                try
+                {
+                    communicationManage.Stop();
+                }
+                catch (Exception ex)
+                {
+                    Logger.Error(ex);
+                }
+                Logger.Info("[CL] stoped");
+                #endregion
 
-            try
-            {
-                localApiService.Stop();
-            }
-            catch (Exception ex)
-            {
-                Logger.Error(ex);
+                Logger.Info("[LocalApiService] stop...");
+                try
+                {
+                    localApiService.Stop();
+                }
+                catch (Exception ex)
+                {
+                    Logger.Error(ex);
+                }
+                Logger.Info("[LocalApiService] stoped");
             }
 
-
             Logger.Info("[ServiceCenter] stoped");
 
             //调用SersApp 事件

+ 24 - 22
dotnet/Sers/Sers.ServiceStation/Sers.ServiceStation/ServiceStation.cs

@@ -354,33 +354,35 @@ namespace Sers.ServiceStation
 
 
         public void StopStation()
-        {
-            if (!SersApplication.IsRunning) return;
+        {       
 
             Logger.Info("[ServiceStation] stoping...");
 
-
-            #region CommunicationManage Close
-            Logger.Info("[CL] stop...");
-            try
-            {
-                communicationManage.Stop();
-            }
-            catch (Exception ex)
+            if (SersApplication.IsRunning)
             {
-                Logger.Error(ex);
-            }
-            Logger.Info("[CL] stoped");
-            #endregion
-            
+                #region CommunicationManage Stop
+                Logger.Info("[CL] stop...");
+                try
+                {
+                    communicationManage.Stop();
+                }
+                catch (Exception ex)
+                {
+                    Logger.Error(ex);
+                }
+                Logger.Info("[CL] stoped");
+                #endregion
 
-            try
-            {
-                localApiService.Stop();
-            }
-            catch (Exception ex)
-            {
-                Logger.Error(ex);
+                Logger.Info("[LocalApiService] stop...");
+                try
+                {
+                    localApiService.Stop();
+                }
+                catch (Exception ex)
+                {
+                    Logger.Error(ex);
+                }
+                Logger.Info("[LocalApiService] stoped");
             }
 
             Logger.Info("[ServiceStation] stoped");

+ 6 - 0
dotnet/StationDemo/Serslot/Did.Serslot.Demo/Did.Serslot.Demo.csproj

@@ -22,5 +22,11 @@
     <ProjectReference Include="..\..\..\Sers\ApiLoader\Sers.Serslot\Sers.Serslot.csproj" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Content Update="appsettings.json">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+
   
 </Project>

+ 1 - 1
dotnet/StationDemo/Serslot/Did.Serslot.Demo/Properties/launchSettings.json

@@ -17,7 +17,7 @@
         "ASPNETCORE_ENVIRONMENT": "Development"
       }
     },
-    "Did.Serslot.Demo": {
+    "console": {
       "commandName": "Project",
       "launchBrowser": true,
       "launchUrl": "api/values",

+ 6 - 0
dotnet/StationDemo/Serslot/Did.Serslot.HelloWorld/Did.Serslot.HelloWorld.csproj

@@ -22,6 +22,12 @@
     <ProjectReference Include="..\..\..\Sers\ApiLoader\Sers.Serslot\Sers.Serslot.csproj" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Content Update="appsettings.json">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+  </ItemGroup>
+
  
   
 </Project>