Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var files = Directory.GetFiles(folder, "*.dll").Where(x=>Path.GetFileName(x).StartsWith("EDD")).ToList();
- foreach (string file in files)
- {
- try
- {
- var assembly = Assembly.LoadFrom(file);
- var types = assembly.GetTypes();
- foreach (Type type in types)
- {
- var methods = type.GetMethods();
- foreach (MethodInfo method in methods)
- {
- if (method.GetParameters().Any(x => x.IsOptional))
- {
- Console.WriteLine($"{file}|{type.Name}|{method.Name}");
- }
- }
- }
- }
- catch (ReflectionTypeLoadException ex)
- {
- StringBuilder sb = new StringBuilder();
- foreach (Exception exSub in ex.LoaderExceptions)
- {
- sb.AppendLine(exSub.Message);
- FileNotFoundException exFileNotFound = exSub as FileNotFoundException;
- if (exFileNotFound != null)
- {
- if (!string.IsNullOrEmpty(exFileNotFound.FusionLog))
- {
- sb.AppendLine("Fusion Log:");
- sb.AppendLine(exFileNotFound.FusionLog);
- }
- }
- sb.AppendLine();
- }
- string errorMessage = sb.ToString();
- }
- catch (Exception ex)
- {
- Console.WriteLine($"ERROR {Path.GetFileName(file)}");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement