in src/log4net/Util/SystemInfo.cs [345:386]
public static string AssemblyLocationInfo(Assembly myAssembly)
{
if (myAssembly.EnsureNotNull().GlobalAssemblyCache)
{
return "Global Assembly Cache";
}
try
{
if (myAssembly.IsDynamic)
{
return "Dynamic Assembly";
}
if (myAssembly.GetType().FullName == "System.Reflection.Emit.InternalAssemblyBuilder")
{
return "Dynamic Assembly";
}
// This call requires FileIOPermission for access to the path
// if we don't have permission then we just ignore it and
// carry on.
return myAssembly.Location;
}
catch (NotSupportedException)
{
// The location information may be unavailable for dynamic assemblies and a NotSupportedException
// is thrown in those cases. See: http://msdn.microsoft.com/de-de/library/system.reflection.assembly.location.aspx
return "Dynamic Assembly";
}
catch (TargetInvocationException ex)
{
return $"Location Detect Failed ({ex.Message})";
}
catch (ArgumentException ex)
{
return $"Location Detect Failed ({ex.Message})";
}
catch (System.Security.SecurityException)
{
return "Location Permission Denied";
}
}