/// <summary> /// 注册组件 /// </summary> public static void RegisterComponents() { AssemblyConfigLocalMember assemblyConfigLocalMember = new AssemblyConfigLocalMember(); assemblyConfigLocalMember.ProtoAssemblyConfigReader = new AssemblyConfigJson(); AssemblyConfigInfo assemblyConfig = assemblyConfigLocalMember.Reader(); var builder = new ContainerBuilder(); builder.UnifiedRegisterAssemblys(new BuilderParam() { AssemblyServices = assemblyConfig.Services, RegisteringServiceAction = () => { builder.RegisterType <MessagePackBytesSerialization>().As <IBytesSerialization>().AsSelf().PropertiesAutowired().SingleInstance(); builder.RegisterType <MessagePackConvertTypeValue>().As <IConvertTypeValue>().AsSelf().PropertiesAutowired().SingleInstance(); } }); PlatformTool.AppConfig = AutofacTool.Resolve <IAppConfiguration>(); MessageQueueConfig.RpcClient = SingleConnectionTool.Connection.CreateRpcClient("RpcServiceQueue"); MessageQueueConfig.BytesSerialization = AutofacTool.Resolve <IBytesSerialization>(); MessageQueueConfig.Log = AutofacTool.Resolve <ILogable>(); }