.net core 源码分析(5) 启动过程-InitializeHostBuilderContext

HostBuilder.Build()第三阶段初始化HostBuilderContext。这个过程比较简单,只是把第一阶段和第二阶段得到的值绑定到HostBuilderContext中

  [MemberNotNull(nameof(_hostBuilderContext))]
  private void InitializeHostBuilderContext()
  {
      _hostBuilderContext = new HostBuilderContext(Properties)
      {
          HostingEnvironment = _hostingEnvironment!,
          Configuration = _hostConfiguration!
      };
  }

结束

 

.net core 源码分析

posted @ 2024-08-20 22:00  Hi同学  阅读(7)  评论(0编辑  收藏  举报