/// <summary>
/// 注册服务
/// </summary>
private static void register()
{
// 注册所有继承了IRemotingService接口的类
// 获取实现Remoting的程序集
Assembly assembly = Assembly.GetAssembly(typeof(Remoting))
Type[] types = assembly.GetTypes();
Remoting.listClear();
foreach (Type type in types)
{
// 继承的父类中是否包含IRemoting
if (type.GetInterface("IRemotingService") != null && type.GetInterfaces().Length > 1)
{
RemotingConfiguration.RegisterWellKnownServiceType(type, type.Name, WellKnownObjectMode.Singleton);
}
}
}