From 8bd69d240c95ccadb7b2d587858b4ebaf974c601 Mon Sep 17 00:00:00 2001 From: Dean Ellis Date: Thu, 9 Apr 2020 15:54:11 +0100 Subject: [PATCH] [Java.Interop.Tools.Cecil] Change DirectoryAssemblyResolver Warning to Diagnostic Output Context https://github.com/xamarin/xamarin-android/issues/2120 When building an app and using an Obfuscator you wne up with allot of warnings like. warning : Failed to read 'obj\Release\90\android\assets\DotfuscatorForms.Android.dll' with debugging symbols. Retrying to load it without it. Error details are logged below. warning : Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly These are probably the result of the Obfuscation process since the assembly changed. However the warning was NOT useful or more importantly... actionable by the user. It is just noise. It might be useful for the developers writing the Java.Interop tooling itself. So rather than a warning , lets change it to be `Verbose`. This will allow it up show up in full diagnostic output, but NOT in a normal build. Also it won't be a warning so users will not feel the need to fix it. --- .../Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs b/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs index b4dcd1d85..8389ddde9 100644 --- a/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs +++ b/src/Java.Interop.Tools.Cecil/Java.Interop.Tools.Cecil/DirectoryAssemblyResolver.cs @@ -163,9 +163,9 @@ protected virtual AssemblyDefinition ReadAssembly (string file) return AssemblyDefinition.ReadAssembly (file, reader_parameters); } catch (Exception ex) { logger ( - TraceLevel.Warning, + TraceLevel.Verbose, $"Failed to read '{file}' with debugging symbols. Retrying to load it without it. Error details are logged below."); - logger (TraceLevel.Warning, $"{ex.ToString ()}"); + logger (TraceLevel.Verbose, $"{ex.ToString ()}"); reader_parameters.ReadSymbols = false; return AssemblyDefinition.ReadAssembly (file, reader_parameters); }