private static bool DumpReproArguments(CodeGenerationFailedException ex) { Console.WriteLine(SR.DumpReproInstructions); MethodDesc failingMethod = ex.Method; var formatter = new CustomAttributeTypeNameFormatter((IAssemblyDesc)failingMethod.Context.SystemModule); Console.Write($"--singlemethodtypename \"{formatter.FormatName(failingMethod.OwningType, true)}\""); Console.Write($" --singlemethodname {failingMethod.Name}"); { int curIndex = 0; foreach (var searchMethod in failingMethod.OwningType.GetMethods()) { if (searchMethod.Name != failingMethod.Name) { continue; } curIndex++; if (searchMethod == failingMethod.GetMethodDefinition()) { Console.Write($" --singlemethodindex {curIndex}"); } } } for (int i = 0; i < failingMethod.Instantiation.Length; i++) { Console.Write($" --singlemethodgenericarg \"{formatter.FormatName(failingMethod.Instantiation[i], true)}\""); } Console.WriteLine(); return(false); }
private static bool DumpReproArguments(CodeGenerationFailedException ex) { Console.WriteLine(SR.DumpReproInstructions); MethodDesc failingMethod = ex.Method; Console.WriteLine(CreateReproArgumentString(failingMethod)); return false; }
private static bool DumpReproArguments(CodeGenerationFailedException ex) { Console.WriteLine("To repro, add following arguments to the command line:"); MethodDesc failingMethod = ex.Method; var formatter = new CustomAttributeTypeNameFormatter((IAssemblyDesc)failingMethod.Context.SystemModule); Console.Write($"--singlemethodtypename \"{formatter.FormatName(failingMethod.OwningType, true)}\""); Console.Write($" --singlemethodname {failingMethod.Name}"); for (int i = 0; i < failingMethod.Instantiation.Length; i++) Console.Write($" --singlemethodgenericarg \"{formatter.FormatName(failingMethod.Instantiation[i], true)}\""); return false; }