From 365b9cde930a339c0aa0d996f0b45a81246f9a9b Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Fri, 11 Nov 2022 17:38:14 +0800 Subject: [PATCH] fixed issues #727 --- aspnet-core/common.props | 2 +- ...icroService.AuthServer.HttpApi.Host.csproj | 4 +-- .../Program.cs | 6 +++++ .../LY.MicroService.AuthServer/Program.cs | 6 +++++ .../Program.cs | 6 +++++ .../Program.cs | 6 +++++ .../Program.cs | 6 +++++ .../Program.cs | 6 +++++ .../Program.cs | 6 +++++ .../Program.cs | 13 +++++++++ .../Program.cs | 13 +++++++++ .../Program.cs | 6 +++++ .../LY.MicroService.identityServer/Program.cs | 6 +++++ build/build-aspnetcore-common.ps1 | 4 +-- common.props | 18 ++++++++++--- gateways/Directory.Build.props | 4 +-- gateways/common.props | 27 +++++++++++++++++-- 17 files changed, 127 insertions(+), 12 deletions(-) diff --git a/aspnet-core/common.props b/aspnet-core/common.props index 3bf289be8..201dc604b 100644 --- a/aspnet-core/common.props +++ b/aspnet-core/common.props @@ -3,7 +3,7 @@ latest 6.0.0.1 colin - $(NoWarn);CS1591;CS0436;CS8618 + $(NoWarn);CS1591;CS0436;CS8618;NU1803 https://github.com/colinin/abp-next-admin MIT git diff --git a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj index b749dccd0..00b6a07cc 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj +++ b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/LY.MicroService.AuthServer.HttpApi.Host.csproj @@ -47,8 +47,8 @@ - - + + diff --git a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/Program.cs b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/Program.cs index 08d7ce10a..2775d4256 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/Program.cs +++ b/aspnet-core/services/LY.MicroService.AuthServer.HttpApi.Host/Program.cs @@ -54,6 +54,12 @@ public class Program } catch (Exception ex) { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + Log.Fatal(ex, "Host terminated unexpectedly!"); Console.WriteLine("Host terminated unexpectedly!"); Console.WriteLine(ex.ToString()); diff --git a/aspnet-core/services/LY.MicroService.AuthServer/Program.cs b/aspnet-core/services/LY.MicroService.AuthServer/Program.cs index 4fb8e18ed..ff28b72df 100644 --- a/aspnet-core/services/LY.MicroService.AuthServer/Program.cs +++ b/aspnet-core/services/LY.MicroService.AuthServer/Program.cs @@ -54,6 +54,12 @@ public class Program } catch (Exception ex) { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + Log.Fatal(ex, "Host terminated unexpectedly!"); Console.WriteLine("Host terminated unexpectedly!"); Console.WriteLine(ex.ToString()); diff --git a/aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Program.cs b/aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Program.cs index a00fed23c..5a261d41a 100644 --- a/aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Program.cs +++ b/aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Program.cs @@ -55,6 +55,12 @@ public class Program } catch (Exception ex) { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + Log.Fatal(ex, "Host terminated unexpectedly!"); Console.WriteLine("Host terminated unexpectedly!"); Console.WriteLine(ex.ToString()); diff --git a/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/Program.cs b/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/Program.cs index ac8e4e347..d4c95df2f 100644 --- a/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/Program.cs +++ b/aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/Program.cs @@ -54,6 +54,12 @@ public class Program } catch (Exception ex) { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + Log.Fatal(ex, "Host terminated unexpectedly!"); Console.WriteLine("Host terminated unexpectedly!"); Console.WriteLine(ex.ToString()); diff --git a/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/Program.cs b/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/Program.cs index 023d63470..445819ec5 100644 --- a/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/Program.cs +++ b/aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/Program.cs @@ -54,6 +54,12 @@ public class Program } catch (Exception ex) { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + Log.Fatal(ex, "Host terminated unexpectedly!"); Console.WriteLine("Host terminated unexpectedly!"); Console.WriteLine(ex.ToString()); diff --git a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/Program.cs b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/Program.cs index 819f9fba7..c63c8ebd8 100644 --- a/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/Program.cs +++ b/aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/Program.cs @@ -54,6 +54,12 @@ public class Program } catch (Exception ex) { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + Log.Fatal(ex, "Host terminated unexpectedly!"); Console.WriteLine("Host terminated unexpectedly!"); Console.WriteLine(ex.ToString()); diff --git a/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/Program.cs b/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/Program.cs index c128e7393..6926956e0 100644 --- a/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/Program.cs +++ b/aspnet-core/services/LY.MicroService.TaskManagement.HttpApi.Host/Program.cs @@ -54,6 +54,12 @@ public class Program } catch (Exception ex) { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + Log.Fatal(ex, "Host terminated unexpectedly!"); Console.WriteLine("Host terminated unexpectedly!"); Console.WriteLine(ex.ToString()); diff --git a/aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Program.cs b/aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Program.cs index cd689aa8a..97a4ef925 100644 --- a/aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Program.cs +++ b/aspnet-core/services/LY.MicroService.WebhooksManagement.HttpApi.Host/Program.cs @@ -52,6 +52,19 @@ public class Program await app.RunAsync(); return 0; } + catch (Exception ex) + { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + + Log.Fatal(ex, "Host terminated unexpectedly!"); + Console.WriteLine("Host terminated unexpectedly!"); + Console.WriteLine(ex.ToString()); + return 1; + } finally { Log.CloseAndFlush(); diff --git a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Program.cs b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Program.cs index 54a8b2cb7..d77acded8 100644 --- a/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Program.cs +++ b/aspnet-core/services/LY.MicroService.WorkflowManagement.HttpApi.Host/Program.cs @@ -52,6 +52,19 @@ public class Program await app.RunAsync(); return 0; } + catch (Exception ex) + { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + + Log.Fatal(ex, "Host terminated unexpectedly!"); + Console.WriteLine("Host terminated unexpectedly!"); + Console.WriteLine(ex.ToString()); + return 1; + } finally { Log.CloseAndFlush(); diff --git a/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/Program.cs b/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/Program.cs index 572f802aa..403f33f9a 100644 --- a/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/Program.cs +++ b/aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/Program.cs @@ -54,6 +54,12 @@ public class Program } catch (Exception ex) { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + Log.Fatal(ex, "Host terminated unexpectedly!"); Console.WriteLine("Host terminated unexpectedly!"); Console.WriteLine(ex.ToString()); diff --git a/aspnet-core/services/LY.MicroService.identityServer/Program.cs b/aspnet-core/services/LY.MicroService.identityServer/Program.cs index b7f1f9f0d..7e229f95e 100644 --- a/aspnet-core/services/LY.MicroService.identityServer/Program.cs +++ b/aspnet-core/services/LY.MicroService.identityServer/Program.cs @@ -54,6 +54,12 @@ public class Program } catch (Exception ex) { + var type = ex.GetType().Name; + if (type.Equals("StopTheHostException", StringComparison.Ordinal)) + { + throw; + } + Log.Fatal(ex, "Host terminated unexpectedly!"); Console.WriteLine("Host terminated unexpectedly!"); Console.WriteLine(ex.ToString()); diff --git a/build/build-aspnetcore-common.ps1 b/build/build-aspnetcore-common.ps1 index 6299f5d25..46915d134 100644 --- a/build/build-aspnetcore-common.ps1 +++ b/build/build-aspnetcore-common.ps1 @@ -6,8 +6,8 @@ $rootFolder = (Get-Item -Path "./" -Verbose).FullName [PsObject[]]$serviceArray = @() $serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/"; Service = "admin" } -$serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.IdentityServer/"; Service = "identityserver" } -$serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.IdentityServer.HttpApi.Host/"; Service = "identityserver4-admin" } +$serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.identityServer/"; Service = "identityserver" } +$serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.identityServer.HttpApi.Host/"; Service = "identityserver4-admin" } $serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.LocalizationManagement.HttpApi.Host/"; Service = "localization" } $serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.PlatformManagement.HttpApi.Host/"; Service = "platform" } $serviceArray += [PsObject]@{ Path = $rootFolder + "/../aspnet-core/services/LY.MicroService.RealtimeMessage.HttpApi.Host/"; Service = "messages" } diff --git a/common.props b/common.props index a43c1b81b..201dc604b 100644 --- a/common.props +++ b/common.props @@ -1,9 +1,9 @@ latest - 5.3.5 - LINGYUN - $(NoWarn);CS1591;CS0436 + 6.0.0.1 + colin + $(NoWarn);CS1591;CS0436;CS8618;NU1803 https://github.com/colinin/abp-next-admin MIT git @@ -11,6 +11,18 @@ true + + + + + + + + + + + + $(SolutionDir)LocalNuget diff --git a/gateways/Directory.Build.props b/gateways/Directory.Build.props index 4595a7961..f882ef559 100644 --- a/gateways/Directory.Build.props +++ b/gateways/Directory.Build.props @@ -1,7 +1,7 @@  - 5.3.4 - 5.3.4 + 6.0.0 + 6.0.0 1.8.0 6.0.1 1.5.10 diff --git a/gateways/common.props b/gateways/common.props index 90e03d558..341ce1935 100644 --- a/gateways/common.props +++ b/gateways/common.props @@ -1,7 +1,30 @@ latest - 5.3.5 - $(NoWarn);CS1591;CS0436 + 6.0.0.1 + colin + $(NoWarn);CS1591;CS0436;CS8618;NU1803 + https://github.com/colinin/abp-next-admin + MIT + git + https://github.com/colinin/abp-next-admin + true + + + + + + + + + + + + + + + $(SolutionDir)LocalNuget + + \ No newline at end of file