diff --git a/Bot-Utils/ABot.cs b/Bot-Utils/ABot.cs index 0a47e55..661ca64 100644 --- a/Bot-Utils/ABot.cs +++ b/Bot-Utils/ABot.cs @@ -16,10 +16,15 @@ namespace BlubbFish.Utils.IoT.Bots { Console.WriteLine("BlubbFish.Utils.IoT.Bots.Bot.SetupShutdown: Signalhandler Windows INT recieved."); this.RunningProcess = false; } + + #if NETCOREAPP private void Default_Unloading(AssemblyLoadContext obj) { - Console.WriteLine("BlubbFish.Utils.IoT.Bots.Bot.SetupShutdown: Signalhandler Windows INT recieved."); + Console.WriteLine("BlubbFish.Utils.IoT.Bots.Bot.SetupShutdown: Signalhandler Windows NETCORE recieved."); this.RunningProcess = false; + Console.WriteLine("BlubbFish.Utils.IoT.Bots.Bot.WaitForShutdown: Shutdown."); + this.Dispose(); } + #endif protected void WaitForShutdown() { if(Type.GetType("Mono.Runtime") != null) { @@ -39,15 +44,18 @@ namespace BlubbFish.Utils.IoT.Bots { }); this.sig_thread.Start(); #endif - } else { + } else { + #if NETCOREAPP AssemblyLoadContext.Default.Unloading += this.Default_Unloading; - Console.WriteLine("BlubbFish.Utils.IoT.Bots.Bot.WaitForShutdown: Signalhandler Netcore attached."); + Console.WriteLine("BlubbFish.Utils.IoT.Bots.Bot.WaitForShutdown: Signalhandler Netcore attached."); + #endif Console.CancelKeyPress += new ConsoleCancelEventHandler(this.SetupShutdown); Console.WriteLine("BlubbFish.Utils.IoT.Bots.Bot.WaitForShutdown: Signalhandler Windows attached."); } while(this.RunningProcess) { Thread.Sleep(100); } + Console.WriteLine("BlubbFish.Utils.IoT.Bots.Bot.WaitForShutdown: Shutdown."); } diff --git a/Bot-Utils/Bot-Utils.csproj b/Bot-Utils/Bot-Utils.csproj index c66700b..4417b30 100644 --- a/Bot-Utils/Bot-Utils.csproj +++ b/Bot-Utils/Bot-Utils.csproj @@ -65,6 +65,7 @@ + diff --git a/Bot-Utils/Bot-Utils_Core.csproj b/Bot-Utils/Bot-Utils_Core.csproj index 47330d5..0e3a40f 100644 --- a/Bot-Utils/Bot-Utils_Core.csproj +++ b/Bot-Utils/Bot-Utils_Core.csproj @@ -38,6 +38,7 @@ + diff --git a/Changelog.md b/Changelog.md new file mode 100644 index 0000000..e69de29