:bug: Assembly.GetEntryAssembly() can return null - instead of failing with a null-deref, rather fail explicitly with an hint on how to work around the problem
diff --git a/src/log4net/Util/SystemInfo.cs b/src/log4net/Util/SystemInfo.cs
index c63850b..821a230 100644
--- a/src/log4net/Util/SystemInfo.cs
+++ b/src/log4net/Util/SystemInfo.cs
@@ -202,7 +202,8 @@
#elif NETSTANDARD1_3 // TODO GetEntryAssembly is available for netstandard1.5
return entryAssemblyLocation = AppContext.BaseDirectory;
#else
- return entryAssemblyLocation = System.Reflection.Assembly.GetEntryAssembly().Location;
+ return entryAssemblyLocation = Assembly.GetEntryAssembly()?.Location
+ ?? throw new InvalidOperationException($"Unable to determine EntryAssembly location: EntryAssembly is null. Try explicitly setting {nameof(SystemInfo)}.{nameof(EntryAssemblyLocation)}");
#endif
}
set => entryAssemblyLocation = value;