From aebb8f0d8505a44efac08823f070347bd55122c3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sat, 22 Jul 2017 17:15:11 +0200 Subject: [PATCH] [Mono.Profiler.Log] Catch SecurityException for missing icalls. This is the exception that is thrown on .NET because icalls are not allowed in non-GAC assemblies. --- mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogProfiler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogProfiler.cs b/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogProfiler.cs index 289b1803613..688a84b9864 100644 --- a/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogProfiler.cs +++ b/mcs/class/Mono.Profiler.Log/Mono.Profiler.Log/LogProfiler.cs @@ -5,6 +5,7 @@ using System; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Security; namespace Mono.Profiler.Log { @@ -20,7 +21,7 @@ namespace Mono.Profiler.Log { try { GetMaxStackTraceFrames (); return (bool) (_attached = true); - } catch (MissingMethodException) { + } catch (Exception e) when (e is MissingMethodException || e is SecurityException) { return (bool) (_attached = false); } } -- 2.11.4.GIT