1:  private static List<Type> GetAllTypesFromDll(string dllName) {
   2:      var types = new List<Type>();
   3:      try {
   4:          var assembly = Assembly.LoadFrom(dllName);
   5:          Type[] allTypes = assembly.GetTypes();
   6:          types.AddRange(allTypes.Where(type => type.IsInterface));
   7:      } catch (Exception ex) {
   8:          Console.WriteLine("\n\nFejl - ikke valid dll. " + dllName);
   9:          Console.WriteLine("Exception\n" + ex.Message + "\n" + ex.InnerException);
  10:      }
  11:      return types;
  12:  }

   1:  private static IEnumerable<Service> ExtractPublicMethods(IEnumerable<Type> types) {
   2:      var exposedMethods = new List<Service>();
   3:      foreach (Type t in types) {
   4:          var service = new Service{ 
   5:                  Name = string.Format(t.Name.Remove(0, 1) + "{0}", ".svc"), 
   6:                  Operations = new List<string>() 
   7:          };
   8:          service.Operations = t.GetMethods(BindingFlags.Public | 
   9:              BindingFlags.DeclaredOnly | BindingFlags.Instance).
  10:              Select(a => a.Name).ToList();
  11:          exposedMethods.Add(service);
  12:      }         
  13:      return exposedMethods;
  14:  }

   1:  public class Service {
   2:      public List<string> Operations { get; set; }
   3:      public string Name { get; set; }
   4:  }