Example #1
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        public MicroserviceHost(BootConfiguration bootConfig, IMicroserviceHostLogger logger, Action <IComponentContainerBuilder> hostComponents)
        {
            _bootConfig          = bootConfig;
            _logger              = logger;
            _hostComponents      = hostComponents;
            _assemblyMap         = GetAssemblyLocationMap();
            _configureSequence   = new RevertableSequence(new ConfigureSequenceCodeBehind(this));
            _loadSequence        = new RevertableSequence(new LoadSequenceCodeBehind(this));
            _activateSequence    = new RevertableSequence(new ActivateSequenceCodeBehind(this));
            _lifecycleComponents = new List <ILifecycleListenerComponent>();

            AssemblyLoadContext.Default.Resolving += OnLoadContextResolvingAssembly;
        }
Example #2
0
        //-----------------------------------------------------------------------------------------------------------------------------------------------------

        private AssemblyLocationMap GetAssemblyLocationMap()
        {
            if (_bootConfig.AssemblyMap != null)
            {
                return(_bootConfig.AssemblyMap);
            }

            var defaultMap = new AssemblyLocationMap();

            defaultMap.AddDirectory(_bootConfig.ConfigsDirectory);
            defaultMap.AddDirectory(AppContext.BaseDirectory);
            return(defaultMap);
        }