Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnome.org>2018-01-09 22:23:10 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2018-01-09 22:23:10 +0300
commite9913fdc487622073a0827f32f845b637163590d (patch)
treeded2520c0d462c972b87a2dabee97ae65bdc4a7c /mcs
parent25bff86cee04cc852ae453702e1ae83b8fe7c3b9 (diff)
Improve sgen error reporting for assemblies it attempts to process (#6463)
Makes it simpler to see what is wrong with an assembly.
Diffstat (limited to 'mcs')
-rw-r--r--mcs/tools/sgen/sgen.cs14
1 files changed, 13 insertions, 1 deletions
diff --git a/mcs/tools/sgen/sgen.cs b/mcs/tools/sgen/sgen.cs
index 2ab376d3bfb..d759a5e51df 100644
--- a/mcs/tools/sgen/sgen.cs
+++ b/mcs/tools/sgen/sgen.cs
@@ -96,7 +96,19 @@ public class Driver
Console.WriteLine ("Generating serializer for the following types:");
if (types == null) {
- foreach (Type t in asm.GetTypes ()) {
+ Type [] types;
+
+ try {
+ types = asm.GetTypes ();
+ } catch (ReflectionTypeLoadException tle){
+ Console.WriteLine ($"There was an error loading one or more of the types from the referenced assembly {assembly}");
+ foreach (var le in tle.LoaderExceptions){
+ Console.WriteLine (le);
+ }
+ return 1;
+ }
+
+ foreach (Type t in types){
try {
maps.Add (imp.ImportTypeMapping (t));
userTypes.Add (t);