2019年12月8日 星期日

ASP.NET Core 專案樣版的預設相依注入服務研究分析 1

ASP.NET Core 3.0 專案樣版的預設相依注入服務研究分析

在這篇文章中,將會使用 Visual Studio 2019 來使用預設的 專案樣板,使用 .NET Core 3.0 平台,依序建立起各個專案樣板中的 ASP.NET Core 的專案,接著,觀察這些專案中的預設相依性注入的服務有哪些。

ASP.NET Core 專案樣版的預設相依注入服務研究分析 1
ASP.NET Core 專案樣版的預設相依注入服務研究分析 2
ASP.NET Core 專案樣版的預設相依注入服務研究分析 3
ASP.NET Core 專案樣版的預設相依注入服務研究分析 4
ASP.NET Core 專案樣版的預設相依注入服務研究分析 5

為了要能夠了解到專案內的相依性注入容器內已經有哪些預設的服務已經注入完成,這裡需要取得 IServiceCollection 這個具體實作的物件,並且使用底下的方式,逐一取得相依性注入服務容器的各個已經註冊的型別對應關係。
foreach (var item in serviceDescriptors)
{
    var newObject = new ServiceRegistration()
    {
        Lifetime = item.Lifetime.ToString(),
        ServiceType = item.ServiceType.Name,
        ImplementationType = item.ImplementationType?.Name,
        ImplementationInstance = item.ImplementationInstance?.GetType().Name,
        ImplementationFactory = item.ImplementationFactory?.GetType().GenericTypeArguments[1].Name
        //ImplementationFactory = item.ImplementationFactory != null ? "Factory" : ""
    };
    list.Add(newObject);
}
其中,需要在 Startup 類別中宣告一個欄位 IServiceCollection Services,接著在 ConfigureServices 方法內,將傳入的 IServiceCollection 參數物件,設定給剛剛宣告好的 Services 欄位變數
最後,請在 Configure 方法內,將上述程式碼在這個方法內來執行,就可以取得現在相依性注入服務容器的各個型別對應註冊表了。
另外,在這篇文章中,也彙整了各種專案範本的 Program 與 Startup 類別的程式碼,大家可以參考與比對,在不同的專案範本中,這些程式碼的差異在哪裡呢?

空白的專案

  • 請先使用 Visual Studio 2019 在 [建立新專案]對話窗中,選擇建立一個 [ASP.NET Core Web 應用程式]
  • 在 [設定新的專案] 對話窗中,輸入適合的專案名稱
  • 在 [建立新的 ASP.NET Core Web 應用程式] 對話窗中,請選擇 [空白] 專案樣版
    可用於建立 ASP.NET Core 應用程式的空白專案範本,此範本不含任何內容
  • 點選右下方 [建立] 按鈕,完成此專案範本的建立工作
  • 現在可以開始執行這個專案,底下是這個專案的執行畫面截圖 
這個專案的 Program 類別的程式碼為
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });
    }
這個專案的 Startup 類別程式碼為
    public class Startup
    {
        // This method gets called by the runtime. Use this method to add services to the container.
        // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseRouting();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapGet("/", async context =>
                {
                    await context.Response.WriteAsync("Hello World!");
                });
            });
        }
    }
這裡是預設註冊的所有服務清單,總共有 71 個

All Services

IndexTypeLifetimeImplementationTypeImplementationInstanceImplementationFactory
1Microsoft.Extensions.Hosting.IHostingEnvironmentSingletonHostingEnvironment
2Microsoft.Extensions.Hosting.IHostEnvironmentSingletonHostingEnvironment
3Microsoft.Extensions.Hosting.HostBuilderContextSingletonHostBuilderContext
4Microsoft.Extensions.Configuration.IConfigurationSingletonIConfiguration
5Microsoft.Extensions.Hosting.IApplicationLifetimeSingletonIApplicationLifetime
6Microsoft.Extensions.Hosting.IHostApplicationLifetimeSingletonApplicationLifetime
7Microsoft.Extensions.Hosting.IHostLifetimeSingletonConsoleLifetime
8Microsoft.Extensions.Hosting.IHostSingletonHost
9Microsoft.Extensions.Options.IOptions`1SingletonOptionsManager`1
10Microsoft.Extensions.Options.IOptionsSnapshot`1ScopedOptionsManager`1
11Microsoft.Extensions.Options.IOptionsMonitor`1SingletonOptionsMonitor`1
12Microsoft.Extensions.Options.IOptionsFactory`1TransientOptionsFactory`1
13Microsoft.Extensions.Options.IOptionsMonitorCache`1SingletonOptionsCache`1
14Microsoft.Extensions.Logging.ILoggerFactorySingletonLoggerFactory
15Microsoft.Extensions.Logging.ILogger`1SingletonLogger`1
16Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonDefaultLoggerLevelConfigureOptions
17Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigureNamedOptions`1
18Microsoft.Extensions.Logging.Configuration.ILoggerProviderConfigurationFactorySingletonLoggerProviderConfigurationFactory
19Microsoft.Extensions.Logging.Configuration.ILoggerProviderConfiguration`1SingletonLoggerProviderConfiguration`1
20Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonLoggerFilterConfigureOptions
21Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigurationChangeTokenSource`1
22Microsoft.Extensions.Logging.Configuration.LoggingConfigurationSingletonLoggingConfiguration
23Microsoft.Extensions.Logging.ILoggerProviderSingletonConsoleLoggerProvider
24Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions, Microsoft.Extensions.Logging.Console, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonLoggerProviderConfigureOptions`2
25Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions, Microsoft.Extensions.Logging.Console, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonLoggerProviderOptionsChangeTokenSource`2
26Microsoft.Extensions.Logging.ILoggerProviderSingletonDebugLoggerProvider
27Microsoft.Extensions.Logging.EventSource.LoggingEventSourceSingletonLoggingEventSource
28Microsoft.Extensions.Logging.ILoggerProviderSingletonEventSourceLoggerProvider
29Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonEventLogFiltersConfigureOptions
30Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonEventLogFiltersConfigureOptionsChangeSource
31Microsoft.Extensions.Logging.ILoggerProviderSingletonEventLogLoggerProvider
32Microsoft.AspNetCore.Hosting.IWebHostEnvironmentSingletonHostingEnvironment
33Microsoft.AspNetCore.Hosting.IHostingEnvironmentSingletonHostingEnvironment
34Microsoft.AspNetCore.Hosting.IApplicationLifetimeSingletonGenericWebHostApplicationLifetime
35Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Hosting.GenericWebHostServiceOptions, Microsoft.AspNetCore.Hosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigureNamedOptions`1
36System.Diagnostics.DiagnosticListenerSingletonDiagnosticListener
37System.Diagnostics.DiagnosticSourceSingletonDiagnosticListener
38Microsoft.AspNetCore.Http.IHttpContextFactorySingletonDefaultHttpContextFactory
39Microsoft.AspNetCore.Http.IMiddlewareFactoryScopedMiddlewareFactory
40Microsoft.AspNetCore.Hosting.Builder.IApplicationBuilderFactorySingletonApplicationBuilderFactory
41Microsoft.AspNetCore.Connections.IConnectionListenerFactorySingletonSocketTransportFactory
42Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions, Microsoft.AspNetCore.Server.Kestrel.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientKestrelServerOptionsSetup
43Microsoft.AspNetCore.Hosting.Server.IServerSingletonKestrelServer
44Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions, Microsoft.AspNetCore.Server.Kestrel.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigureNamedOptions`1
45Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.HostFiltering.HostFilteringOptions, Microsoft.AspNetCore.HostFiltering, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonPostConfigureOptions`1
46Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.AspNetCore.HostFiltering.HostFilteringOptions, Microsoft.AspNetCore.HostFiltering, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigurationChangeTokenSource`1
47Microsoft.AspNetCore.Hosting.IStartupFilterTransientHostFilteringStartupFilter
48Microsoft.AspNetCore.Routing.IInlineConstraintResolverTransientDefaultInlineConstraintResolver
49Microsoft.Extensions.ObjectPool.ObjectPoolProviderTransientDefaultObjectPoolProvider
50Microsoft.Extensions.ObjectPool.ObjectPool`1[[Microsoft.AspNetCore.Routing.UriBuildingContext, Microsoft.AspNetCore.Routing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonObjectPool`1
51Microsoft.AspNetCore.Routing.Tree.TreeRouteBuilderTransientTreeRouteBuilder
52Microsoft.AspNetCore.Routing.RoutingMarkerServiceSingletonRoutingMarkerService
53Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Routing.RouteOptions, Microsoft.AspNetCore.Routing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientConfigureRouteOptions
54Microsoft.AspNetCore.Routing.EndpointDataSourceSingletonEndpointDataSource
55Microsoft.AspNetCore.Routing.ParameterPolicyFactorySingletonDefaultParameterPolicyFactory
56Microsoft.AspNetCore.Routing.Matching.MatcherFactorySingletonDfaMatcherFactory
57Microsoft.AspNetCore.Routing.Matching.DfaMatcherBuilderTransientDfaMatcherBuilder
58Microsoft.AspNetCore.Routing.Internal.DfaGraphWriterSingletonDfaGraphWriter
59Microsoft.AspNetCore.Routing.Matching.DataSourceDependentMatcher+LifetimeTransientLifetime
60Microsoft.AspNetCore.Routing.Matching.EndpointMetadataComparerSingletonEndpointMetadataComparer
61Microsoft.AspNetCore.Routing.LinkGeneratorSingletonDefaultLinkGenerator
62Microsoft.AspNetCore.Routing.IEndpointAddressScheme`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]SingletonEndpointNameAddressScheme
63Microsoft.AspNetCore.Routing.IEndpointAddressScheme`1[[Microsoft.AspNetCore.Routing.RouteValuesAddress, Microsoft.AspNetCore.Routing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonRouteValuesAddressScheme
64Microsoft.AspNetCore.Routing.LinkParserSingletonDefaultLinkParser
65Microsoft.AspNetCore.Routing.Matching.EndpointSelectorSingletonDefaultEndpointSelector
66Microsoft.AspNetCore.Routing.MatcherPolicySingletonHttpMethodMatcherPolicy
67Microsoft.AspNetCore.Routing.MatcherPolicySingletonHostMatcherPolicy
68Microsoft.AspNetCore.Routing.Template.TemplateBinderFactorySingletonDefaultTemplateBinderFactory
69Microsoft.AspNetCore.Routing.Patterns.RoutePatternTransformerSingletonDefaultRoutePatternTransformer
70Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Hosting.GenericWebHostServiceOptions, Microsoft.AspNetCore.Hosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigureNamedOptions`1
71Microsoft.Extensions.Hosting.IHostedServiceSingletonGenericWebHostService

API 專案

  • 請先使用 Visual Studio 2019 在 [建立新專案]對話窗中,選擇建立一個 [ASP.NET Core Web 應用程式]
  • 在 [設定新的專案] 對話窗中,輸入適合的專案名稱
  • 在 [建立新的 ASP.NET Core Web 應用程式] 對話窗中,請選擇 [API] 專案樣版
    用於建立 ASP.NET Core 應用程式的專案範本,富有 RESTful HTTP 服務的控制器範例。此範本也可用於 ASP.NET Core MVC 的檢視及控制器
  • 點選右下方 [建立] 按鈕,完成此專案範本的建立工作
  • 現在可以開始執行這個專案,底下是這個專案的執行畫面截圖 
這個專案的 Program 類別的程式碼為
    public class Program
    {
        public static void Main(string[] args)
        {
            CreateHostBuilder(args).Build().Run();
        }

        public static IHostBuilder CreateHostBuilder(string[] args) =>
            Host.CreateDefaultBuilder(args)
                .ConfigureWebHostDefaults(webBuilder =>
                {
                    webBuilder.UseStartup<Startup>();
                });
    }
這個專案的 Startup 類別程式碼為
    public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;
        }

        public IConfiguration Configuration { get; }

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers();
        }

        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseHttpsRedirection();

            app.UseRouting();

            app.UseAuthorization();

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
            });
        }
    }
這裡是預設註冊的所有服務清單,總共有 159 個

All Services

IndexTypeLifetimeImplementationTypeImplementationInstanceImplementationFactory
1Microsoft.Extensions.Hosting.IHostingEnvironmentSingletonHostingEnvironment
2Microsoft.Extensions.Hosting.IHostEnvironmentSingletonHostingEnvironment
3Microsoft.Extensions.Hosting.HostBuilderContextSingletonHostBuilderContext
4Microsoft.Extensions.Configuration.IConfigurationSingletonIConfiguration
5Microsoft.Extensions.Hosting.IApplicationLifetimeSingletonIApplicationLifetime
6Microsoft.Extensions.Hosting.IHostApplicationLifetimeSingletonApplicationLifetime
7Microsoft.Extensions.Hosting.IHostLifetimeSingletonConsoleLifetime
8Microsoft.Extensions.Hosting.IHostSingletonHost
9Microsoft.Extensions.Options.IOptions`1SingletonOptionsManager`1
10Microsoft.Extensions.Options.IOptionsSnapshot`1ScopedOptionsManager`1
11Microsoft.Extensions.Options.IOptionsMonitor`1SingletonOptionsMonitor`1
12Microsoft.Extensions.Options.IOptionsFactory`1TransientOptionsFactory`1
13Microsoft.Extensions.Options.IOptionsMonitorCache`1SingletonOptionsCache`1
14Microsoft.Extensions.Logging.ILoggerFactorySingletonLoggerFactory
15Microsoft.Extensions.Logging.ILogger`1SingletonLogger`1
16Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonDefaultLoggerLevelConfigureOptions
17Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigureNamedOptions`1
18Microsoft.Extensions.Logging.Configuration.ILoggerProviderConfigurationFactorySingletonLoggerProviderConfigurationFactory
19Microsoft.Extensions.Logging.Configuration.ILoggerProviderConfiguration`1SingletonLoggerProviderConfiguration`1
20Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonLoggerFilterConfigureOptions
21Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigurationChangeTokenSource`1
22Microsoft.Extensions.Logging.Configuration.LoggingConfigurationSingletonLoggingConfiguration
23Microsoft.Extensions.Logging.ILoggerProviderSingletonConsoleLoggerProvider
24Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions, Microsoft.Extensions.Logging.Console, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonLoggerProviderConfigureOptions`2
25Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.Extensions.Logging.Console.ConsoleLoggerOptions, Microsoft.Extensions.Logging.Console, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonLoggerProviderOptionsChangeTokenSource`2
26Microsoft.Extensions.Logging.ILoggerProviderSingletonDebugLoggerProvider
27Microsoft.Extensions.Logging.EventSource.LoggingEventSourceSingletonLoggingEventSource
28Microsoft.Extensions.Logging.ILoggerProviderSingletonEventSourceLoggerProvider
29Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonEventLogFiltersConfigureOptions
30Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.Extensions.Logging.LoggerFilterOptions, Microsoft.Extensions.Logging, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonEventLogFiltersConfigureOptionsChangeSource
31Microsoft.Extensions.Logging.ILoggerProviderSingletonEventLogLoggerProvider
32Microsoft.AspNetCore.Hosting.IWebHostEnvironmentSingletonHostingEnvironment
33Microsoft.AspNetCore.Hosting.IHostingEnvironmentSingletonHostingEnvironment
34Microsoft.AspNetCore.Hosting.IApplicationLifetimeSingletonGenericWebHostApplicationLifetime
35Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Hosting.GenericWebHostServiceOptions, Microsoft.AspNetCore.Hosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigureNamedOptions`1
36System.Diagnostics.DiagnosticListenerSingletonDiagnosticListener
37System.Diagnostics.DiagnosticSourceSingletonDiagnosticListener
38Microsoft.AspNetCore.Http.IHttpContextFactorySingletonDefaultHttpContextFactory
39Microsoft.AspNetCore.Http.IMiddlewareFactoryScopedMiddlewareFactory
40Microsoft.AspNetCore.Hosting.Builder.IApplicationBuilderFactorySingletonApplicationBuilderFactory
41Microsoft.AspNetCore.Connections.IConnectionListenerFactorySingletonSocketTransportFactory
42Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions, Microsoft.AspNetCore.Server.Kestrel.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientKestrelServerOptionsSetup
43Microsoft.AspNetCore.Hosting.Server.IServerSingletonKestrelServer
44Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerOptions, Microsoft.AspNetCore.Server.Kestrel.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigureNamedOptions`1
45Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.HostFiltering.HostFilteringOptions, Microsoft.AspNetCore.HostFiltering, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonPostConfigureOptions`1
46Microsoft.Extensions.Options.IOptionsChangeTokenSource`1[[Microsoft.AspNetCore.HostFiltering.HostFilteringOptions, Microsoft.AspNetCore.HostFiltering, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigurationChangeTokenSource`1
47Microsoft.AspNetCore.Hosting.IStartupFilterTransientHostFilteringStartupFilter
48Microsoft.AspNetCore.Routing.IInlineConstraintResolverTransientDefaultInlineConstraintResolver
49Microsoft.Extensions.ObjectPool.ObjectPoolProviderTransientDefaultObjectPoolProvider
50Microsoft.Extensions.ObjectPool.ObjectPool`1[[Microsoft.AspNetCore.Routing.UriBuildingContext, Microsoft.AspNetCore.Routing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonObjectPool`1
51Microsoft.AspNetCore.Routing.Tree.TreeRouteBuilderTransientTreeRouteBuilder
52Microsoft.AspNetCore.Routing.RoutingMarkerServiceSingletonRoutingMarkerService
53Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Routing.RouteOptions, Microsoft.AspNetCore.Routing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientConfigureRouteOptions
54Microsoft.AspNetCore.Routing.EndpointDataSourceSingletonEndpointDataSource
55Microsoft.AspNetCore.Routing.ParameterPolicyFactorySingletonDefaultParameterPolicyFactory
56Microsoft.AspNetCore.Routing.Matching.MatcherFactorySingletonDfaMatcherFactory
57Microsoft.AspNetCore.Routing.Matching.DfaMatcherBuilderTransientDfaMatcherBuilder
58Microsoft.AspNetCore.Routing.Internal.DfaGraphWriterSingletonDfaGraphWriter
59Microsoft.AspNetCore.Routing.Matching.DataSourceDependentMatcher+LifetimeTransientLifetime
60Microsoft.AspNetCore.Routing.Matching.EndpointMetadataComparerSingletonEndpointMetadataComparer
61Microsoft.AspNetCore.Routing.LinkGeneratorSingletonDefaultLinkGenerator
62Microsoft.AspNetCore.Routing.IEndpointAddressScheme`1[[System.String, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]SingletonEndpointNameAddressScheme
63Microsoft.AspNetCore.Routing.IEndpointAddressScheme`1[[Microsoft.AspNetCore.Routing.RouteValuesAddress, Microsoft.AspNetCore.Routing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonRouteValuesAddressScheme
64Microsoft.AspNetCore.Routing.LinkParserSingletonDefaultLinkParser
65Microsoft.AspNetCore.Routing.Matching.EndpointSelectorSingletonDefaultEndpointSelector
66Microsoft.AspNetCore.Routing.MatcherPolicySingletonHttpMethodMatcherPolicy
67Microsoft.AspNetCore.Routing.MatcherPolicySingletonHostMatcherPolicy
68Microsoft.AspNetCore.Routing.Template.TemplateBinderFactorySingletonDefaultTemplateBinderFactory
69Microsoft.AspNetCore.Routing.Patterns.RoutePatternTransformerSingletonDefaultRoutePatternTransformer
70Microsoft.AspNetCore.Mvc.ApplicationParts.ApplicationPartManagerSingletonApplicationPartManager
71Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMvcCoreMvcOptionsSetup
72Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMvcOptionsConfigureCompatibilityOptions
73Microsoft.Extensions.Options.IPostConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMvcCoreMvcOptionsSetup
74Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.ApiBehaviorOptions, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientApiBehaviorOptionsSetup
75Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Routing.RouteOptions, Microsoft.AspNetCore.Routing, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMvcCoreRouteOptionsSetup
76Microsoft.AspNetCore.Mvc.ApplicationModels.ApplicationModelFactorySingletonApplicationModelFactory
77Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientDefaultApplicationModelProvider
78Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientApiBehaviorApplicationModelProvider
79Microsoft.AspNetCore.Mvc.Abstractions.IActionDescriptorProviderTransientControllerActionDescriptorProvider
80Microsoft.AspNetCore.Mvc.Infrastructure.IActionDescriptorCollectionProviderSingletonDefaultActionDescriptorCollectionProvider
81Microsoft.AspNetCore.Mvc.Infrastructure.IActionSelectorSingletonActionSelector
82Microsoft.AspNetCore.Mvc.ActionConstraints.ActionConstraintCacheSingletonActionConstraintCache
83Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraintProviderTransientDefaultActionConstraintProvider
84Microsoft.AspNetCore.Routing.MatcherPolicySingletonConsumesMatcherPolicy
85Microsoft.AspNetCore.Routing.MatcherPolicySingletonActionConstraintMatcherPolicy
86Microsoft.AspNetCore.Mvc.Controllers.IControllerFactorySingletonDefaultControllerFactory
87Microsoft.AspNetCore.Mvc.Controllers.IControllerActivatorTransientDefaultControllerActivator
88Microsoft.AspNetCore.Mvc.Controllers.IControllerFactoryProviderSingletonControllerFactoryProvider
89Microsoft.AspNetCore.Mvc.Controllers.IControllerActivatorProviderSingletonControllerActivatorProvider
90Microsoft.AspNetCore.Mvc.Controllers.IControllerPropertyActivatorTransientDefaultControllerPropertyActivator
91Microsoft.AspNetCore.Mvc.Infrastructure.IActionInvokerFactorySingletonActionInvokerFactory
92Microsoft.AspNetCore.Mvc.Abstractions.IActionInvokerProviderTransientControllerActionInvokerProvider
93Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvokerCacheSingletonControllerActionInvokerCache
94Microsoft.AspNetCore.Mvc.Filters.IFilterProviderSingletonDefaultFilterProvider
95Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultTypeMapperSingletonActionResultTypeMapper
96Microsoft.AspNetCore.Mvc.Filters.RequestSizeLimitFilterTransientRequestSizeLimitFilter
97Microsoft.AspNetCore.Mvc.Filters.DisableRequestSizeLimitFilterTransientDisableRequestSizeLimitFilter
98Microsoft.AspNetCore.Mvc.Filters.RequestFormLimitsFilterTransientRequestFormLimitsFilter
99Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProviderSingletonDefaultModelMetadataProvider
100Microsoft.AspNetCore.Mvc.ModelBinding.Metadata.ICompositeMetadataDetailsProviderTransientICompositeMetadataDetailsProvider
101Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinderFactorySingletonModelBinderFactory
102Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IObjectModelValidatorSingletonIObjectModelValidator
103Microsoft.AspNetCore.Mvc.ModelBinding.Validation.ClientValidatorCacheSingletonClientValidatorCache
104Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinderSingletonParameterBinder
105Microsoft.Extensions.DependencyInjection.MvcMarkerServiceSingletonMvcMarkerService
106Microsoft.AspNetCore.Mvc.Infrastructure.ITypeActivatorCacheSingletonTypeActivatorCache
107Microsoft.AspNetCore.Mvc.Routing.IUrlHelperFactorySingletonUrlHelperFactory
108Microsoft.AspNetCore.Mvc.Infrastructure.IHttpRequestStreamReaderFactorySingletonMemoryPoolHttpRequestStreamReaderFactory
109Microsoft.AspNetCore.Mvc.Infrastructure.IHttpResponseStreamWriterFactorySingletonMemoryPoolHttpResponseStreamWriterFactory
110System.Buffers.ArrayPool`1[[System.Byte, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]SingletonTlsOverPerCoreLockedStacksArrayPool`1
111System.Buffers.ArrayPool`1[[System.Char, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]SingletonTlsOverPerCoreLockedStacksArrayPool`1
112Microsoft.AspNetCore.Mvc.Infrastructure.OutputFormatterSelectorSingletonDefaultOutputFormatterSelector
113Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.ObjectResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonObjectResultExecutor
114Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.PhysicalFileResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonPhysicalFileResultExecutor
115Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.VirtualFileResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonVirtualFileResultExecutor
116Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.FileStreamResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonFileStreamResultExecutor
117Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.FileContentResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonFileContentResultExecutor
118Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.RedirectResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonRedirectResultExecutor
119Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.LocalRedirectResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonLocalRedirectResultExecutor
120Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.RedirectToActionResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonRedirectToActionResultExecutor
121Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.RedirectToRouteResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonRedirectToRouteResultExecutor
122Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.RedirectToPageResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonRedirectToPageResultExecutor
123Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.ContentResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonContentResultExecutor
124Microsoft.AspNetCore.Mvc.Infrastructure.IActionResultExecutor`1[[Microsoft.AspNetCore.Mvc.JsonResult, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonSystemTextJsonResultExecutor
125Microsoft.AspNetCore.Mvc.Infrastructure.IClientErrorFactorySingletonProblemDetailsClientErrorFactory
126Microsoft.AspNetCore.Mvc.Infrastructure.ProblemDetailsFactorySingletonDefaultProblemDetailsFactory
127Microsoft.AspNetCore.Mvc.Routing.MvcRouteHandlerSingletonMvcRouteHandler
128Microsoft.AspNetCore.Mvc.Routing.MvcAttributeRouteHandlerTransientMvcAttributeRouteHandler
129Microsoft.AspNetCore.Mvc.Routing.ControllerActionEndpointDataSourceSingletonControllerActionEndpointDataSource
130Microsoft.AspNetCore.Mvc.Routing.ActionEndpointFactorySingletonActionEndpointFactory
131Microsoft.AspNetCore.Mvc.Routing.DynamicControllerEndpointSelectorSingletonDynamicControllerEndpointSelector
132Microsoft.AspNetCore.Routing.MatcherPolicySingletonDynamicControllerEndpointMatcherPolicy
133Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterConfigurationProviderSingletonMiddlewareFilterConfigurationProvider
134Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderSingletonMiddlewareFilterBuilder
135Microsoft.AspNetCore.Hosting.IStartupFilterSingletonMiddlewareFilterBuilderStartupFilter
136Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionGroupCollectionProviderSingletonApiDescriptionGroupCollectionProvider
137Microsoft.AspNetCore.Mvc.ApiExplorer.IApiDescriptionProviderTransientDefaultApiDescriptionProvider
138Microsoft.AspNetCore.Authentication.IAuthenticationServiceScopedAuthenticationService
139Microsoft.AspNetCore.Authentication.IClaimsTransformationSingletonNoopClaimsTransformation
140Microsoft.AspNetCore.Authentication.IAuthenticationHandlerProviderScopedAuthenticationHandlerProvider
141Microsoft.AspNetCore.Authentication.IAuthenticationSchemeProviderSingletonAuthenticationSchemeProvider
142Microsoft.AspNetCore.Authorization.IAuthorizationServiceTransientDefaultAuthorizationService
143Microsoft.AspNetCore.Authorization.IAuthorizationPolicyProviderTransientDefaultAuthorizationPolicyProvider
144Microsoft.AspNetCore.Authorization.IAuthorizationHandlerProviderTransientDefaultAuthorizationHandlerProvider
145Microsoft.AspNetCore.Authorization.IAuthorizationEvaluatorTransientDefaultAuthorizationEvaluator
146Microsoft.AspNetCore.Authorization.IAuthorizationHandlerContextFactoryTransientDefaultAuthorizationHandlerContextFactory
147Microsoft.AspNetCore.Authorization.IAuthorizationHandlerTransientPassThroughAuthorizationHandler
148Microsoft.AspNetCore.Authorization.Policy.AuthorizationPolicyMarkerServiceSingletonAuthorizationPolicyMarkerService
149Microsoft.AspNetCore.Authorization.Policy.IPolicyEvaluatorTransientPolicyEvaluator
150Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientAuthorizationApplicationModelProvider
151Microsoft.AspNetCore.Cors.Infrastructure.ICorsServiceTransientCorsService
152Microsoft.AspNetCore.Cors.Infrastructure.ICorsPolicyProviderTransientDefaultCorsPolicyProvider
153Microsoft.AspNetCore.Mvc.ApplicationModels.IApplicationModelProviderTransientCorsApplicationModelProvider
154Microsoft.AspNetCore.Mvc.Cors.CorsAuthorizationFilterTransientCorsAuthorizationFilter
155Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Mvc.MvcOptions, Microsoft.AspNetCore.Mvc.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]TransientMvcDataAnnotationsMvcOptionsSetup
156Microsoft.AspNetCore.Mvc.DataAnnotations.IValidationAttributeAdapterProviderSingletonValidationAttributeAdapterProvider
157Microsoft.AspNetCore.Mvc.Formatters.FormatFilterSingletonFormatFilter
158Microsoft.Extensions.Options.IConfigureOptions`1[[Microsoft.AspNetCore.Hosting.GenericWebHostServiceOptions, Microsoft.AspNetCore.Hosting, Version=3.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]]SingletonConfigureNamedOptions`1
159Microsoft.Extensions.Hosting.IHostedServiceSingletonGenericWebHostService






沒有留言:

張貼留言