Skip to content

Commit

Permalink
[Java.Interop.Tools.Cecil] Change DirectoryAssemblyResolver Warning t…
Browse files Browse the repository at this point in the history
…o Diagnostic Output (#622)

Context: dotnet/android#2120

When building an app and using an Obfuscator you wind up with a lot
of warnings such as:

	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.

Rather than a warning, change the message to be `Verbose`. This will
allow it up show up in full diagnostic output, but NOT in a normal
build.  It won't be a warning so users will not feel a need to fix it.
  • Loading branch information
dellis1972 authored Apr 13, 2020
1 parent 93df5a2 commit 1032c0e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 1032c0e

Please sign in to comment.