From f43affb2bb6e77c60cac0a8dc819aaeb9d95c659 Mon Sep 17 00:00:00 2001 From: Shreyas Zare Date: Sat, 13 Mar 2021 13:17:51 +0530 Subject: [PATCH] DnsApplication: added exception logging when loading dll. Letting the app load even when no request handler was loaded to allow uninstalling from the UI. --- DnsServerCore/Dns/Applications/DnsApplication.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/DnsServerCore/Dns/Applications/DnsApplication.cs b/DnsServerCore/Dns/Applications/DnsApplication.cs index 9c94ce65..63362648 100644 --- a/DnsServerCore/Dns/Applications/DnsApplication.cs +++ b/DnsServerCore/Dns/Applications/DnsApplication.cs @@ -103,8 +103,9 @@ namespace DnsServerCore.Dns.Applications } } } - catch (BadImageFormatException) + catch (Exception ex) { + _dnsServer.WriteLog(ex); continue; } @@ -121,9 +122,6 @@ namespace DnsServerCore.Dns.Applications } } - if (dnsRequestHandlers.Count == 0) - throw new DnsServerException("No DNS request handler was found in the DNS application: " + _appName); - _dnsRequestHandlers = dnsRequestHandlers; }