private static ServerServiceDefinition GetServerServiceDefinition(System.Reflection.Assembly assembly) { var methodInfo = assembly.FindContractContainer() .GetMethod("BindService", new[] { assembly.FindContractBaseType() }); var serviceDefinition = methodInfo.Invoke(null, new[] { Activator.CreateInstance(assembly.FindContractType()) }) as ServerServiceDefinition; return(serviceDefinition); }