├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── pull_request_template.md ├── .gitignore ├── CONTRIBUTING.md ├── Directory.Build.targets ├── Extensions.sln ├── HttpClientFactoryLite.sln ├── LICENSE.txt ├── NuGet.config ├── README.md ├── azure-pipelines.yml ├── build.cmd ├── build.ps1 ├── build.sh ├── build ├── repo.props └── repo.targets ├── docs ├── build-from-source.md ├── daily-builds.md └── preparing-patch-updates.md ├── eng ├── AspNetCore.snk ├── Baseline.Designer.props ├── Baseline.xml ├── Dependencies.props ├── NuGetPackageVerifier.json ├── PatchConfig.props ├── ProdConPublish.csproj ├── ProjectReferences.props ├── Sources.props ├── scripts │ ├── KillProcesses.ps1 │ ├── KillProcesses.sh │ ├── UpdateDependencies.ps1 │ └── common.psm1 ├── targets │ ├── Packaging.targets │ └── ResolveReferences.targets ├── templates │ └── default-build.yml └── tools │ ├── BaselineGenerator │ ├── BaselineGenerator.csproj │ ├── Program.cs │ └── README.md │ ├── Directory.Build.props │ ├── Directory.Build.targets │ └── tools.sln ├── korebuild-lock.txt ├── korebuild.json ├── src ├── Caching │ ├── Abstractions │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── CacheEntryExtensions.cs │ │ │ ├── CacheItemPriority.cs │ │ │ ├── DistributedCacheEntryExtensions.cs │ │ │ ├── DistributedCacheEntryOptions.cs │ │ │ ├── DistributedCacheExtensions.cs │ │ │ ├── EvictionReason.cs │ │ │ ├── ICacheEntry.cs │ │ │ ├── IDistributedCache.cs │ │ │ ├── IMemoryCache.cs │ │ │ ├── Internal │ │ │ ├── ISystemClock.cs │ │ │ └── SystemClock.cs │ │ │ ├── MemoryCacheEntryExtensions.cs │ │ │ ├── MemoryCacheEntryOptions.cs │ │ │ ├── MemoryCacheExtensions.cs │ │ │ ├── Microsoft.Extensions.Caching.Abstractions.csproj │ │ │ ├── PostEvictionCallbackRegistration.cs │ │ │ ├── PostEvictionDelegate.cs │ │ │ └── baseline.netcore.json │ ├── Memory │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── CacheEntry.cs │ │ │ ├── CacheEntryHelper.cs │ │ │ ├── CacheEntryStack.cs │ │ │ ├── MemoryCache.cs │ │ │ ├── MemoryCacheOptions.cs │ │ │ ├── MemoryCacheServiceCollectionExtensions.cs │ │ │ ├── MemoryDistributedCache.cs │ │ │ ├── MemoryDistributedCacheOptions.cs │ │ │ ├── Microsoft.Extensions.Caching.Memory.csproj │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── CacheEntryScopeExpirationTests.cs │ │ │ ├── CacheServiceExtensionsTests.cs │ │ │ ├── CapacityTests.cs │ │ │ ├── CompactTests.cs │ │ │ ├── Infrastructure │ │ │ ├── TestClock.cs │ │ │ ├── TestExpirationToken.cs │ │ │ └── TokenCallbackRegistration.cs │ │ │ ├── MemoryCacheSetAndRemoveTests.cs │ │ │ ├── Microsoft.Extensions.Caching.Memory.Tests.csproj │ │ │ ├── TimeExpirationTests.cs │ │ │ └── TokenExpirationTests.cs │ ├── README.md │ ├── Redis │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── Microsoft.Extensions.Caching.Redis.csproj │ │ │ ├── RedisCache.cs │ │ │ ├── RedisCacheOptions.cs │ │ │ ├── RedisCacheServiceCollectionExtensions.cs │ │ │ ├── RedisExtensions.cs │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── CacheServiceExtensionsTests.cs │ │ │ ├── Infrastructure │ │ │ ├── RedisTestConfig.cs │ │ │ ├── RedisXunitTestExecutor.cs │ │ │ └── RedisXunitTestFramework.cs │ │ │ ├── Microsoft.Extensions.Caching.Redis.Tests.csproj │ │ │ ├── RedisCacheSetAndRemoveTests.cs │ │ │ └── TimeExpirationTests.cs │ ├── SqlServer │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── Columns.cs │ │ │ ├── DatabaseOperations.cs │ │ │ ├── IDatabaseOperations.cs │ │ │ ├── Microsoft.Extensions.Caching.SqlServer.csproj │ │ │ ├── MonoDatabaseOperations.cs │ │ │ ├── MonoSqlParameterCollectionExtensions.cs │ │ │ ├── PlatformHelper.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── SqlParameterCollectionExtensions.cs │ │ │ ├── SqlQueries.cs │ │ │ ├── SqlServerCache.cs │ │ │ ├── SqlServerCacheOptions.cs │ │ │ ├── SqlServerCacheServiceCollectionExtensions.cs │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── CacheItemInfo.cs │ │ │ ├── Microsoft.Extensions.Caching.SqlServer.Tests.csproj │ │ │ ├── SqlServerCacheServicesExtensionsTest.cs │ │ │ ├── SqlServerCacheWithDatabaseTest.cs │ │ │ ├── TestClock.cs │ │ │ ├── TestOptions.cs │ │ │ └── config.json │ ├── StackExchangeRedis │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── Microsoft.Extensions.Caching.StackExchangeRedis.csproj │ │ │ ├── RedisCache.cs │ │ │ ├── RedisCacheOptions.cs │ │ │ ├── RedisExtensions.cs │ │ │ └── StackExchangeRedisCacheServiceCollectionExtensions.cs │ │ └── test │ │ │ ├── CacheServiceExtensionsTests.cs │ │ │ ├── Infrastructure │ │ │ ├── RedisTestConfig.cs │ │ │ ├── RedisXunitTestExecutor.cs │ │ │ └── RedisXunitTestFramework.cs │ │ │ ├── Microsoft.Extensions.Caching.StackExchangeRedis.Tests.csproj │ │ │ ├── RedisCacheSetAndRemoveTests.cs │ │ │ └── TimeExpirationTests.cs │ └── samples │ │ ├── MemoryCacheConcurencySample │ │ ├── MemoryCacheConcurencySample.csproj │ │ └── Program.cs │ │ ├── MemoryCacheFileWatchSample │ │ ├── MemoryCacheFileWatchSample.csproj │ │ ├── Program.cs │ │ └── WatchedFiles │ │ │ └── example.txt │ │ ├── MemoryCacheSample │ │ ├── MemoryCacheSample.csproj │ │ ├── MemoryCacheWeakReferenceExtensions.cs │ │ ├── Program.cs │ │ └── WeakToken.cs │ │ ├── ProfilingSample │ │ ├── ProfilingSample.csproj │ │ └── Program.cs │ │ ├── RedisCacheSample │ │ ├── Program.cs │ │ └── RedisCacheSample.csproj │ │ ├── SqlServerCacheConcurencySample │ │ ├── Program.cs │ │ ├── SqlServerCacheConcurencySample.csproj │ │ └── config.json │ │ └── SqlServerCacheSample │ │ ├── Program.cs │ │ ├── SqlServerCacheSample.csproj │ │ └── config.json ├── Configuration │ ├── Config.Abstractions │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── ConfigurationExtensions.cs │ │ │ ├── ConfigurationPath.cs │ │ │ ├── IConfiguration.cs │ │ │ ├── IConfigurationBuilder.cs │ │ │ ├── IConfigurationProvider.cs │ │ │ ├── IConfigurationRoot.cs │ │ │ ├── IConfigurationSection.cs │ │ │ ├── IConfigurationSource.cs │ │ │ ├── Microsoft.Extensions.Configuration.Abstractions.csproj │ │ │ └── baseline.netcore.json │ ├── Config.AzureKeyVault │ │ ├── Directory.Build.props │ │ ├── samples │ │ │ ├── EnvironmentSecretManager.cs │ │ │ ├── KeyVaultSample.csproj │ │ │ ├── Program.cs │ │ │ └── settings.json │ │ ├── src │ │ │ ├── AzureKeyVaultConfigurationExtensions.cs │ │ │ ├── AzureKeyVaultConfigurationProvider.cs │ │ │ ├── AzureKeyVaultConfigurationSource.cs │ │ │ ├── DefaultKeyVaultSecretManager.cs │ │ │ ├── IKeyVaultClient.cs │ │ │ ├── IKeyVaultSecretManager.cs │ │ │ ├── KeyVaultClientWrapper.cs │ │ │ ├── Microsoft.Extensions.Configuration.AzureKeyVault.csproj │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── AzureKeyVaultConfigurationTest.cs │ │ │ └── Microsoft.Extensions.Configuration.AzureKeyVault.Tests.csproj │ ├── Config.Binder │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── BinderOptions.cs │ │ │ ├── ConfigurationBinder.cs │ │ │ ├── Microsoft.Extensions.Configuration.Binder.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── ConfigurationBinderTests.cs │ │ │ ├── ConfigurationCollectionBindingTests.cs │ │ │ └── Microsoft.Extensions.Configuration.Binder.Tests.csproj │ ├── Config.CommandLine │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── CommandLineConfigurationExtensions.cs │ │ │ ├── CommandLineConfigurationProvider.cs │ │ │ ├── CommandLineConfigurationSource.cs │ │ │ ├── Microsoft.Extensions.Configuration.CommandLine.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── CommandLineTest.cs │ │ │ └── Microsoft.Extensions.Configuration.CommandLine.Tests.csproj │ ├── Config.EnvironmentVariables │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── EnvironmentVariablesConfigurationProvider.cs │ │ │ ├── EnvironmentVariablesConfigurationSource.cs │ │ │ ├── EnvironmentVariablesExtensions.cs │ │ │ ├── Microsoft.Extensions.Configuration.EnvironmentVariables.csproj │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── EnvironmentVariablesTest.cs │ │ │ └── Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.csproj │ ├── Config.FileExtensions │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── FileConfigurationExtensions.cs │ │ │ ├── FileConfigurationProvider.cs │ │ │ ├── FileConfigurationSource.cs │ │ │ ├── FileLoadExceptionContext.cs │ │ │ ├── Microsoft.Extensions.Configuration.FileExtensions.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── FileConfigurationBuilderExtensionsTest.cs │ │ │ └── Microsoft.Extensions.Configuration.FileExtensions.Tests.csproj │ ├── Config.Ini │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── IniConfigurationExtensions.cs │ │ │ ├── IniConfigurationProvider.cs │ │ │ ├── IniConfigurationSource.cs │ │ │ ├── Microsoft.Extensions.Configuration.Ini.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── IniConfigurationExtensionsTest.cs │ │ │ ├── IniConfigurationTest.cs │ │ │ └── Microsoft.Extensions.Configuration.Ini.Tests.csproj │ ├── Config.Json │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── JsonConfigurationExtensions.cs │ │ │ ├── JsonConfigurationFileParser.cs │ │ │ ├── JsonConfigurationProvider.cs │ │ │ ├── JsonConfigurationSource.cs │ │ │ ├── Microsoft.Extensions.Configuration.Json.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── ArrayTest.cs │ │ │ ├── JsonConfigurationExtensionsTest.cs │ │ │ ├── JsonConfigurationTest.cs │ │ │ └── Microsoft.Extensions.Configuration.Json.Tests.csproj │ ├── Config.KeyPerFile │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── KeyPerFileConfigurationBuilderExtensions.cs │ │ │ ├── KeyPerFileConfigurationProvider.cs │ │ │ ├── KeyPerFileConfigurationSource.cs │ │ │ ├── Microsoft.Extensions.Configuration.KeyPerFile.csproj │ │ │ └── README.md │ │ └── test │ │ │ ├── KeyPerFileTests.cs │ │ │ └── Microsoft.Extensions.Configuration.KeyPerFile.Tests.csproj │ ├── Config.UserSecrets │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── Microsoft.Extensions.Configuration.UserSecrets.csproj │ │ │ ├── PathHelper.cs │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ ├── UserSecretsConfigurationExtensions.cs │ │ │ ├── UserSecretsIdAttribute.cs │ │ │ ├── baseline.netcore.json │ │ │ └── build │ │ │ │ └── netstandard2.0 │ │ │ │ ├── Microsoft.Extensions.Configuration.UserSecrets.props │ │ │ │ └── Microsoft.Extensions.Configuration.UserSecrets.targets │ │ └── test │ │ │ ├── ConfigurationExtensionTest.cs │ │ │ ├── Microsoft.Extensions.Configuration.UserSecrets.Tests.csproj │ │ │ ├── MsBuildTargetTest.cs │ │ │ └── PathHelperTest.cs │ ├── Config.Xml │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── Microsoft.Extensions.Configuration.Xml.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ ├── XmlConfigurationExtensions.cs │ │ │ ├── XmlConfigurationProvider.cs │ │ │ ├── XmlConfigurationSource.cs │ │ │ ├── XmlDocumentDecryptor.cs │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── Microsoft.Extensions.Configuration.Xml.Tests.csproj │ │ │ ├── XmlConfigurationExtensionsTest.cs │ │ │ └── XmlConfigurationTest.cs │ ├── Config │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── ChainedBuilderExtensions.cs │ │ │ ├── ChainedConfigurationProvider.cs │ │ │ ├── ChainedConfigurationSource.cs │ │ │ ├── ConfigurationBuilder.cs │ │ │ ├── ConfigurationKeyComparer.cs │ │ │ ├── ConfigurationProvider.cs │ │ │ ├── ConfigurationReloadToken.cs │ │ │ ├── ConfigurationRoot.cs │ │ │ ├── ConfigurationSection.cs │ │ │ ├── MemoryConfigurationBuilderExtensions.cs │ │ │ ├── MemoryConfigurationProvider.cs │ │ │ ├── MemoryConfigurationSource.cs │ │ │ ├── Microsoft.Extensions.Configuration.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── ConfigurationPathComparerTest.cs │ │ │ ├── ConfigurationPathTest.cs │ │ │ ├── ConfigurationTest.cs │ │ │ └── Microsoft.Extensions.Configuration.Tests.csproj │ ├── Directory.Build.props │ ├── README.md │ └── test │ │ ├── Config.FunctionalTests │ │ ├── ArrayTests.cs │ │ ├── ConfigurationTests.cs │ │ ├── DisposableFileSystem.cs │ │ ├── Microsoft.Extensions.Configuration.FunctionalTests.csproj │ │ └── test.xml │ │ └── Config.Test.Common │ │ ├── ConfigurationProviderExtensions.cs │ │ ├── Microsoft.Extensions.Configuration.Test.Common.csproj │ │ └── TestStreamHelpers.cs ├── DependencyInjection │ ├── DI.Abstractions │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── Extensions │ │ │ └── ServiceCollectionDescriptorExtensions.cs │ │ │ ├── IServiceCollection.cs │ │ │ ├── IServiceProviderFactory.cs │ │ │ ├── IServiceScope.cs │ │ │ ├── IServiceScopeFactory.cs │ │ │ ├── ISupportRequiredService.cs │ │ │ ├── Microsoft.Extensions.DependencyInjection.Abstractions.csproj │ │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ ├── ServiceCollectionServiceExtensions.cs │ │ │ ├── ServiceDescriptor.cs │ │ │ ├── ServiceLifetime.cs │ │ │ ├── ServiceProviderServiceExtensions.cs │ │ │ └── baseline.netcore.json │ ├── DI.Specification.Tests │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── ActivatorUtilitiesTests.cs │ │ │ ├── DependencyInjectionSpecificationTests.cs │ │ │ ├── Fakes │ │ │ ├── AnotherClass.cs │ │ │ ├── AnotherClassAcceptingData.cs │ │ │ ├── ClassWithAmbiguousCtors.cs │ │ │ ├── ClassWithAmbiguousCtorsAndAttribute.cs │ │ │ ├── ClassWithInternalConstructor.cs │ │ │ ├── ClassWithMultipleMarkedCtors.cs │ │ │ ├── ClassWithNestedReferencesToProvider.cs │ │ │ ├── ClassWithOptionalArgsCtor.cs │ │ │ ├── ClassWithOptionalArgsCtorWithStructs.cs │ │ │ ├── ClassWithPrivateCtor.cs │ │ │ ├── ClassWithProtectedConstructor.cs │ │ │ ├── ClassWithStaticCtor.cs │ │ │ ├── ClassWithThrowingCtor.cs │ │ │ ├── ClassWithThrowingEmptyCtor.cs │ │ │ ├── CreationCountFakeService.cs │ │ │ ├── FakeDisposableCallbackInnerService.cs │ │ │ ├── FakeDisposableCallbackOuterService.cs │ │ │ ├── FakeDisposableCallbackService.cs │ │ │ ├── FakeDisposeCallback.cs │ │ │ ├── FakeOneMultipleService.cs │ │ │ ├── FakeOpenGenericService.cs │ │ │ ├── FakeOuterService.cs │ │ │ ├── FakeService.cs │ │ │ ├── FakeTwoMultipleService.cs │ │ │ ├── IFactoryService.cs │ │ │ ├── IFakeEveryService.cs │ │ │ ├── IFakeMultipleService.cs │ │ │ ├── IFakeOpenGenericService.cs │ │ │ ├── IFakeOuterService.cs │ │ │ ├── IFakeScopedService.cs │ │ │ ├── IFakeService.cs │ │ │ ├── IFakeServiceInstance.cs │ │ │ ├── IFakeSingletonService.cs │ │ │ ├── INonexistentService.cs │ │ │ ├── PocoClass.cs │ │ │ ├── ScopedFactoryService.cs │ │ │ ├── ServiceAcceptingFactoryService.cs │ │ │ ├── TransientFactoryService.cs │ │ │ └── TypeWithSupersetConstructors.cs │ │ │ ├── Microsoft.Extensions.DependencyInjection.Specification.Tests.csproj │ │ │ ├── ServiceCollection.cs │ │ │ └── baseline.netcore.json │ ├── DI │ │ ├── Directory.Build.props │ │ ├── perf │ │ │ ├── ActivatorUtilitiesBenchmark.cs │ │ │ ├── AssemblyInfo.cs │ │ │ ├── GetServiceBenchmark.cs │ │ │ ├── Microsoft.Extensions.DependencyInjection.Performance.csproj │ │ │ ├── ScopeValidationBenchmark.cs │ │ │ └── TimeToFirstServiceBenchmark.cs │ │ ├── src │ │ │ ├── DefaultServiceProviderFactory.cs │ │ │ ├── Microsoft.Extensions.DependencyInjection.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ ├── ServiceCollection.cs │ │ │ ├── ServiceCollectionContainerBuilderExtensions.cs │ │ │ ├── ServiceLookup │ │ │ │ ├── CallSiteChain.cs │ │ │ │ ├── CallSiteExpressionBuilderContext.cs │ │ │ │ ├── CallSiteFactory.cs │ │ │ │ ├── CallSiteKind.cs │ │ │ │ ├── CallSiteRuntimeResolver.cs │ │ │ │ ├── CallSiteValidator.cs │ │ │ │ ├── CallSiteVisitor.cs │ │ │ │ ├── CompiledServiceProviderEngine.cs │ │ │ │ ├── ConstantCallSite.cs │ │ │ │ ├── ConstructorCallSite.cs │ │ │ │ ├── CreateInstanceCallSite.cs │ │ │ │ ├── DynamicServiceProviderEngine.cs │ │ │ │ ├── Expressions │ │ │ │ │ ├── ExpressionResolverBuilder.cs │ │ │ │ │ └── ExpressionsServiceProviderEngine.cs │ │ │ │ ├── FactoryCallSite.cs │ │ │ │ ├── IEnumerableCallSite.cs │ │ │ │ ├── ILEmit │ │ │ │ │ ├── ILEmitCallSiteAnalysisResult.cs │ │ │ │ │ ├── ILEmitCallSiteAnalyzer.cs │ │ │ │ │ ├── ILEmitResolverBuilder.cs │ │ │ │ │ ├── ILEmitResolverBuilderContext.cs │ │ │ │ │ └── ILEmitServiceProviderEngine.cs │ │ │ │ ├── IServiceCallSite.cs │ │ │ │ ├── IServiceProviderEngine.cs │ │ │ │ ├── IServiceProviderEngineCallback.cs │ │ │ │ ├── RuntimeServiceProviderEngine.cs │ │ │ │ ├── ScopedCallSite.cs │ │ │ │ ├── ServiceProviderCallSite.cs │ │ │ │ ├── ServiceProviderEngine.cs │ │ │ │ ├── ServiceProviderEngineScope.cs │ │ │ │ ├── ServiceScopeFactoryCallSite.cs │ │ │ │ ├── SingletonCallSite.cs │ │ │ │ ├── ThrowHelper.cs │ │ │ │ └── TransientCallSite.cs │ │ │ ├── ServiceProvider.cs │ │ │ ├── ServiceProviderMode.cs │ │ │ ├── ServiceProviderOptions.cs │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── CallSiteTests.cs │ │ │ ├── CircularDependencyTests.cs │ │ │ ├── Fakes │ │ │ ├── AbstractClass.cs │ │ │ ├── CircularReferences │ │ │ │ ├── DependencyOnCircularDependency.cs │ │ │ │ ├── DirectCircularDependencyA.cs │ │ │ │ ├── DirectCircularDependencyB.cs │ │ │ │ ├── ISelfCircularDependencyWithInterface.cs │ │ │ │ ├── IndirectCircularDependencyA.cs │ │ │ │ ├── IndirectCircularDependencyB.cs │ │ │ │ ├── IndirectCircularDependencyC.cs │ │ │ │ ├── NoCircularDependencySameTypeMultipleTimesA.cs │ │ │ │ ├── NoCircularDependencySameTypeMultipleTimesB.cs │ │ │ │ ├── NoCircularDependencySameTypeMultipleTimesC.cs │ │ │ │ ├── SelfCircularDependency.cs │ │ │ │ ├── SelfCircularDependencyGeneric.cs │ │ │ │ └── SelfCircularDependencyWithInterface.cs │ │ │ ├── ClassDependsOnPrivateConstructorClass.cs │ │ │ ├── ClassWithNestedReferencesToProvider.cs │ │ │ ├── ClassWithOptionalArgsCtorWithStructs.cs │ │ │ ├── DependOnNonexistentService.cs │ │ │ ├── StructFakeMultipleService.cs │ │ │ ├── StructFakeService.cs │ │ │ └── StructService.cs │ │ │ ├── Microsoft.Extensions.DependencyInjection.Tests.csproj │ │ │ ├── ServiceCollectionDescriptorExtensionsTests.cs │ │ │ ├── ServiceCollectionServiceExtensionsTest.cs │ │ │ ├── ServiceLookup │ │ │ ├── CallSiteFactoryTest.cs │ │ │ └── Types │ │ │ │ ├── TypeWithDefaultConstructorParameters.cs │ │ │ │ ├── TypeWithEnumerableConstructors.cs │ │ │ │ ├── TypeWithGenericServices.cs │ │ │ │ ├── TypeWithMultipleParameterizedConstructors.cs │ │ │ │ ├── TypeWithNoConstructors.cs │ │ │ │ ├── TypeWithNoPublicConstructors.cs │ │ │ │ ├── TypeWithNonOverlappedConstructors.cs │ │ │ │ ├── TypeWithParameterizedAndNullaryConstructor.cs │ │ │ │ ├── TypeWithParameterizedConstructor.cs │ │ │ │ ├── TypeWithParameterlessConstructor.cs │ │ │ │ ├── TypeWithParameterlessPublicConstructor.cs │ │ │ │ └── TypeWithUnresolvableEnumerableConstructors.cs │ │ │ ├── ServiceProviderCompilationTest.cs │ │ │ ├── ServiceProviderCompilationTestData.cs │ │ │ ├── ServiceProviderContainerTests.cs │ │ │ ├── ServiceProviderDynamicContainerTests.cs │ │ │ ├── ServiceProviderExpressionsContainerTests.cs │ │ │ ├── ServiceProviderILEmitContainerTests.cs │ │ │ ├── ServiceProviderServiceExtensionsTest.cs │ │ │ ├── ServiceProviderValidationTests.cs │ │ │ ├── ServiceTableTest.cs │ │ │ ├── Utils │ │ │ └── MultiServiceHelpers.cs │ │ │ └── xunit.runner.json │ └── README.md ├── DiagnosticAdapter │ ├── Directory.Build.props │ ├── README.md │ ├── src │ │ ├── DiagnosticListenerExtensions.cs │ │ ├── DiagnosticNameAttribute.cs │ │ ├── DiagnosticSourceAdapter.cs │ │ ├── IDiagnosticSourceMethodAdapter.cs │ │ ├── Infrastructure │ │ │ ├── IProxy.cs │ │ │ └── IProxyFactory.cs │ │ ├── Internal │ │ │ ├── InvalidProxyOperationException.cs │ │ │ ├── ProxyAssembly.cs │ │ │ ├── ProxyBase.cs │ │ │ ├── ProxyBaseOfT.cs │ │ │ ├── ProxyEnumerable.cs │ │ │ ├── ProxyFactory.cs │ │ │ ├── ProxyList.cs │ │ │ ├── ProxyMethodEmitter.cs │ │ │ ├── ProxyTypeCache.cs │ │ │ ├── ProxyTypeCacheResult.cs │ │ │ └── ProxyTypeEmitter.cs │ │ ├── Microsoft.Extensions.DiagnosticAdapter.csproj │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ └── Resources.Designer.cs │ │ ├── ProxyDiagnosticSourceMethodAdapter.cs │ │ ├── Resources.resx │ │ ├── baseline.net461.json │ │ ├── baseline.netcore.json │ │ ├── baseline.netframework.json │ │ └── breakingchanges.netcore.json │ └── test │ │ ├── DiagnosticSourceAdapterTest.cs │ │ ├── Internal │ │ ├── ProxyFactoryTest.cs │ │ └── ProxyTypeEmitterTest.cs │ │ ├── Microsoft.Extensions.DiagnosticAdapter.Tests.csproj │ │ └── ProxyDiagnosticSourceMethodAdapterTest.cs ├── FileProviders │ ├── Abstractions │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── IDirectoryContents.cs │ │ │ ├── IFileInfo.cs │ │ │ ├── IFileProvider.cs │ │ │ ├── Microsoft.Extensions.FileProviders.Abstractions.csproj │ │ │ ├── NotFoundDirectoryContents.cs │ │ │ ├── NotFoundFileInfo.cs │ │ │ ├── NullChangeToken.cs │ │ │ ├── NullFileProvider.cs │ │ │ └── baseline.netcore.json │ ├── Composite │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── CompositeDirectoryContents.cs │ │ │ ├── CompositeFileProvider.cs │ │ │ ├── Microsoft.Extensions.FileProviders.Composite.csproj │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── CompositeFileProviderTests.cs │ │ │ ├── Microsoft.Extensions.FileProviders.Composite.Tests.csproj │ │ │ ├── MockChangeToken.cs │ │ │ ├── MockDisposable.cs │ │ │ ├── MockFileInfo.cs │ │ │ └── MockFileProvider.cs │ ├── Directory.Build.props │ ├── Embedded │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── EmbeddedFileProvider.cs │ │ │ ├── EmbeddedResourceFileInfo.cs │ │ │ ├── EnumerableDirectoryContents.cs │ │ │ ├── Manifest │ │ │ │ ├── EmbeddedFilesManifest.cs │ │ │ │ ├── ManifestDirectory.cs │ │ │ │ ├── ManifestDirectoryContents.cs │ │ │ │ ├── ManifestDirectoryInfo.cs │ │ │ │ ├── ManifestEntry.cs │ │ │ │ ├── ManifestFile.cs │ │ │ │ ├── ManifestFileInfo.cs │ │ │ │ ├── ManifestParser.cs │ │ │ │ ├── ManifestRootDirectory.cs │ │ │ │ └── ManifestSinkDirectory.cs │ │ │ ├── ManifestEmbeddedFileProvider.cs │ │ │ ├── Microsoft.Extensions.FileProviders.Embedded.csproj │ │ │ ├── Microsoft.Extensions.FileProviders.Embedded.nuspec │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── baseline.netcore.json │ │ │ ├── build │ │ │ │ └── netstandard2.0 │ │ │ │ │ ├── Microsoft.Extensions.FileProviders.Embedded.props │ │ │ │ │ └── Microsoft.Extensions.FileProviders.Embedded.targets │ │ │ └── buildMultiTargeting │ │ │ │ ├── Microsoft.Extensions.FileProviders.Embedded.props │ │ │ │ └── Microsoft.Extensions.FileProviders.Embedded.targets │ │ └── test │ │ │ ├── EmbeddedFileProviderTests.cs │ │ │ ├── File.txt │ │ │ ├── FileInfoComparer.cs │ │ │ ├── Manifest │ │ │ ├── EmbeddedFilesManifestTests.cs │ │ │ ├── ManifestEntryTests.cs │ │ │ ├── ManifestParserTests.cs │ │ │ └── TestEntry.cs │ │ │ ├── ManifestEmbeddedFileProviderTests.cs │ │ │ ├── Microsoft.Extensions.FileProviders.Embedded.Tests.csproj │ │ │ ├── Resources │ │ │ ├── File.txt │ │ │ └── ResourcesInSubdirectory │ │ │ │ └── File3.txt │ │ │ ├── TestAssembly.cs │ │ │ ├── TestFileInfo.cs │ │ │ └── sub │ │ │ ├── File2.txt │ │ │ └── dir │ │ │ └── File3.txt │ ├── Manifest.MSBuildTask │ │ ├── src │ │ │ ├── EmbeddedItem.cs │ │ │ ├── Entry.cs │ │ │ ├── GenerateEmbeddedResourcesManifest.cs │ │ │ ├── Manifest.cs │ │ │ └── Microsoft.Extensions.FileProviders.Embedded.Manifest.Task.csproj │ │ └── test │ │ │ ├── GenerateEmbeddedResourcesManifestTest.cs │ │ │ ├── Microsoft.Extensions.FileProviders.Embedded.Manifest.Task.Test.csproj │ │ │ └── SetExtensions.cs │ ├── Physical │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── ExclusionFilters.cs │ │ │ ├── IPollingChangeToken.cs │ │ │ ├── Internal │ │ │ │ ├── Clock.cs │ │ │ │ ├── FileSystemInfoHelper.cs │ │ │ │ ├── IClock.cs │ │ │ │ ├── PathUtils.cs │ │ │ │ └── PhysicalDirectoryContents.cs │ │ │ ├── Microsoft.Extensions.FileProviders.Physical.csproj │ │ │ ├── PhysicalDirectoryInfo.cs │ │ │ ├── PhysicalFileInfo.cs │ │ │ ├── PhysicalFileProvider.cs │ │ │ ├── PhysicalFilesWatcher.cs │ │ │ ├── PollingFileChangeToken.cs │ │ │ ├── PollingWildCardChangeToken.cs │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── DisposableFileSystem.cs │ │ │ ├── ExclusionFilterTests.cs │ │ │ ├── Microsoft.Extensions.FileProviders.Physical.Tests.csproj │ │ │ ├── MockFileSystemWatcher.cs │ │ │ ├── PhysicalFileProviderTests.cs │ │ │ ├── PhysicalFilesWatcherTests.cs │ │ │ ├── PollingWildCardChangeTokenTest.cs │ │ │ └── TestClock.cs │ └── README.md ├── FileSystemGlobbing │ ├── Directory.Build.props │ ├── src │ │ ├── Abstractions │ │ │ ├── DirectoryInfoBase.cs │ │ │ ├── DirectoryInfoWrapper.cs │ │ │ ├── FileInfoBase.cs │ │ │ ├── FileInfoWrapper.cs │ │ │ └── FileSystemInfoBase.cs │ │ ├── FilePatternMatch.cs │ │ ├── InMemoryDirectoryInfo.cs │ │ ├── Internal │ │ │ ├── ILinearPattern.cs │ │ │ ├── IPathSegment.cs │ │ │ ├── IPattern.cs │ │ │ ├── IPatternContext.cs │ │ │ ├── IRaggedPattern.cs │ │ │ ├── InMemoryFileInfo.cs │ │ │ ├── MatcherContext.cs │ │ │ ├── PathSegments │ │ │ │ ├── CurrentPathSegment.cs │ │ │ │ ├── LiteralPathSegment.cs │ │ │ │ ├── ParentPathSegment.cs │ │ │ │ ├── RecursiveWildcardSegment.cs │ │ │ │ └── WildcardPathSegment.cs │ │ │ ├── PatternContexts │ │ │ │ ├── PatternContext.cs │ │ │ │ ├── PatternContextLinear.cs │ │ │ │ ├── PatternContextLinearExclude.cs │ │ │ │ ├── PatternContextLinearInclude.cs │ │ │ │ ├── PatternContextRagged.cs │ │ │ │ ├── PatternContextRaggedExclude.cs │ │ │ │ └── PatternContextRaggedInclude.cs │ │ │ ├── PatternTestResult.cs │ │ │ └── Patterns │ │ │ │ └── PatternBuilder.cs │ │ ├── Matcher.cs │ │ ├── MatcherExtensions.cs │ │ ├── Microsoft.Extensions.FileSystemGlobbing.csproj │ │ ├── PatternMatchingResult.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── Util │ │ │ └── StringComparisonHelper.cs │ │ └── baseline.netcore.json │ └── test │ │ ├── FileAbstractionsTests.cs │ │ ├── FunctionalTests.cs │ │ ├── Microsoft.Extensions.FileSystemGlobbing.Tests.csproj │ │ ├── PatternContexts │ │ ├── PatternContextLinearTests.cs │ │ └── PatternContextRaggedTests.cs │ │ ├── PatternMatchingTests.cs │ │ ├── PatternSegments │ │ ├── CurrentPathSegmentTests.cs │ │ ├── LiteralPathSegmentTests.cs │ │ ├── ParentPathSegmentTests.cs │ │ ├── RecursiveWildcardSegmentTests.cs │ │ └── WildcardPathSegmentTests.cs │ │ ├── Patterns │ │ └── PatternTests.cs │ │ └── TestUtility │ │ ├── DisposableFileSystem.cs │ │ ├── FileSystemGlobbingTestContext.cs │ │ ├── FileSystemOperationRecorder.cs │ │ ├── MockDirectoryInfo.cs │ │ ├── MockFileInfoStub.cs │ │ ├── MockLinearPatternBuilder.cs │ │ ├── MockNonRecursivePathSegment.cs │ │ ├── MockRaggedPatternBuilder.cs │ │ ├── MockRecursivePathSegment.cs │ │ └── PatternContextHelper.cs ├── HealthChecks │ ├── Abstractions │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── HealthCheckContext.cs │ │ │ ├── HealthCheckRegistration.cs │ │ │ ├── HealthCheckResult.cs │ │ │ ├── HealthReport.cs │ │ │ ├── HealthReportEntry.cs │ │ │ ├── HealthStatus.cs │ │ │ ├── IHealthCheck.cs │ │ │ ├── IHealthCheckPublisher.cs │ │ │ ├── Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.csproj │ │ │ └── baseline.netcore.json │ └── HealthChecks │ │ ├── Directory.Build.props │ │ ├── src │ │ ├── DefaultHealthCheckService.cs │ │ ├── DelegateHealthCheck.cs │ │ ├── DependencyInjection │ │ │ ├── HealthCheckServiceCollectionExtensions.cs │ │ │ ├── HealthChecksBuilder.cs │ │ │ ├── HealthChecksBuilderAddCheckExtensions.cs │ │ │ ├── HealthChecksBuilderDelegateExtensions.cs │ │ │ └── IHealthChecksBuilder.cs │ │ ├── HealthCheckLogScope.cs │ │ ├── HealthCheckPublisherHostedService.cs │ │ ├── HealthCheckPublisherOptions.cs │ │ ├── HealthCheckService.cs │ │ ├── HealthCheckServiceOptions.cs │ │ ├── Microsoft.Extensions.Diagnostics.HealthChecks.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── baseline.netcore.json │ │ └── test │ │ ├── DefaultHealthCheckServiceTest.cs │ │ ├── DependencyInjection │ │ ├── HealthChecksBuilderTest.cs │ │ └── ServiceCollectionExtensionsTest.cs │ │ ├── HealthCheckPublisherHostedServiceTest.cs │ │ ├── HealthReportTest.cs │ │ └── Microsoft.Extensions.Diagnostics.HealthChecks.Tests.csproj ├── Hosting │ ├── Abstractions │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── BackgroundService.cs │ │ │ ├── EnvironmentName.cs │ │ │ ├── HostBuilderContext.cs │ │ │ ├── HostDefaults.cs │ │ │ ├── HostingAbstractionsHostBuilderExtensions.cs │ │ │ ├── HostingAbstractionsHostExtensions.cs │ │ │ ├── HostingEnvironmentExtensions.cs │ │ │ ├── IApplicationLifetime.cs │ │ │ ├── IHost.cs │ │ │ ├── IHostBuilder.cs │ │ │ ├── IHostLifetime.cs │ │ │ ├── IHostedService.cs │ │ │ ├── IHostingEnvironment.cs │ │ │ ├── Microsoft.Extensions.Hosting.Abstractions.csproj │ │ │ ├── ServiceCollectionHostedServiceExtensions.cs │ │ │ └── baseline.netcore.json │ ├── Hosting │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── ConsoleLifetimeOptions.cs │ │ │ ├── HostBuilder.cs │ │ │ ├── HostOptions.cs │ │ │ ├── HostingHostBuilderExtensions.cs │ │ │ ├── Internal │ │ │ │ ├── ApplicationLifetime.cs │ │ │ │ ├── ConfigureContainerAdapter.cs │ │ │ │ ├── ConsoleLifetime.cs │ │ │ │ ├── Host.cs │ │ │ │ ├── HostingEnvironment.cs │ │ │ │ ├── HostingLoggerExtensions.cs │ │ │ │ ├── IConfigureContainerAdapter.cs │ │ │ │ ├── IServiceFactoryAdapter.cs │ │ │ │ ├── LoggerEventIds.cs │ │ │ │ └── ServiceFactoryAdapter.cs │ │ │ └── Microsoft.Extensions.Hosting.csproj │ │ └── test │ │ │ ├── BackgroundHostedServiceTests.cs │ │ │ ├── Fakes │ │ │ ├── FakeHostLifetime.cs │ │ │ ├── FakeHostedService.cs │ │ │ ├── FakeOptions.cs │ │ │ ├── FakeService.cs │ │ │ ├── FakeServiceCollection.cs │ │ │ ├── FakeServiceProviderFactory.cs │ │ │ ├── IFakeEveryService.cs │ │ │ ├── IFakeScopedService.cs │ │ │ ├── IFakeService.cs │ │ │ ├── IFakeServiceInstance.cs │ │ │ └── IFakeSingletonService.cs │ │ │ ├── HostBuilderTests.cs │ │ │ ├── HostTests.cs │ │ │ ├── Microsoft.Extensions.Hosting.Tests.csproj │ │ │ └── testroot │ │ │ └── readme.txt │ └── samples │ │ ├── GenericHostSample │ │ ├── GenericHostSample.csproj │ │ ├── MyContainer.cs │ │ ├── MyContainerFactory.cs │ │ ├── MyServiceA.cs │ │ ├── MyServiceB.cs │ │ ├── ProgramExternallyControlled.cs │ │ ├── ProgramFullControl.cs │ │ ├── ProgramHelloWorld.cs │ │ ├── ServiceBaseControlled.cs │ │ └── ServiceBaseLifetime.cs │ │ └── SampleMsmqHost │ │ ├── MsmqConnection.cs │ │ ├── MsmqOptions.cs │ │ ├── MsmqProcessor.cs │ │ ├── MsmqService.cs │ │ ├── Program.cs │ │ └── SampleMsmqHost.csproj ├── HttpClientFactory │ ├── Http │ │ ├── perf │ │ │ ├── Configs │ │ │ │ └── CoreConfig.cs │ │ │ ├── CreationOverheadBenchmark.cs │ │ │ ├── FakeClientHandler.cs │ │ │ ├── FakeLoggerProvider.cs │ │ │ ├── LoggingOverheadBenchmark.cs │ │ │ └── Microsoft.Extensions.Http.Performance.csproj │ │ ├── src │ │ │ ├── ActiveHandlerTrackingEntry.cs │ │ │ ├── DefaultHttpMessageHandlerBuilder.cs │ │ │ ├── ExpiredHandlerTrackingEntry.cs │ │ │ ├── HttpClientFactory.cs │ │ │ ├── HttpClientFactoryExtensions.cs │ │ │ ├── HttpClientFactoryOptions.cs │ │ │ ├── HttpClientFactoryOptionsBuilder.cs │ │ │ ├── HttpMessageHandlerBuilder.cs │ │ │ ├── IHttpClientFactory.cs │ │ │ ├── IHttpClientFactoryOptionsBuilder.cs │ │ │ ├── IHttpMessageHandlerBuilderFilter.cs │ │ │ ├── IHttpMessageHandlerFactory.cs │ │ │ ├── LifetimeTrackingHttpMessageHandler.cs │ │ │ ├── Microsoft.Extensions.Http.csproj │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ └── Resources.resx │ │ └── test │ │ │ ├── DefaultHttpClientFactoryTest.cs │ │ │ ├── DefaultHttpMessageHandlerBuilderTest.cs │ │ │ ├── DependencyInjection │ │ │ ├── HttpClientFactoryServiceCollectionExtensionsTest.cs │ │ │ └── OtherTestOptions.cs │ │ │ ├── HttpMessageHandlerBuilderTest.cs │ │ │ ├── ITestTypedClient.cs │ │ │ ├── Microsoft.Extensions.Http.Tests.csproj │ │ │ └── TestTypedClient.cs │ ├── Polly │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── DependencyInjection │ │ │ │ ├── PollyHttpClientBuilderExtensions.cs │ │ │ │ └── PollyServiceCollectionExtensions.cs │ │ │ ├── HttpRequestMessageExtensions.cs │ │ │ ├── Microsoft.Extensions.Http.Polly.csproj │ │ │ ├── PolicyHttpMessageHandler.cs │ │ │ ├── Properties │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── DependencyInjection │ │ │ └── PollyHttpClientBuilderExtensionsTest.cs │ │ │ ├── HttpRequestMessageExtensionsTest.cs │ │ │ ├── Microsoft.Extensions.Http.Polly.Tests.csproj │ │ │ └── PolicyHttpMessageHandlerTest.cs │ ├── README.md │ └── samples │ │ └── HttpClientFactorySample │ │ ├── HttpClientFactorySample.csproj │ │ └── Program.cs ├── Localization │ ├── Abstractions │ │ └── src │ │ │ ├── IStringLocalizer.cs │ │ │ ├── IStringLocalizerFactory.cs │ │ │ ├── IStringLocalizerOfT.cs │ │ │ ├── LocalizedString.cs │ │ │ ├── Microsoft.Extensions.Localization.Abstractions.csproj │ │ │ ├── StringLocalizerExtensions.cs │ │ │ ├── StringLocalizerOfT.cs │ │ │ └── baseline.netcore.json │ └── Localization │ │ ├── src │ │ ├── IResourceNamesCache.cs │ │ ├── Internal │ │ │ ├── AssemblyWrapper.cs │ │ │ ├── IResourceStringProvider.cs │ │ │ ├── ResourceManagerStringLocalizerLoggerExtensions.cs │ │ │ └── ResourceManagerStringProvider.cs │ │ ├── LocalizationOptions.cs │ │ ├── LocalizationServiceCollectionExtensions.cs │ │ ├── Microsoft.Extensions.Localization.csproj │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ └── Resources.Designer.cs │ │ ├── ResourceLocationAttribute.cs │ │ ├── ResourceManagerStringLocalizer.cs │ │ ├── ResourceManagerStringLocalizerFactory.cs │ │ ├── ResourceManagerWithCultureStringLocalizer.cs │ │ ├── ResourceNamesCache.cs │ │ ├── Resources.resx │ │ ├── RootNamespaceAttribute.cs │ │ └── baseline.netcore.json │ │ └── test │ │ ├── LocalizationServiceCollectionExtensionsTest.cs │ │ ├── Microsoft.Extensions.Localization.Tests.csproj │ │ ├── ResourceManagerStringLocalizerFactoryTest.cs │ │ └── ResourceManagerStringLocalizerTest.cs ├── Logging │ ├── Directory.Build.props │ ├── Logging.Abstractions │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── EventId.cs │ │ │ ├── IExternalScopeProvider.cs │ │ │ ├── ILogger.cs │ │ │ ├── ILoggerFactory.cs │ │ │ ├── ILoggerOfT.cs │ │ │ ├── ILoggerProvider.cs │ │ │ ├── ISupportExternalScope.cs │ │ │ ├── Internal │ │ │ ├── FormattedLogValues.cs │ │ │ ├── LogValuesFormatter.cs │ │ │ ├── NullScope.cs │ │ │ └── TypeNameHelper.cs │ │ │ ├── LogLevel.cs │ │ │ ├── LoggerExtensions.cs │ │ │ ├── LoggerExternalScopeProvider.cs │ │ │ ├── LoggerFactoryExtensions.cs │ │ │ ├── LoggerMessage.cs │ │ │ ├── LoggerOfT.cs │ │ │ ├── Microsoft.Extensions.Logging.Abstractions.csproj │ │ │ ├── NullLogger.cs │ │ │ ├── NullLoggerFactory.cs │ │ │ ├── NullLoggerOfT.cs │ │ │ ├── NullLoggerProvider.cs │ │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ └── Resource.Designer.cs │ │ │ ├── Resource.resx │ │ │ └── baseline.netcore.json │ ├── Logging.Analyzers │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── Descriptors.cs │ │ │ ├── LogFormatAnalyzer.cs │ │ │ └── Microsoft.Extensions.Logging.Analyzers.csproj │ │ └── test │ │ │ ├── LogFormatAnalyzerTests.cs │ │ │ ├── LoggingDiagnosticRunner.cs │ │ │ ├── Microsoft.Extensions.Logging.Analyzer.Tests.csproj │ │ │ └── xunit.runner.json │ ├── Logging.AzureAppServices │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── AzureAppServicesDiagnosticsSettings.cs │ │ │ ├── AzureAppServicesLoggerFactoryExtensions.cs │ │ │ ├── AzureBlobLoggerOptions.cs │ │ │ ├── AzureFileLoggerOptions.cs │ │ │ ├── Internal │ │ │ │ ├── BatchLoggerConfigureOptions.cs │ │ │ │ ├── BatchingLogger.cs │ │ │ │ ├── BatchingLoggerOptions.cs │ │ │ │ ├── BatchingLoggerProvider.cs │ │ │ │ ├── BlobAppendReferenceWrapper.cs │ │ │ │ ├── BlobLoggerConfigureOptions.cs │ │ │ │ ├── BlobLoggerProvider.cs │ │ │ │ ├── ConfigurationBasedLevelSwitcher.cs │ │ │ │ ├── FileLoggerConfigureOptions.cs │ │ │ │ ├── FileLoggerProvider.cs │ │ │ │ ├── ForwardingLoggerProvider.cs │ │ │ │ ├── ICloudAppendBlob.cs │ │ │ │ ├── IWebAppContext.cs │ │ │ │ ├── LogMessage.cs │ │ │ │ ├── SiteConfigurationProvider.cs │ │ │ │ └── WebAppContext.cs │ │ │ ├── Microsoft.Extensions.Logging.AzureAppServices.csproj │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── AzureAppendBlobTests.cs │ │ │ ├── AzureBlobSinkTests.cs │ │ │ ├── AzureDiagnosticsConfigurationProviderTests.cs │ │ │ ├── BatchingLoggerProviderTests.cs │ │ │ ├── ConfigureOptionsTests.cs │ │ │ ├── FileLoggerTests.cs │ │ │ ├── LoggerBuilderExtensionsTests.cs │ │ │ ├── ManualIntervalControl.cs │ │ │ ├── Microsoft.Extensions.Logging.AzureAppServices.Tests.csproj │ │ │ ├── OptionsWrapperMonitor.cs │ │ │ ├── TestBlobSink.cs │ │ │ ├── TestFileLoggerProvider.cs │ │ │ └── WebConfigurationLevelSwitchTests.cs │ ├── Logging.Configuration │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── ILoggerProviderConfiguration.cs │ │ │ ├── ILoggerProviderConfigurationFactory.cs │ │ │ ├── LoggerFilterConfigureOptions.cs │ │ │ ├── LoggerProviderConfiguration.cs │ │ │ ├── LoggerProviderConfigurationFactory.cs │ │ │ ├── LoggerProviderOptionsChangeTokenSource.cs │ │ │ ├── LoggingBuilderConfigurationExtensions.cs │ │ │ ├── LoggingBuilderExtensions.cs │ │ │ ├── LoggingConfiguration.cs │ │ │ ├── Microsoft.Extensions.Logging.Configuration.csproj │ │ │ └── baseline.netcore.json │ ├── Logging.Console │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── ConfigurationConsoleLoggerSettings.cs │ │ │ ├── ConsoleLogScope.cs │ │ │ ├── ConsoleLogger.cs │ │ │ ├── ConsoleLoggerFactoryExtensions.cs │ │ │ ├── ConsoleLoggerOptions.cs │ │ │ ├── ConsoleLoggerOptionsSetup.cs │ │ │ ├── ConsoleLoggerProvider.cs │ │ │ ├── ConsoleLoggerSettings.cs │ │ │ ├── IConsoleLoggerSettings.cs │ │ │ ├── Internal │ │ │ ├── AnsiLogConsole.cs │ │ │ ├── ConsoleLoggerProcessor.cs │ │ │ ├── IAnsiSystemConsole.cs │ │ │ ├── IConsole.cs │ │ │ ├── LogMessageEntry.cs │ │ │ └── WindowsLogConsole.cs │ │ │ ├── Microsoft.Extensions.Logging.Console.csproj │ │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ │ └── baseline.netcore.json │ ├── Logging.Debug │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── DebugLogger.cs │ │ │ ├── DebugLogger.debug.cs │ │ │ ├── DebugLoggerFactoryExtensions.cs │ │ │ ├── DebugLoggerProvider.cs │ │ │ ├── Microsoft.Extensions.Logging.Debug.csproj │ │ │ └── baseline.netcore.json │ ├── Logging.EventLog │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── EventLogLogger.cs │ │ │ ├── EventLogLoggerProvider.cs │ │ │ ├── EventLogSettings.cs │ │ │ ├── EventLoggerFactoryExtensions.cs │ │ │ ├── Internal │ │ │ └── IEventLog.cs │ │ │ ├── Microsoft.Extensions.Logging.EventLog.csproj │ │ │ ├── WindowsEventLog.cs │ │ │ ├── baseline.netcore.json │ │ │ └── baseline.netframework.json │ ├── Logging.EventSource │ │ ├── Directory.Build.props │ │ ├── src │ │ │ ├── EventLogFiltersConfigureOptions.cs │ │ │ ├── EventLogFiltersConfigureOptionsChangeSource.cs │ │ │ ├── EventSourceLogger.cs │ │ │ ├── EventSourceLoggerFactoryExtensions.cs │ │ │ ├── EventSourceLoggerProvider.cs │ │ │ ├── ExceptionInfo.cs │ │ │ ├── LoggingEventSource.cs │ │ │ ├── Microsoft.Extensions.Logging.EventSource.csproj │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── baseline.net45.json │ │ │ └── baseline.netcore.json │ │ └── test │ │ │ ├── AssemblyInfo.cs │ │ │ ├── AzureAppServicesLoggerFactoryExtensionsTests.cs │ │ │ ├── EventSourceLoggerTest.cs │ │ │ └── Microsoft.Extensions.Logging.EventSource.Tests.csproj │ ├── Logging.Testing │ │ ├── src │ │ │ ├── AssemblyTestLog.cs │ │ │ ├── BeginScopeContext.cs │ │ │ ├── ITestSink.cs │ │ │ ├── LogValuesAssert.cs │ │ │ ├── LoggedTest │ │ │ │ ├── ILoggedTest.cs │ │ │ │ ├── LoggedTest.cs │ │ │ │ └── LoggedTestBase.cs │ │ │ ├── Microsoft.Extensions.Logging.Testing.csproj │ │ │ ├── Properties │ │ │ │ └── AssemblyInfo.cs │ │ │ ├── RetryContext.cs │ │ │ ├── ShortClassNameAttribute.cs │ │ │ ├── TestFrameworkFileLoggerAttribute.cs │ │ │ ├── TestLogger.cs │ │ │ ├── TestLoggerFactory.cs │ │ │ ├── TestLoggerOfT.cs │ │ │ ├── TestLoggerProvider.cs │ │ │ ├── TestSink.cs │ │ │ ├── WriteContext.cs │ │ │ ├── Xunit │ │ │ │ ├── LogLevelAttribute.cs │ │ │ │ ├── LoggedConditionalFactDiscoverer.cs │ │ │ │ ├── LoggedConditionalTheoryDiscoverer.cs │ │ │ │ ├── LoggedFactDiscoverer.cs │ │ │ │ ├── LoggedTestAssemblyRunner.cs │ │ │ │ ├── LoggedTestCase.cs │ │ │ │ ├── LoggedTestCaseRunner.cs │ │ │ │ ├── LoggedTestClassRunner.cs │ │ │ │ ├── LoggedTestCollectionRunner.cs │ │ │ │ ├── LoggedTestFramework.cs │ │ │ │ ├── LoggedTestFrameworkDiscoverer.cs │ │ │ │ ├── LoggedTestFrameworkExecutor.cs │ │ │ │ ├── LoggedTestInvoker.cs │ │ │ │ ├── LoggedTestMethodRunner.cs │ │ │ │ ├── LoggedTestRunner.cs │ │ │ │ ├── LoggedTheoryDiscoverer.cs │ │ │ │ ├── LoggedTheoryTestCase.cs │ │ │ │ ├── LoggedTheoryTestCaseRunner.cs │ │ │ │ └── RetryTestAttribute.cs │ │ │ ├── XunitLoggerFactoryExtensions.cs │ │ │ ├── XunitLoggerProvider.cs │ │ │ ├── baseline.netcore.json │ │ │ └── build │ │ │ │ └── Microsoft.Extensions.Logging.Testing.props │ │ └── test │ │ │ ├── AssemblyTestLogTests.cs │ │ │ ├── LogValuesAssertTest.cs │ │ │ ├── LoggedTestXunitRetryTests.cs │ │ │ ├── LoggedTestXunitTests.cs │ │ │ ├── Microsoft.Extensions.Logging.Testing.Tests.csproj │ │ │ ├── TestTestOutputHelper.cs │ │ │ └── XunitLoggerProviderTest.cs │ ├── Logging.TraceSource │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── Microsoft.Extensions.Logging.TraceSource.csproj │ │ │ ├── TraceSourceFactoryExtensions.cs │ │ │ ├── TraceSourceLogger.cs │ │ │ ├── TraceSourceLoggerProvider.cs │ │ │ ├── TraceSourceScope.cs │ │ │ └── baseline.netcore.json │ ├── Logging │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── DefaultLoggerLevelConfigureOptions.cs │ │ │ ├── FilterLoggingBuilderExtensions.cs │ │ │ ├── ILoggingBuilder.cs │ │ │ ├── Logger.cs │ │ │ ├── LoggerFactory.cs │ │ │ ├── LoggerFilterOptions.cs │ │ │ ├── LoggerFilterRule.cs │ │ │ ├── LoggerInformation.cs │ │ │ ├── LoggerRuleSelector.cs │ │ │ ├── LoggingBuilder.cs │ │ │ ├── LoggingBuilderExtensions.cs │ │ │ ├── LoggingServiceCollectionExtensions.cs │ │ │ ├── Microsoft.Extensions.Logging.csproj │ │ │ ├── Properties │ │ │ └── AssemlyInfo.cs │ │ │ ├── ProviderAliasAttribute.cs │ │ │ ├── ProviderAliasUtilities.cs │ │ │ ├── StaticFilterOptionsMonitor.cs │ │ │ └── baseline.netcore.json │ ├── README.md │ ├── samples │ │ └── SampleApp │ │ │ ├── LoggerExtensions.cs │ │ │ ├── Program.cs │ │ │ ├── SampleApp.csproj │ │ │ └── logging.json │ └── test │ │ ├── AnsiLogConsoleTest.cs │ │ ├── Console │ │ ├── ConsoleContext.cs │ │ ├── ConsoleSink.cs │ │ └── TestConsole.cs │ │ ├── ConsoleLoggerTest.cs │ │ ├── DebugLoggerTest.cs │ │ ├── EventIdTest.cs │ │ ├── EventLogLoggerTest.cs │ │ ├── FormattedLogValuesTest.cs │ │ ├── LogLevelEnumTest.cs │ │ ├── LoggerBuilderExtensionsTests.cs │ │ ├── LoggerExtensionsTest.cs │ │ ├── LoggerFactoryExtensionsTest.cs │ │ ├── LoggerFactoryTest.cs │ │ ├── LoggerFilterTest.cs │ │ ├── LoggerMessageTest.cs │ │ ├── LoggerProviderConfigurationFactoryTest.cs │ │ ├── LoggerProviderConfigurationTests.cs │ │ ├── LoggerTest.cs │ │ ├── LoggingServiceCollectionExtensionsTest.cs │ │ ├── Microsoft.Extensions.Logging.Tests.csproj │ │ ├── NullLoggerFactoryTest.cs │ │ ├── NullLoggerTest.cs │ │ ├── ProviderAliasAttribute.cs │ │ ├── TestLoggerBuilder.cs │ │ ├── TestLoggerExtensions.cs │ │ ├── TestLoggerProvider.cs │ │ ├── TraceSourceLoggerProviderTest.cs │ │ ├── TraceSourceLoggerTest.cs │ │ ├── TraceSourceScopeTest.cs │ │ └── TypeNameHelperTest.cs ├── ObjectPool │ ├── Directory.Build.props │ ├── perf │ │ ├── Microsoft.Extensions.ObjectPool.Performance.csproj │ │ ├── ObjectPoolBenchmark.cs │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── StringBuilderPoolBenchmark.cs │ ├── src │ │ ├── DefaultObjectPool.cs │ │ ├── DefaultObjectPoolProvider.cs │ │ ├── DefaultPooledObjectPolicy.cs │ │ ├── IPooledObjectPolicy.cs │ │ ├── LeakTrackingObjectPool.cs │ │ ├── LeakTrackingObjectPoolProvider.cs │ │ ├── Microsoft.Extensions.ObjectPool.csproj │ │ ├── ObjectPool.cs │ │ ├── ObjectPoolProvider.cs │ │ ├── ObjectPoolProviderExtensions.cs │ │ ├── PooledObjectPolicy.cs │ │ ├── StringBuilderPooledObjectPolicy.cs │ │ └── baseline.netcore.json │ └── test │ │ ├── DefaultObjectPoolTest.cs │ │ ├── Microsoft.Extensions.ObjectPool.Tests.csproj │ │ └── ThreadingTest.cs ├── Options │ ├── ConfigurationExtensions │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── ConfigurationChangeTokenSource.cs │ │ │ ├── ConfigureFromConfigurationOptions.cs │ │ │ ├── Microsoft.Extensions.Options.ConfigurationExtensions.csproj │ │ │ ├── NamedConfigureFromConfigurationOptions.cs │ │ │ ├── OptionsBuilderConfigurationExtensions.cs │ │ │ ├── OptionsConfigurationServiceCollectionExtensions.cs │ │ │ └── baseline.netcore.json │ ├── DataAnnotations │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── DataAnnotationValidateOptions.cs │ │ │ ├── Microsoft.Extensions.Options.DataAnnotations.csproj │ │ │ ├── OptionsBuilderDataAnnotationsExtensions.cs │ │ │ └── baseline.netcore.json │ ├── Options │ │ ├── Directory.Build.props │ │ └── src │ │ │ ├── ConfigureNamedOptions.cs │ │ │ ├── ConfigureOptions.cs │ │ │ ├── IConfigureNamedOptions.cs │ │ │ ├── IConfigureOptions.cs │ │ │ ├── IOptions.cs │ │ │ ├── IOptionsChangeTokenSource.cs │ │ │ ├── IOptionsFactory.cs │ │ │ ├── IOptionsMonitor.cs │ │ │ ├── IOptionsMonitorCache.cs │ │ │ ├── IOptionsSnapshot.cs │ │ │ ├── IPostConfigureOptions.cs │ │ │ ├── IValidateOptions.cs │ │ │ ├── Microsoft.Extensions.Options.csproj │ │ │ ├── Options.cs │ │ │ ├── OptionsBuilder.cs │ │ │ ├── OptionsCache.cs │ │ │ ├── OptionsFactory.cs │ │ │ ├── OptionsManager.cs │ │ │ ├── OptionsMonitor.cs │ │ │ ├── OptionsMonitorExtensions.cs │ │ │ ├── OptionsServiceCollectionExtensions.cs │ │ │ ├── OptionsValidationException.cs │ │ │ ├── OptionsWrapper.cs │ │ │ ├── PostConfigureOptions.cs │ │ │ ├── Properties │ │ │ ├── AssemblyInfo.cs │ │ │ └── Resources.Designer.cs │ │ │ ├── Resources.resx │ │ │ ├── ValidateOptions.cs │ │ │ ├── ValidateOptionsResult.cs │ │ │ └── baseline.netcore.json │ ├── README.md │ └── test │ │ ├── ComplexOptions.cs │ │ ├── FakeChangeToken.cs │ │ ├── FakeOptions.cs │ │ ├── FakeOptionsFactory.cs │ │ ├── Microsoft.Extensions.Options.Tests.csproj │ │ ├── OptionsBuilderTest.cs │ │ ├── OptionsFactoryTests.cs │ │ ├── OptionsMonitorTest.cs │ │ ├── OptionsSnapshotTest.cs │ │ ├── OptionsTest.cs │ │ └── OptionsValidationTests.cs ├── Primitives │ ├── Directory.Build.props │ ├── perf │ │ ├── Microsoft.Extensions.Primitives.Performance.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ └── StringSegmentBenchmark.cs │ ├── src │ │ ├── CancellationChangeToken.cs │ │ ├── ChangeToken.cs │ │ ├── CompositeChangeToken.cs │ │ ├── Extensions.cs │ │ ├── IChangeToken.cs │ │ ├── InplaceStringBuilder.cs │ │ ├── Microsoft.Extensions.Primitives.csproj │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── StringSegment.cs │ │ ├── StringSegmentComparer.cs │ │ ├── StringTokenizer.cs │ │ ├── StringValues.cs │ │ ├── ThrowHelper.cs │ │ └── baseline.netcore.json │ └── test │ │ ├── ChangeTokenTest.cs │ │ ├── CompositeChangeTokenTest.cs │ │ ├── InplaceStringBuilderTest.cs │ │ ├── Microsoft.Extensions.Primitives.Tests.csproj │ │ ├── StringSegmentTest.cs │ │ ├── StringTokenizerTest.cs │ │ └── StringValuesTests.cs ├── Shared │ ├── src │ │ ├── ActivatorUtilities │ │ │ ├── ActivatorUtilities.cs │ │ │ ├── ActivatorUtilitiesConstructorAttribute.cs │ │ │ ├── ObjectFactory.cs │ │ │ └── sharedsources.props │ │ ├── BenchmarkRunner │ │ │ ├── AspNetCoreBenchmarkAttribute.cs │ │ │ ├── DefaultCoreConfig.cs │ │ │ ├── DefaultCoreDebugConfig.cs │ │ │ ├── DefaultCorePerfLabConfig.cs │ │ │ ├── DefaultCoreProfileConfig.cs │ │ │ ├── DefaultCoreValidationConfig.cs │ │ │ ├── Directory.Build.props │ │ │ ├── ParameterizedJobConfigAttribute.cs │ │ │ ├── ParamsDisplayInfoColumn.cs │ │ │ └── Program.cs │ │ ├── CommandLineUtils │ │ │ ├── CommandLine │ │ │ │ ├── AnsiConsole.cs │ │ │ │ ├── CommandArgument.cs │ │ │ │ ├── CommandLineApplication.cs │ │ │ │ ├── CommandOption.cs │ │ │ │ ├── CommandOptionType.cs │ │ │ │ └── CommandParsingException.cs │ │ │ ├── Microsoft.Extensions.CommandLineUtils.Sources.projitems │ │ │ ├── Microsoft.Extensions.CommandLineUtils.Sources.shproj │ │ │ └── Utilities │ │ │ │ ├── ArgumentEscaper.cs │ │ │ │ └── DotNetMuxer.cs │ │ ├── Directory.Build.props │ │ ├── EmptyDisposable.cs │ │ ├── HashCodeCombiner │ │ │ └── HashCodeCombiner.cs │ │ ├── NonCapturingTimer │ │ │ └── NonCapturingTimer.cs │ │ ├── ParameterDefaultValue │ │ │ └── ParameterDefaultValue.cs │ │ ├── TypeNameHelper │ │ │ └── TypeNameHelper.cs │ │ └── ValueStopwatch │ │ │ └── ValueStopwatch.cs │ └── test │ │ ├── ArgumentEscaperTests.cs │ │ ├── CommandLineApplicationTests.cs │ │ ├── DotNetMuxerTests.cs │ │ ├── HashCodeCombinerTest.cs │ │ ├── Microsoft.Extensions.Sources.Tests.csproj │ │ ├── NonCapturingTimerTest.cs │ │ ├── TypeNameHelperTest.cs │ │ └── ValueStopwatchTest.cs ├── TestingUtils │ ├── Internal.AspNetCore.Analyzers │ │ ├── src │ │ │ ├── Internal.AspNetCore.Analyzers.csproj │ │ │ ├── PubternalityAnalyzer.cs │ │ │ └── PubturnalityDescriptors.cs │ │ └── test │ │ │ ├── Internal.AspNetCore.Analyzers.Tests.csproj │ │ │ └── PubternabilityAnalyzerTests.cs │ ├── Microsoft.AspNetCore.Analyzer.Testing │ │ └── src │ │ │ ├── Assert.cs │ │ │ ├── CodeFixRunner.cs │ │ │ ├── DiagnosticAnalyzerRunner.cs │ │ │ ├── DiagnosticLocation.cs │ │ │ ├── DiagnosticProject.cs │ │ │ ├── DiagnosticVerifier.cs │ │ │ ├── Microsoft.AspNetCore.Analyzer.Testing.csproj │ │ │ ├── TestSource.cs │ │ │ └── build │ │ │ └── Microsoft.AspNetCore.Analyzer.Testing.props │ └── Microsoft.AspNetCore.Testing │ │ ├── src │ │ ├── CultureReplacer.cs │ │ ├── ExceptionAssertions.cs │ │ ├── HttpClientSlim.cs │ │ ├── Microsoft.AspNetCore.Testing.csproj │ │ ├── Properties │ │ │ └── AssemblyInfo.cs │ │ ├── ReplaceCulture.cs │ │ ├── TaskExtensions.cs │ │ ├── TestPathUtilities.cs │ │ ├── TestPlatformHelper.cs │ │ ├── Tracing │ │ │ ├── CollectingEventListener.cs │ │ │ ├── EventAssert.cs │ │ │ └── EventSourceTestBase.cs │ │ ├── contentFiles │ │ │ └── cs │ │ │ │ └── netstandard2.0 │ │ │ │ └── EventSourceTestCollection.cs │ │ └── xunit │ │ │ ├── ConditionalFactAttribute.cs │ │ │ ├── ConditionalFactDiscoverer.cs │ │ │ ├── ConditionalTheoryAttribute.cs │ │ │ ├── ConditionalTheoryDiscoverer.cs │ │ │ ├── DockerOnlyAttribute.cs │ │ │ ├── EnvironmentVariableSkipConditionAttribute.cs │ │ │ ├── FrameworkSkipConditionAttribute.cs │ │ │ ├── IEnvironmentVariable.cs │ │ │ ├── ITestCondition.cs │ │ │ ├── MinimumOsVersionAttribute.cs │ │ │ ├── OSSkipConditionAttribute.cs │ │ │ ├── OperatingSystems.cs │ │ │ ├── RuntimeFrameworks.cs │ │ │ ├── SkippedTestCase.cs │ │ │ ├── TestMethodExtensions.cs │ │ │ └── WindowsVersions.cs │ │ └── test │ │ ├── CollectingEventListenerTest.cs │ │ ├── ConditionalFactTest.cs │ │ ├── ConditionalTheoryTest.cs │ │ ├── DockerTests.cs │ │ ├── EnvironmentVariableSkipConditionTest.cs │ │ ├── ExceptionAssertTest.cs │ │ ├── HttpClientSlimTest.cs │ │ ├── Microsoft.AspNetCore.Testing.Tests.csproj │ │ ├── OSSkipConditionAttributeTest.cs │ │ ├── OSSkipConditionTest.cs │ │ ├── ReplaceCultureAttributeTest.cs │ │ ├── TaskExtensionsTest.cs │ │ ├── TestPathUtilitiesTest.cs │ │ └── TestPlatformHelperTest.cs └── WebEncoders │ ├── Directory.Build.props │ ├── src │ ├── EncoderServiceCollectionExtensions.cs │ ├── Microsoft.Extensions.WebEncoders.csproj │ ├── Testing │ │ ├── HtmlTestEncoder.cs │ │ ├── JavaScriptTestEncoder.cs │ │ └── UrlTestEncoder.cs │ ├── WebEncoderOptions.cs │ └── baseline.netcore.json │ └── test │ ├── EncoderServiceCollectionExtensionsTests.cs │ ├── HtmlTestEncoderTest.cs │ └── Microsoft.Extensions.WebEncoders.Tests.csproj └── version.props /.editorconfig: -------------------------------------------------------------------------------- 1 | ; EditorConfig to support per-solution formatting. 2 | ; Use the EditorConfig VS add-in to make this work. 3 | ; http://editorconfig.org/ 4 | 5 | ; This is the default for the codeline. 6 | root = true 7 | 8 | [*] 9 | indent_style = space 10 | charset = utf-8 11 | trim_trailing_whitespace = true 12 | insert_final_newline = true 13 | 14 | [*.cs] 15 | indent_size = 4 16 | dotnet_sort_system_directives_first = true:warning 17 | 18 | [*.{xml,config,*proj,nuspec,props,resx,targets,yml,tasks}] 19 | indent_size = 2 20 | 21 | [*.json] 22 | indent_size = 2 23 | 24 | [*.{ps1,psm1}] 25 | indent_size = 4 26 | 27 | [*.sh] 28 | indent_size = 4 29 | end_of_line = lf 30 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report about something that is not working 4 | --- 5 | 6 | ### Describe the bug 7 | A clear and concise description of what the bug is. 8 | 9 | ### To Reproduce 10 | Steps to reproduce the behavior: 11 | 1. Using version '...' of package '...' 12 | 2. Run this code '....' 13 | 3. With these arguments '....' 14 | 4. See error 15 | 16 | ### Expected behavior 17 | A clear and concise description of what you expected to happen. 18 | 19 | ### Screenshots 20 | If applicable, add screenshots to help explain your problem. 21 | 22 | ### Additional context 23 | Add any other context about the problem here. 24 | Include the output of `dotnet --info` 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | --- 5 | 6 | ### Is your feature request related to a problem? Please describe. 7 | A clear and concise description of what the problem is. 8 | Example. I'm am trying to do [...] but [...] 9 | 10 | ### Describe the solution you'd like 11 | A clear and concise description of what you want to happen. 12 | 13 | ### Describe alternatives you've considered 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | ### Additional context 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Summary of the changes (Less than 80 chars) 2 | - Detail 1 3 | - Detail 2 4 | 5 | Addresses #bugnumber (in this specific format) 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | [Oo]bj/ 2 | [Bb]in/ 3 | TestResults/ 4 | .nuget/ 5 | .testPublish/ 6 | *.sln.ide/ 7 | _ReSharper.*/ 8 | packages/ 9 | artifacts/ 10 | PublishProfiles/ 11 | .vs/ 12 | bower_components/ 13 | node_modules/ 14 | **/wwwroot/lib/ 15 | debugSettings.json 16 | project.lock.json 17 | *.user 18 | *.suo 19 | *.cache 20 | *.docstates 21 | _ReSharper.* 22 | *.exe 23 | *.psess 24 | *.vsp 25 | *.pidb 26 | *.userprefs 27 | *DS_Store 28 | *.ncrunchsolution 29 | *.*sdf 30 | *.ipch 31 | .settings 32 | *.sln.ide 33 | node_modules/ 34 | **/[Cc]ompiler/[Rr]esources/**/*.js 35 | .vscode/ 36 | .testPublish/ 37 | global.json 38 | BenchmarkDotNet.Artifacts/ 39 | *.binlog 40 | -------------------------------------------------------------------------------- /NuGet.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /build.cmd: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0build.ps1' %*; exit $LASTEXITCODE" 3 | -------------------------------------------------------------------------------- /eng/AspNetCore.snk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uhaciogullari/HttpClientFactoryLite/93509804c898e33c0d2e680dfad41d03203e8dca/eng/AspNetCore.snk -------------------------------------------------------------------------------- /eng/scripts/KillProcesses.ps1: -------------------------------------------------------------------------------- 1 | $ErrorActionPreference = 'Continue' 2 | 3 | taskkill /T /F /IM dotnet.exe 4 | taskkill /T /F /IM testhost.exe 5 | taskkill /T /F /IM iisexpress.exe 6 | taskkill /T /F /IM iisexpresstray.exe 7 | taskkill /T /F /IM w3wp.exe 8 | taskkill /T /F /IM msbuild.exe 9 | taskkill /T /F /IM vbcscompiler.exe 10 | taskkill /T /F /IM git.exe 11 | taskkill /T /F /IM vctip.exe 12 | taskkill /T /F /IM chrome.exe 13 | taskkill /T /F /IM h2spec.exe 14 | iisreset /restart 15 | 16 | exit 0 17 | -------------------------------------------------------------------------------- /eng/scripts/KillProcesses.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | pkill dotnet || true 4 | exit 0 5 | -------------------------------------------------------------------------------- /eng/targets/Packaging.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /eng/tools/BaselineGenerator/README.md: -------------------------------------------------------------------------------- 1 | BaselineGenerator 2 | ================= 3 | 4 | This tool is used to generate an MSBuild file which sets the "baseline" against which servicing updates are built. 5 | 6 | ## Usage 7 | 8 | 1. Add to the [Baseline.xml](../../Baseline.xml) a list of package ID's and their latest released versions. The source of this information can typically 9 | be found in the build.xml file generated during ProdCon builds. See https://github.com/dotnet/versions/blob/master/build-info/dotnet/product/cli/release/2.1.6/build.xml for example. 10 | - Update the version at the top of Baseline.xml to match prior release (even if no packages changed in the prior release). 11 | 2. Run `dotnet run` on this project. 12 | -------------------------------------------------------------------------------- /eng/tools/Directory.Build.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /eng/tools/Directory.Build.targets: -------------------------------------------------------------------------------- 1 |  2 | 3 | -------------------------------------------------------------------------------- /korebuild-lock.txt: -------------------------------------------------------------------------------- 1 | version:2.2.1-build-20190104.5 2 | commithash:abf5766bd636c29b089ea2995ada30de00d563ff 3 | -------------------------------------------------------------------------------- /korebuild.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.2/tools/korebuild.schema.json", 3 | "channel": "release/2.2" 4 | } 5 | -------------------------------------------------------------------------------- /src/Caching/Abstractions/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Caching/Abstractions/src/CacheItemPriority.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Caching.Memory 5 | { 6 | // TODO: Granularity? 7 | /// 8 | /// Specifies how items are prioritized for preservation during a memory pressure triggered cleanup. 9 | /// 10 | public enum CacheItemPriority 11 | { 12 | Low, 13 | Normal, 14 | High, 15 | NeverRemove, 16 | } 17 | } -------------------------------------------------------------------------------- /src/Caching/Abstractions/src/Internal/ISystemClock.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Internal 7 | { 8 | /// 9 | /// Abstracts the system clock to facilitate testing. 10 | /// 11 | public interface ISystemClock 12 | { 13 | /// 14 | /// Retrieves the current system time in UTC. 15 | /// 16 | DateTimeOffset UtcNow { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Caching/Abstractions/src/PostEvictionCallbackRegistration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Caching.Memory 5 | { 6 | public class PostEvictionCallbackRegistration 7 | { 8 | public PostEvictionDelegate EvictionCallback { get; set; } 9 | 10 | public object State { get; set; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Caching/Memory/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Caching/Memory/src/MemoryDistributedCacheOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Caching.Memory 5 | { 6 | public class MemoryDistributedCacheOptions : MemoryCacheOptions 7 | { 8 | public MemoryDistributedCacheOptions() 9 | : base() 10 | { 11 | // Default size limit of 200 MB 12 | SizeLimit = 200 * 1024 * 1024; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/Caching/Memory/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Caching.Memory.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/Caching/Memory/test/Infrastructure/TestClock.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Internal 7 | { 8 | public class TestClock : ISystemClock 9 | { 10 | public TestClock() 11 | { 12 | UtcNow = new DateTime(2013, 6, 15, 12, 34, 56, 789); 13 | } 14 | 15 | public DateTimeOffset UtcNow { get; set; } 16 | 17 | public void Add(TimeSpan timeSpan) 18 | { 19 | UtcNow = UtcNow + timeSpan; 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Caching/Memory/test/Infrastructure/TokenCallbackRegistration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Caching.Memory.Infrastructure 7 | { 8 | public class TokenCallbackRegistration : IDisposable 9 | { 10 | public Action RegisteredCallback { get; set; } 11 | 12 | public object RegisteredState { get; set; } 13 | 14 | public bool Disposed { get; set; } 15 | 16 | public void Dispose() 17 | { 18 | Disposed = true; 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /src/Caching/Memory/test/Microsoft.Extensions.Caching.Memory.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | Caching.Memory 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Caching/README.md: -------------------------------------------------------------------------------- 1 | Caching 2 | ======= 3 | 4 | Contains libraries for in-memory caching and distributed caching. Includes distributed cache implementations for in-memory, Microsoft SQL Server, and Redis. 5 | -------------------------------------------------------------------------------- /src/Caching/Redis/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Caching/Redis/test/Microsoft.Extensions.Caching.Redis.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Caching/SqlServer/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Caching/SqlServer/src/PlatformHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Caching.SqlServer 7 | { 8 | internal static class PlatformHelper 9 | { 10 | private static Lazy _isMono = new Lazy(() => Type.GetType("Mono.Runtime") != null); 11 | 12 | public static bool IsMono 13 | { 14 | get 15 | { 16 | return _isMono.Value; 17 | } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /src/Caching/SqlServer/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Reflection; 5 | using System.Resources; 6 | using System.Runtime.CompilerServices; 7 | 8 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Caching.SqlServer.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 9 | -------------------------------------------------------------------------------- /src/Caching/SqlServer/test/CacheItemInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Caching.SqlServer 7 | { 8 | public class CacheItemInfo 9 | { 10 | public string Id { get; set; } 11 | 12 | public byte[] Value { get; set; } 13 | 14 | public DateTimeOffset ExpiresAtTime { get; set; } 15 | 16 | public TimeSpan? SlidingExpirationInSeconds { get; set; } 17 | 18 | public DateTimeOffset? AbsoluteExpiration { get; set; } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Caching/SqlServer/test/Microsoft.Extensions.Caching.SqlServer.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Caching/SqlServer/test/TestOptions.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Options; 2 | 3 | namespace Microsoft.Extensions.Caching.SqlServer 4 | { 5 | internal class TestSqlServerCacheOptions : IOptions 6 | { 7 | private readonly SqlServerCacheOptions _innerOptions; 8 | 9 | public TestSqlServerCacheOptions(SqlServerCacheOptions innerOptions) 10 | { 11 | _innerOptions = innerOptions; 12 | } 13 | 14 | public SqlServerCacheOptions Value 15 | { 16 | get 17 | { 18 | return _innerOptions; 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/Caching/SqlServer/test/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionString": "Server=localhost;Database=CacheTestDb;Trusted_Connection=True;", 3 | "SchemaName": "dbo", 4 | "TableName": "CacheTest" 5 | } -------------------------------------------------------------------------------- /src/Caching/StackExchangeRedis/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Caching/StackExchangeRedis/test/Microsoft.Extensions.Caching.StackExchangeRedis.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Caching/samples/MemoryCacheConcurencySample/MemoryCacheConcurencySample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net461;netcoreapp2.2 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Caching/samples/MemoryCacheFileWatchSample/MemoryCacheFileWatchSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net461;netcoreapp2.2 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Caching/samples/MemoryCacheFileWatchSample/WatchedFiles/example.txt: -------------------------------------------------------------------------------- 1 | Hello World -------------------------------------------------------------------------------- /src/Caching/samples/MemoryCacheSample/MemoryCacheSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net461;netcoreapp2.2 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Caching/samples/ProfilingSample/ProfilingSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net461;netcoreapp2.2 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Caching/samples/RedisCacheSample/RedisCacheSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net461;netcoreapp2.2 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Caching/samples/SqlServerCacheConcurencySample/SqlServerCacheConcurencySample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net461;netcoreapp2.2 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/Caching/samples/SqlServerCacheConcurencySample/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionString": "Server=localhost;Database=CacheConcurrencySampleDb;Trusted_Connection=True;", 3 | "SchemaName": "dbo", 4 | "TableName": "CacheConcurrencySample" 5 | } -------------------------------------------------------------------------------- /src/Caching/samples/SqlServerCacheSample/SqlServerCacheSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net461;netcoreapp2.2 5 | Exe 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Caching/samples/SqlServerCacheSample/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ConnectionString": "Server=localhost;Database=CacheSampleDb;Trusted_Connection=True;", 3 | "SchemaName": "dbo", 4 | "TableName": "CacheSample" 5 | } -------------------------------------------------------------------------------- /src/Configuration/Config.Abstractions/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.AzureKeyVault/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.AzureKeyVault/samples/KeyVaultSample.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2;net461 5 | portable 6 | Exe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Configuration/Config.AzureKeyVault/samples/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CertificateThumbprint": "", 3 | "Vault": "", 4 | "ClientId": "" 5 | } 6 | -------------------------------------------------------------------------------- /src/Configuration/Config.AzureKeyVault/test/Microsoft.Extensions.Configuration.AzureKeyVault.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Configuration/Config.Binder/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.Binder/src/BinderOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Configuration 5 | { 6 | /// 7 | /// Options class used by the . 8 | /// 9 | public class BinderOptions 10 | { 11 | /// 12 | /// When false (the default), the binder will only attempt to set public properties. 13 | /// If true, the binder will attempt to set all non read-only properties. 14 | /// 15 | public bool BindNonPublicProperties { get; set; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Configuration/Config.Binder/src/Microsoft.Extensions.Configuration.Binder.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Functionality to bind an object to data in configuration providers for Microsoft.Extensions.Configuration. 5 | netstandard2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Configuration/Config.Binder/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.Binder.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.Binder/test/Microsoft.Extensions.Configuration.Binder.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Configuration/Config.CommandLine/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.CommandLine/src/Microsoft.Extensions.Configuration.CommandLine.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Command line configuration provider implementation for Microsoft.Extensions.Configuration. 5 | netstandard2.0 6 | $(PackageTags);commandline 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Configuration/Config.CommandLine/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.CommandLine.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.CommandLine/test/Microsoft.Extensions.Configuration.CommandLine.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Configuration/Config.EnvironmentVariables/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.EnvironmentVariables/src/Microsoft.Extensions.Configuration.EnvironmentVariables.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Environment variables configuration provider implementation for Microsoft.Extensions.Configuration. 5 | netstandard2.0 6 | $(PackageTags);envvar;environmentvariable 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Configuration/Config.EnvironmentVariables/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.EnvironmentVariables.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.EnvironmentVariables/test/Microsoft.Extensions.Configuration.EnvironmentVariables.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Configuration/Config.FileExtensions/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.FileExtensions/src/Microsoft.Extensions.Configuration.FileExtensions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Extension methods for configuring file-based configuration providers for Microsoft.Extensions.Configuration. 5 | netstandard2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Configuration/Config.FileExtensions/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.FileExtensions.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.FileExtensions/test/Microsoft.Extensions.Configuration.FileExtensions.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Configuration/Config.Ini/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.Ini/src/Microsoft.Extensions.Configuration.Ini.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | INI configuration provider implementation for Microsoft.Extensions.Configuration. 5 | netstandard2.0 6 | $(PackageTags);ini 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Configuration/Config.Ini/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.Ini.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.Ini/test/Microsoft.Extensions.Configuration.Ini.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Configuration/Config.Json/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.Json/src/Microsoft.Extensions.Configuration.Json.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | JSON configuration provider implementation for Microsoft.Extensions.Configuration. 5 | netstandard2.0 6 | $(PackageTags);json 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Configuration/Config.Json/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.Json.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.Json/test/Microsoft.Extensions.Configuration.Json.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Configuration/Config.KeyPerFile/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.KeyPerFile/src/Microsoft.Extensions.Configuration.KeyPerFile.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Configuration provider that uses files in a directory for Microsoft.Extensions.Configuration. 5 | netstandard2.0 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Configuration/Config.KeyPerFile/src/README.md: -------------------------------------------------------------------------------- 1 |  2 | This is a configuration provider that uses a directory's files as data. A file's name is the key and the contents are the value. 3 | -------------------------------------------------------------------------------- /src/Configuration/Config.KeyPerFile/test/Microsoft.Extensions.Configuration.KeyPerFile.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Configuration/Config.UserSecrets/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.UserSecrets/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.UserSecrets.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/Configuration/Config.UserSecrets/src/build/netstandard2.0/Microsoft.Extensions.Configuration.UserSecrets.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Configuration/Config.UserSecrets/test/Microsoft.Extensions.Configuration.UserSecrets.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2 5 | 6 | 7 | 8 | 9 | 10 | 11 | <_Parameter1>TargetFramework 12 | <_Parameter2>$(TargetFramework) 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Configuration/Config.Xml/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.Xml/src/Microsoft.Extensions.Configuration.Xml.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | XML configuration provider implementation for Microsoft.Extensions.Configuration. 5 | netstandard2.0 6 | $(PackageTags);xml 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Configuration/Config.Xml/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.Xml.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config.Xml/test/Microsoft.Extensions.Configuration.Xml.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Configuration/Config/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config/src/Microsoft.Extensions.Configuration.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Implementation of key-value pair based configuration for Microsoft.Extensions.Configuration. Includes the memory configuration provider. 5 | netstandard2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Configuration/Config/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Configuration.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | 8 | -------------------------------------------------------------------------------- /src/Configuration/Config/test/Microsoft.Extensions.Configuration.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Configuration/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | configuration 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Configuration/README.md: -------------------------------------------------------------------------------- 1 | Configuration 2 | ============= 3 | 4 | Configuration is a framework for accessing Key/Value based configuration settings in an application. Includes configuration providers for command line arguments, environment variables, INI files, JSON files, and XML files. 5 | 6 | ## Blog posts 7 | 8 | * [ASP.NET vNext Moving Parts: IConfiguration](http://whereslou.com/2014/05/23/asp-net-vnext-moving-parts-iconfiguration/) 9 | * [ASP.NET 5 Configuration - Microsoft.Extensions.ConfigurationModel](http://blog.jsinh.in/asp-net-5-configuration-microsoft-framework-configurationmodel/) 10 | * [Configuration Providers](http://bleedingnedge.azurewebsites.net/2015/10/15/configuration-providers/) 11 | 12 | -------------------------------------------------------------------------------- /src/Configuration/test/Config.FunctionalTests/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | XmlValue3 6 | XmlValue4 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Abstractions/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Abstractions/src/IServiceCollection.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection 7 | { 8 | /// 9 | /// Specifies the contract for a collection of service descriptors. 10 | /// 11 | public interface IServiceCollection : IList 12 | { 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Abstractions/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.DependencyInjection.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/AnotherClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class AnotherClass 7 | { 8 | public AnotherClass(IFakeService fakeService) 9 | { 10 | FakeService = fakeService; 11 | } 12 | 13 | public IFakeService FakeService { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/ClassWithInternalConstructor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection 5 | { 6 | public class ClassWithInternalConstructor 7 | { 8 | internal ClassWithInternalConstructor() 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/ClassWithMultipleMarkedCtors.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class ClassWithMultipleMarkedCtors 7 | { 8 | [ActivatorUtilitiesConstructor] 9 | public ClassWithMultipleMarkedCtors(string data) 10 | { 11 | } 12 | 13 | [ActivatorUtilitiesConstructor] 14 | public ClassWithMultipleMarkedCtors(IFakeService service, string data) 15 | { 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/ClassWithOptionalArgsCtor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification 5 | { 6 | public class ClassWithOptionalArgsCtor 7 | { 8 | public ClassWithOptionalArgsCtor(string whatever = "BLARGH") 9 | { 10 | Whatever = whatever; 11 | } 12 | 13 | public string Whatever { get; set; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/ClassWithPrivateCtor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class ClassWithPrivateCtor 7 | { 8 | private ClassWithPrivateCtor() 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/ClassWithProtectedConstructor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class ClassWithProtectedConstructor 7 | { 8 | internal ClassWithProtectedConstructor() 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/ClassWithStaticCtor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class ClassWithStaticCtor 7 | { 8 | static ClassWithStaticCtor() 9 | { 10 | 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/ClassWithThrowingCtor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 7 | { 8 | public class ClassWithThrowingCtor 9 | { 10 | public ClassWithThrowingCtor(IFakeService service) 11 | { 12 | throw new Exception(nameof(ClassWithThrowingCtor)); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/ClassWithThrowingEmptyCtor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 7 | { 8 | public class ClassWithThrowingEmptyCtor 9 | { 10 | public ClassWithThrowingEmptyCtor() 11 | { 12 | throw new Exception(nameof(ClassWithThrowingEmptyCtor)); 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/FakeDisposableCallbackInnerService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class FakeDisposableCallbackInnerService : FakeDisposableCallbackService, IFakeMultipleService 7 | { 8 | public FakeDisposableCallbackInnerService(FakeDisposeCallback callback) : base(callback) 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/FakeDisposeCallback.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 7 | { 8 | public class FakeDisposeCallback 9 | { 10 | public List Disposed { get; } = new List(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/FakeOneMultipleService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class FakeOneMultipleService : IFakeMultipleService 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/FakeOpenGenericService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class FakeOpenGenericService : IFakeOpenGenericService 7 | { 8 | public FakeOpenGenericService(TVal value) 9 | { 10 | Value = value; 11 | } 12 | 13 | public TVal Value { get; } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/FakeTwoMultipleService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class FakeTwoMultipleService : IFakeMultipleService 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/IFactoryService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public interface IFactoryService 7 | { 8 | IFakeService FakeService { get; } 9 | 10 | int Value { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/IFakeEveryService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public interface IFakeEveryService : 7 | IFakeService, 8 | IFakeMultipleService, 9 | IFakeScopedService, 10 | IFakeServiceInstance, 11 | IFakeSingletonService, 12 | IFakeOpenGenericService 13 | { 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/IFakeMultipleService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public interface IFakeMultipleService : IFakeService 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/IFakeOpenGenericService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public interface IFakeOpenGenericService 7 | { 8 | TValue Value { get; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/IFakeOuterService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 7 | { 8 | public interface IFakeOuterService 9 | { 10 | IFakeService SingleService { get; } 11 | 12 | IEnumerable MultipleServices { get; } 13 | } 14 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/IFakeScopedService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public interface IFakeScopedService : IFakeService 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/IFakeService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public interface IFakeService 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/IFakeServiceInstance.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public interface IFakeServiceInstance : IFakeService 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/IFakeSingletonService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public interface IFakeSingletonService : IFakeService 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/INonexistentService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public interface INonexistentService 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/PocoClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class PocoClass 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/ScopedFactoryService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class ScopedFactoryService 7 | { 8 | public IFakeService FakeService { get; set; } 9 | } 10 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/Fakes/TransientFactoryService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Specification.Fakes 5 | { 6 | public class TransientFactoryService : IFactoryService 7 | { 8 | public IFakeService FakeService { get; set; } 9 | 10 | public int Value { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI.Specification.Tests/src/ServiceCollection.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Specification 7 | { 8 | internal class TestServiceCollection : List, IServiceCollection 9 | { 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/perf/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | [assembly: BenchmarkDotNet.Attributes.AspNetCoreBenchmark] 2 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/perf/Microsoft.Extensions.DependencyInjection.Performance.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2 5 | Exe 6 | true 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Shared\%(FileName)%(Extension) 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/CallSiteExpressionBuilderContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Linq.Expressions; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 7 | { 8 | internal class CallSiteExpressionBuilderContext 9 | { 10 | public ParameterExpression ScopeParameter { get; set; } 11 | public bool RequiresResolvedServices { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/CallSiteKind.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 2 | { 3 | internal enum CallSiteKind 4 | { 5 | Factory, 6 | 7 | Constructor, 8 | 9 | Constant, 10 | 11 | IEnumerable, 12 | 13 | ServiceProvider, 14 | 15 | Scope, 16 | 17 | Transient, 18 | 19 | CreateInstance, 20 | 21 | ServiceScopeFactory, 22 | 23 | Singleton 24 | } 25 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/ILEmit/ILEmitResolverBuilderContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Reflection.Emit; 7 | 8 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 9 | { 10 | internal class ILEmitResolverBuilderContext 11 | { 12 | public ILGenerator Generator { get; set; } 13 | public List Constants { get; set; } 14 | public List> Factories { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/IServiceCallSite.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 7 | { 8 | /// 9 | /// Summary description for IServiceCallSite 10 | /// 11 | internal interface IServiceCallSite 12 | { 13 | Type ServiceType { get; } 14 | Type ImplementationType { get; } 15 | CallSiteKind Kind { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/IServiceProviderEngine.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 7 | { 8 | internal interface IServiceProviderEngine : IDisposable, IServiceProvider 9 | { 10 | IServiceScope RootScope { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/IServiceProviderEngineCallback.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 7 | { 8 | internal interface IServiceProviderEngineCallback 9 | { 10 | void OnCreate(IServiceCallSite callSite); 11 | void OnResolve(Type serviceType, IServiceScope scope); 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/ServiceProviderCallSite.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 7 | { 8 | internal class ServiceProviderCallSite : IServiceCallSite 9 | { 10 | public Type ServiceType { get; } = typeof(IServiceProvider); 11 | public Type ImplementationType { get; } = typeof(ServiceProvider); 12 | public CallSiteKind Kind { get; } = CallSiteKind.ServiceProvider; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/ServiceScopeFactoryCallSite.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 7 | { 8 | internal class ServiceScopeFactoryCallSite : IServiceCallSite 9 | { 10 | public Type ServiceType { get; } = typeof(IServiceScopeFactory); 11 | public Type ImplementationType { get; } = typeof(ServiceProviderEngine); 12 | public CallSiteKind Kind { get; } = CallSiteKind.ServiceScopeFactory; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/SingletonCallSite.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 5 | { 6 | internal class SingletonCallSite : ScopedCallSite 7 | { 8 | public SingletonCallSite(IServiceCallSite serviceCallSite, object cacheKey) : base(serviceCallSite, cacheKey) 9 | { 10 | } 11 | 12 | public override CallSiteKind Kind { get; } = CallSiteKind.Singleton; 13 | } 14 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceLookup/ThrowHelper.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Runtime.CompilerServices; 6 | 7 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 8 | { 9 | internal class ThrowHelper 10 | { 11 | [MethodImpl(MethodImplOptions.NoInlining)] 12 | internal static void ThrowObjectDisposedException() 13 | { 14 | throw new ObjectDisposedException(nameof(IServiceProvider)); 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/src/ServiceProviderMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection 5 | { 6 | internal enum ServiceProviderMode 7 | { 8 | Dynamic, 9 | Runtime, 10 | Expressions, 11 | ILEmit 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/AbstractClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public abstract class AbstractClass 7 | { 8 | public AbstractClass() 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/DependencyOnCircularDependency.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class DependencyOnCircularDependency 7 | { 8 | public DependencyOnCircularDependency(DirectCircularDependencyA a) 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/DirectCircularDependencyA.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class DirectCircularDependencyA 7 | { 8 | public DirectCircularDependencyA(DirectCircularDependencyB b) 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/DirectCircularDependencyB.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class DirectCircularDependencyB 7 | { 8 | public DirectCircularDependencyB(DirectCircularDependencyA a) 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/ISelfCircularDependencyWithInterface.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public interface ISelfCircularDependencyWithInterface 7 | { 8 | } 9 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/IndirectCircularDependencyA.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class IndirectCircularDependencyA 7 | { 8 | public IndirectCircularDependencyA(IndirectCircularDependencyB b) 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/IndirectCircularDependencyB.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class IndirectCircularDependencyB 7 | { 8 | public IndirectCircularDependencyB(IndirectCircularDependencyC c) 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/IndirectCircularDependencyC.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class IndirectCircularDependencyC 7 | { 8 | public IndirectCircularDependencyC(IndirectCircularDependencyA a) 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/NoCircularDependencySameTypeMultipleTimesB.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class NoCircularDependencySameTypeMultipleTimesB 7 | { 8 | public NoCircularDependencySameTypeMultipleTimesB(NoCircularDependencySameTypeMultipleTimesC c) 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/NoCircularDependencySameTypeMultipleTimesC.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class NoCircularDependencySameTypeMultipleTimesC 7 | { 8 | public NoCircularDependencySameTypeMultipleTimesC() 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/SelfCircularDependency.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class SelfCircularDependency 7 | { 8 | public SelfCircularDependency(SelfCircularDependency self) 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/SelfCircularDependencyGeneric.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class SelfCircularDependencyGeneric 7 | { 8 | public SelfCircularDependencyGeneric(SelfCircularDependencyGeneric dependency) 9 | { 10 | 11 | } 12 | 13 | public SelfCircularDependencyGeneric() 14 | { 15 | 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/CircularReferences/SelfCircularDependencyWithInterface.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 5 | { 6 | public class SelfCircularDependencyWithInterface : ISelfCircularDependencyWithInterface 7 | { 8 | public SelfCircularDependencyWithInterface(ISelfCircularDependencyWithInterface self) 9 | { 10 | 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/ClassDependsOnPrivateConstructorClass.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.DependencyInjection.Specification.Fakes; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Tests.Fakes 7 | { 8 | public class ClassDependsOnPrivateConstructorClass 9 | { 10 | public ClassDependsOnPrivateConstructorClass(ClassWithPrivateCtor value) 11 | { 12 | 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/DependOnNonexistentService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.DependencyInjection.Specification.Fakes; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Tests 7 | { 8 | public class DependOnNonexistentService 9 | { 10 | public DependOnNonexistentService(IFakeService nonExistentService) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/StructFakeMultipleService.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.DependencyInjection.Specification.Fakes; 2 | 3 | namespace Microsoft.Extensions.DependencyInjection.Fakes 4 | { 5 | public struct StructFakeMultipleService : IFakeMultipleService 6 | { 7 | public StructFakeMultipleService(IFakeService service, StructService direct) 8 | { 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/StructFakeService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Extensions.DependencyInjection.Specification.Fakes; 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.Fakes 5 | { 6 | public struct StructFakeService : IFakeService 7 | { 8 | public StructFakeService(IServiceProvider serviceProvider) 9 | { 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Fakes/StructService.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.Extensions.DependencyInjection.Fakes 2 | { 3 | public struct StructService 4 | { 5 | public StructService(IServiceScopeFactory scopeFactory) 6 | { 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/Microsoft.Extensions.DependencyInjection.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | Microsoft.Extensions.DependencyInjection 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/ServiceLookup/Types/TypeWithMultipleParameterizedConstructors.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.DependencyInjection.Specification.Fakes; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 7 | { 8 | public class TypeWithMultipleParameterizedConstructors 9 | { 10 | public TypeWithMultipleParameterizedConstructors(IFactoryService factoryService) 11 | { 12 | } 13 | 14 | public TypeWithMultipleParameterizedConstructors(IFakeService fakeService) 15 | { 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/ServiceLookup/Types/TypeWithNoConstructors.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 5 | { 6 | public class TypeWithNoConstructors 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/ServiceLookup/Types/TypeWithNoPublicConstructors.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 5 | { 6 | public class TypeWithNoPublicConstructors 7 | { 8 | private TypeWithNoPublicConstructors() 9 | { 10 | } 11 | 12 | protected TypeWithNoPublicConstructors(string name) 13 | { 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/ServiceLookup/Types/TypeWithParameterizedConstructor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.DependencyInjection.Specification.Fakes; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 7 | { 8 | public class TypeWithParameterizedConstructor 9 | { 10 | public TypeWithParameterizedConstructor(IFakeService fakeService) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/ServiceLookup/Types/TypeWithParameterlessConstructor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 5 | { 6 | public class TypeWithParameterlessConstructor 7 | { 8 | public TypeWithParameterlessConstructor() 9 | { 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/ServiceLookup/Types/TypeWithParameterlessPublicConstructor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.DependencyInjection.ServiceLookup 5 | { 6 | public class TypeWithParameterlessPublicConstructor 7 | { 8 | public TypeWithParameterlessPublicConstructor() 9 | : this("some name") 10 | { 11 | } 12 | 13 | protected TypeWithParameterlessPublicConstructor(string name) 14 | { 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/ServiceProviderDynamicContainerTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Tests 7 | { 8 | public class ServiceProviderDynamicContainerTests : ServiceProviderContainerTests 9 | { 10 | protected override IServiceProvider CreateServiceProvider(IServiceCollection collection) => 11 | collection.BuildServiceProvider(); 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/ServiceProviderExpressionsContainerTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Tests 7 | { 8 | public class ServiceProviderExpressionsContainerTests : ServiceProviderContainerTests 9 | { 10 | protected override IServiceProvider CreateServiceProvider(IServiceCollection collection) => 11 | collection.BuildServiceProvider(new ServiceProviderOptions { Mode = ServiceProviderMode.Expressions }); 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/ServiceProviderILEmitContainerTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection.Tests 7 | { 8 | public class ServiceProviderILEmitContainerTests : ServiceProviderContainerTests 9 | { 10 | protected override IServiceProvider CreateServiceProvider(IServiceCollection collection) => 11 | collection.BuildServiceProvider(new ServiceProviderOptions() { Mode = ServiceProviderMode.ILEmit}); 12 | } 13 | } -------------------------------------------------------------------------------- /src/DependencyInjection/DI/test/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "methodDisplay": "method", 3 | "appDomain": "denied" 4 | } 5 | -------------------------------------------------------------------------------- /src/DiagnosticAdapter/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/DiagnosticAdapter/README.md: -------------------------------------------------------------------------------- 1 | DiagnosticAdapter 2 | ================= 3 | 4 | Notice 5 | ------- 6 | 7 | The infrastructure for publishing notifications has moved to the .NET Framework. See the new [`DiagnosticSource`](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSource.cs) and [`DiagnosticListener`](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticListener.cs) APIs in the `System.Diagnostics.DiagnosticSource` package. The infrastructure provided here is for subscribing to events using runtime-generated proxies. 8 | -------------------------------------------------------------------------------- /src/DiagnosticAdapter/src/DiagnosticNameAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DiagnosticAdapter 7 | { 8 | public class DiagnosticNameAttribute : Attribute 9 | { 10 | public DiagnosticNameAttribute(string name) 11 | { 12 | Name = name; 13 | } 14 | 15 | public string Name { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/DiagnosticAdapter/src/IDiagnosticSourceMethodAdapter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Reflection; 6 | 7 | namespace Microsoft.Extensions.DiagnosticAdapter 8 | { 9 | public interface IDiagnosticSourceMethodAdapter 10 | { 11 | Func Adapt(MethodInfo method, Type inputType); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/DiagnosticAdapter/src/Internal/InvalidProxyOperationException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DiagnosticAdapter.Internal 7 | { 8 | public class InvalidProxyOperationException : InvalidOperationException 9 | { 10 | public InvalidProxyOperationException(string message) : base(message) 11 | { 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/DiagnosticAdapter/src/Internal/ProxyTypeCache.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Concurrent; 6 | 7 | namespace Microsoft.Extensions.DiagnosticAdapter.Internal 8 | { 9 | public class ProxyTypeCache : ConcurrentDictionary, ProxyTypeCacheResult> 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/DiagnosticAdapter/test/Microsoft.Extensions.DiagnosticAdapter.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/FileProviders/Abstractions/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/FileProviders/Abstractions/src/IDirectoryContents.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Extensions.FileProviders 7 | { 8 | /// 9 | /// Represents a directory's content in the file provider. 10 | /// 11 | public interface IDirectoryContents : IEnumerable 12 | { 13 | /// 14 | /// True if a directory was located at the given path. 15 | /// 16 | bool Exists { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/FileProviders/Composite/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/FileProviders/Composite/src/Microsoft.Extensions.FileProviders.Composite.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Microsoft.Extensions.FileProviders 5 | Composite file and directory providers for Microsoft.Extensions.FileProviders. 6 | netstandard2.0 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/FileProviders/Composite/test/Microsoft.Extensions.FileProviders.Composite.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Microsoft.Extensions.FileProviders.Composite 5 | netcoreapp2.2;net461 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/FileProviders/Composite/test/MockDisposable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.FileProviders.Composite 7 | { 8 | public class MockDisposable : IDisposable 9 | { 10 | public bool Disposed { get; set; } 11 | 12 | public void Dispose() 13 | { 14 | Disposed = true; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/FileProviders/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | files;filesystem 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/FileProviders/Embedded/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/FileProviders/Embedded/src/Manifest/ManifestRootDirectory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.FileProviders.Embedded.Manifest 5 | { 6 | internal class ManifestRootDirectory : ManifestDirectory 7 | { 8 | public ManifestRootDirectory(ManifestEntry[] children) 9 | : base(name: null, children: children) 10 | { 11 | SetParent(ManifestSinkDirectory.Instance); 12 | } 13 | 14 | public override ManifestDirectory ToRootDirectory() => this; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/FileProviders/Embedded/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 |  2 | using System.Runtime.CompilerServices; 3 | 4 | [assembly: InternalsVisibleTo("Microsoft.Extensions.FileProviders.Embedded.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -------------------------------------------------------------------------------- /src/FileProviders/Embedded/src/buildMultiTargeting/Microsoft.Extensions.FileProviders.Embedded.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/FileProviders/Embedded/src/buildMultiTargeting/Microsoft.Extensions.FileProviders.Embedded.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /src/FileProviders/Embedded/test/File.txt: -------------------------------------------------------------------------------- 1 | Hello -------------------------------------------------------------------------------- /src/FileProviders/Embedded/test/Microsoft.Extensions.FileProviders.Embedded.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/FileProviders/Embedded/test/Resources/File.txt: -------------------------------------------------------------------------------- 1 | Resources-Hello -------------------------------------------------------------------------------- /src/FileProviders/Embedded/test/Resources/ResourcesInSubdirectory/File3.txt: -------------------------------------------------------------------------------- 1 | Hello3 2 | -------------------------------------------------------------------------------- /src/FileProviders/Embedded/test/sub/File2.txt: -------------------------------------------------------------------------------- 1 | Hello2 2 | -------------------------------------------------------------------------------- /src/FileProviders/Embedded/test/sub/dir/File3.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/uhaciogullari/HttpClientFactoryLite/93509804c898e33c0d2e680dfad41d03203e8dca/src/FileProviders/Embedded/test/sub/dir/File3.txt -------------------------------------------------------------------------------- /src/FileProviders/Manifest.MSBuildTask/test/SetExtensions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.FileProviders.Embedded.Manifest.Task.Internal; 5 | 6 | namespace Microsoft.Extensions.FileProviders.Embedded.Manifest.Task 7 | { 8 | internal static class SetExtensions 9 | { 10 | public static Entry AddRange(this Entry source, params Entry[] elements) 11 | { 12 | foreach (var element in elements) 13 | { 14 | source.Children.Add(element); 15 | } 16 | 17 | return source; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/FileProviders/Physical/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/FileProviders/Physical/src/IPollingChangeToken.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Threading; 5 | using Microsoft.Extensions.Primitives; 6 | 7 | namespace Microsoft.Extensions.FileProviders 8 | { 9 | internal interface IPollingChangeToken : IChangeToken 10 | { 11 | CancellationTokenSource CancellationTokenSource { get; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/FileProviders/Physical/src/Internal/Clock.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.FileProviders.Physical 7 | { 8 | internal class Clock : IClock 9 | { 10 | public static readonly Clock Instance = new Clock(); 11 | 12 | private Clock() 13 | { 14 | } 15 | 16 | public DateTime UtcNow => DateTime.UtcNow; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/FileProviders/Physical/src/Internal/IClock.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.FileProviders.Physical 7 | { 8 | internal interface IClock 9 | { 10 | DateTime UtcNow { get; } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/FileProviders/Physical/test/Microsoft.Extensions.FileProviders.Physical.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Microsoft.Extensions.FileProviders.Physical 5 | netcoreapp2.2;net461 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/FileProviders/Physical/test/TestClock.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.FileProviders.Physical.Internal 7 | { 8 | public class TestClock : IClock 9 | { 10 | public DateTime UtcNow { get; private set; } = DateTime.UtcNow; 11 | 12 | public void Increment() 13 | { 14 | UtcNow = UtcNow.Add(PhysicalFilesWatcher.DefaultPollingInterval); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/FileProviders/README.md: -------------------------------------------------------------------------------- 1 | FileSystem 2 | ========== 3 | 4 | File system abstractions. Contains file system abstractions and file system globbing. 5 | 6 | In addition, there are some community FileProvider implementations that you may find useful: 7 | 8 | | Project | Description | Latest Stable NuGet | 9 | | :-----------: | :----- | :----- | 10 | | [Dazinator.AspNet.Extensions.FileProviders](https://github.com/dazinator/Dazinator.AspNet.Extensions.FileProviders) | Provides an InMemoryFileProvider and a RequestPathFileProvider, open to additional contributions. | [![NuGet](https://img.shields.io/nuget/v/Dazinator.AspNet.Extensions.FileProviders.svg)](https://www.nuget.org/packages/Dazinator.AspNet.Extensions.FileProviders/) | 11 | -------------------------------------------------------------------------------- /src/FileSystemGlobbing/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Abstractions/FileInfoBase.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.FileSystemGlobbing.Abstractions 5 | { 6 | /// 7 | /// Represents a file 8 | /// 9 | public abstract class FileInfoBase : FileSystemInfoBase 10 | { 11 | } 12 | } -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Internal/ILinearPattern.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Extensions.FileSystemGlobbing.Internal 7 | { 8 | public interface ILinearPattern : IPattern 9 | { 10 | IList Segments { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Internal/IPathSegment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.FileSystemGlobbing.Internal 5 | { 6 | public interface IPathSegment 7 | { 8 | bool CanProduceStem { get; } 9 | 10 | bool Match(string value); 11 | } 12 | } -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Internal/IPattern.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.FileSystemGlobbing.Internal 5 | { 6 | public interface IPattern 7 | { 8 | IPatternContext CreatePatternContextForInclude(); 9 | 10 | IPatternContext CreatePatternContextForExclude(); 11 | } 12 | } -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Internal/IPatternContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.Extensions.FileSystemGlobbing.Abstractions; 6 | 7 | namespace Microsoft.Extensions.FileSystemGlobbing.Internal 8 | { 9 | public interface IPatternContext 10 | { 11 | void Declare(Action onDeclare); 12 | 13 | bool Test(DirectoryInfoBase directory); 14 | 15 | PatternTestResult Test(FileInfoBase file); 16 | 17 | void PushDirectory(DirectoryInfoBase directory); 18 | 19 | void PopDirectory(); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Internal/IRaggedPattern.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | 6 | namespace Microsoft.Extensions.FileSystemGlobbing.Internal 7 | { 8 | public interface IRaggedPattern : IPattern 9 | { 10 | IList Segments { get; } 11 | 12 | IList StartsWith { get; } 13 | 14 | IList> Contains { get; } 15 | 16 | IList EndsWith { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Internal/PathSegments/CurrentPathSegment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.FileSystemGlobbing.Internal.PathSegments 7 | { 8 | public class CurrentPathSegment : IPathSegment 9 | { 10 | public bool CanProduceStem { get { return false; } } 11 | 12 | public bool Match(string value) 13 | { 14 | return false; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Internal/PathSegments/ParentPathSegment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.FileSystemGlobbing.Internal.PathSegments 7 | { 8 | public class ParentPathSegment : IPathSegment 9 | { 10 | private static readonly string LiteralParent = ".."; 11 | 12 | public bool CanProduceStem { get { return false; } } 13 | 14 | public bool Match(string value) 15 | { 16 | return string.Equals(LiteralParent, value, StringComparison.Ordinal); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Internal/PathSegments/RecursiveWildcardSegment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.FileSystemGlobbing.Internal.PathSegments 7 | { 8 | public class RecursiveWildcardSegment : IPathSegment 9 | { 10 | public bool CanProduceStem { get { return true; } } 11 | 12 | public bool Match(string value) 13 | { 14 | return false; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/FileSystemGlobbing/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.FileSystemGlobbing.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/FileSystemGlobbing/test/Microsoft.Extensions.FileSystemGlobbing.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Microsoft.Extensions.FileSystemGlobbing 5 | netcoreapp2.2;net461 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/FileSystemGlobbing/test/PatternSegments/RecursiveWildcardSegmentTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.FileSystemGlobbing.Internal.PathSegments; 5 | using Xunit; 6 | 7 | namespace Microsoft.Extensions.FileSystemGlobbing.Tests.PatternSegments 8 | { 9 | public class RecursiveWildcardSegmentTests 10 | { 11 | [Fact] 12 | public void Match() 13 | { 14 | var pathSegment = new RecursiveWildcardSegment(); 15 | Assert.False(pathSegment.Match("Anything")); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/FileSystemGlobbing/test/TestUtility/MockRecursivePathSegment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.Extensions.FileSystemGlobbing.Internal; 6 | 7 | namespace Microsoft.Extensions.FileSystemGlobbing.Tests.PatternContexts 8 | { 9 | internal class MockRecursivePathSegment : IPathSegment 10 | { 11 | public bool CanProduceStem { get { return false; } } 12 | 13 | public bool Match(string value) 14 | { 15 | return false; 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/HealthChecks/Abstractions/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/HealthChecks/Abstractions/src/HealthCheckContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Diagnostics.HealthChecks 5 | { 6 | public sealed class HealthCheckContext 7 | { 8 | /// 9 | /// Gets or sets the of the currently executing . 10 | /// 11 | public HealthCheckRegistration Registration { get; set; } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/HealthChecks/Abstractions/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Abstractions for defining health checks in .NET applications 5 | 6 | Commonly Used Types 7 | Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck 8 | 9 | Microsoft.Extensions.Diagnostics.HealthChecks 10 | netstandard2.0 11 | $(NoWarn);CS1591 12 | true 13 | diagnostics;healthchecks 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/HealthChecks/Abstractions/src/baseline.netcore.json: -------------------------------------------------------------------------------- 1 | { 2 | "AssemblyIdentity": "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", 3 | "Types": [ 4 | ] 5 | } -------------------------------------------------------------------------------- /src/HealthChecks/HealthChecks/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/HealthChecks/HealthChecks/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Diagnostics.HealthChecks.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -------------------------------------------------------------------------------- /src/HealthChecks/HealthChecks/src/baseline.netcore.json: -------------------------------------------------------------------------------- 1 | { 2 | "AssemblyIdentity": "Microsoft.Extensions.Diagnostics.HealthChecks, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", 3 | "Types": [ 4 | ] 5 | } -------------------------------------------------------------------------------- /src/HealthChecks/HealthChecks/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | netcoreapp2.2;net461 7 | Microsoft.Extensions.Diagnostics.HealthChecks 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Hosting/Abstractions/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Hosting/Abstractions/src/EnvironmentName.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Hosting 5 | { 6 | /// 7 | /// Commonly used environment names. 8 | /// 9 | public static class EnvironmentName 10 | { 11 | public static readonly string Development = "Development"; 12 | public static readonly string Staging = "Staging"; 13 | public static readonly string Production = "Production"; 14 | } 15 | } -------------------------------------------------------------------------------- /src/Hosting/Hosting/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Hosting/Hosting/src/ConsoleLifetimeOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Hosting 5 | { 6 | public class ConsoleLifetimeOptions 7 | { 8 | /// 9 | /// Indicates if host lifetime status messages should be supressed such as on startup. 10 | /// The default is false. 11 | /// 12 | public bool SuppressStatusMessages { get; set; } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Hosting/Hosting/src/HostOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Hosting 7 | { 8 | /// 9 | /// Options for 10 | /// 11 | public class HostOptions 12 | { 13 | /// 14 | /// The default timeout for . 15 | /// 16 | public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromSeconds(5); 17 | } 18 | } -------------------------------------------------------------------------------- /src/Hosting/Hosting/src/Internal/HostingEnvironment.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.FileProviders; 5 | 6 | namespace Microsoft.Extensions.Hosting.Internal 7 | { 8 | public class HostingEnvironment : IHostingEnvironment 9 | { 10 | public string EnvironmentName { get; set; } 11 | 12 | public string ApplicationName { get; set; } 13 | 14 | public string ContentRootPath { get; set; } 15 | 16 | public IFileProvider ContentRootFileProvider { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Hosting/Hosting/src/Internal/IConfigureContainerAdapter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Hosting.Internal 5 | { 6 | internal interface IConfigureContainerAdapter 7 | { 8 | void ConfigureContainer(HostBuilderContext hostContext, object containerBuilder); 9 | } 10 | } -------------------------------------------------------------------------------- /src/Hosting/Hosting/src/Internal/IServiceFactoryAdapter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Microsoft.Extensions.DependencyInjection; 6 | 7 | namespace Microsoft.Extensions.Hosting.Internal 8 | { 9 | internal interface IServiceFactoryAdapter 10 | { 11 | object CreateBuilder(IServiceCollection services); 12 | 13 | IServiceProvider CreateServiceProvider(object containerBuilder); 14 | } 15 | } -------------------------------------------------------------------------------- /src/Hosting/Hosting/test/Fakes/FakeOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Hosting.Fakes 5 | { 6 | public class FakeOptions 7 | { 8 | public bool Configured { get; set; } 9 | public string Environment { get; set; } 10 | public string Message { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Hosting/Hosting/test/Fakes/FakeService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Hosting.Fakes 7 | { 8 | public class FakeService : IFakeEveryService, IDisposable 9 | { 10 | public bool Disposed { get; private set; } 11 | 12 | public void Dispose() 13 | { 14 | Disposed = true; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Hosting/Hosting/test/Fakes/IFakeEveryService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Hosting.Fakes 5 | { 6 | interface IFakeEveryService : 7 | IFakeScopedService, 8 | IFakeServiceInstance, 9 | IFakeSingletonService 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Hosting/Hosting/test/Fakes/IFakeScopedService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Hosting.Fakes 5 | { 6 | public interface IFakeScopedService : IFakeService 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Hosting/Hosting/test/Fakes/IFakeService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Hosting.Fakes 5 | { 6 | public interface IFakeService { } 7 | } -------------------------------------------------------------------------------- /src/Hosting/Hosting/test/Fakes/IFakeServiceInstance.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Hosting.Fakes 5 | { 6 | interface IFakeServiceInstance : IFakeService 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Hosting/Hosting/test/Fakes/IFakeSingletonService.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Hosting.Fakes 5 | { 6 | interface IFakeSingletonService : IFakeService 7 | { 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/Hosting/Hosting/test/Microsoft.Extensions.Hosting.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /src/Hosting/Hosting/test/testroot/readme.txt: -------------------------------------------------------------------------------- 1 | This file exists to preserve the parent directory in the GIT repo. Git does not preserve empty directories. -------------------------------------------------------------------------------- /src/Hosting/samples/GenericHostSample/MyContainer.cs: -------------------------------------------------------------------------------- 1 | namespace GenericHostSample 2 | { 3 | internal class MyContainer 4 | { 5 | } 6 | } -------------------------------------------------------------------------------- /src/Hosting/samples/GenericHostSample/MyContainerFactory.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Extensions.DependencyInjection; 3 | 4 | namespace GenericHostSample 5 | { 6 | internal class MyContainerFactory : IServiceProviderFactory 7 | { 8 | public MyContainer CreateBuilder(IServiceCollection services) 9 | { 10 | return new MyContainer(); 11 | } 12 | 13 | public IServiceProvider CreateServiceProvider(MyContainer containerBuilder) 14 | { 15 | throw new NotImplementedException(); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Hosting/samples/GenericHostSample/ProgramHelloWorld.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Microsoft.Extensions.Hosting; 4 | 5 | namespace GenericHostSample 6 | { 7 | public class ProgramHelloWorld 8 | { 9 | public static async Task Main(string[] args) 10 | { 11 | var builder = new HostBuilder() 12 | .ConfigureServices((hostContext, services) => 13 | { 14 | services.AddHostedService(); 15 | services.AddHostedService(); 16 | }); 17 | 18 | await builder.RunConsoleAsync(); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/Hosting/samples/SampleMsmqHost/MsmqOptions.cs: -------------------------------------------------------------------------------- 1 | using System.Messaging; 2 | 3 | namespace SampleMsmqHost 4 | { 5 | public class MsmqOptions 6 | { 7 | public string Path { get; set; } 8 | 9 | public bool SharedModeDenyReceive { get; set; } = false; 10 | 11 | public bool EnableCache { get; set; } = false; 12 | 13 | public QueueAccessMode AccessMode { get; set; } = QueueAccessMode.SendAndReceive; 14 | } 15 | } -------------------------------------------------------------------------------- /src/HttpClientFactory/Http/test/DependencyInjection/OtherTestOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.DependencyInjection 7 | { 8 | public class OtherTestOptions 9 | { 10 | public string BaseAddress { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/HttpClientFactory/Http/test/ITestTypedClient.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Net.Http; 5 | 6 | namespace Microsoft.Extensions.Http 7 | { 8 | // Simple typed client for use in tests 9 | public interface ITestTypedClient 10 | { 11 | HttpClient HttpClient { get; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/HttpClientFactory/Http/test/Microsoft.Extensions.Http.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/HttpClientFactory/Http/test/TestTypedClient.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Net.Http; 5 | 6 | namespace Microsoft.Extensions.Http 7 | { 8 | // Simple typed client for use in tests 9 | public class TestTypedClient : ITestTypedClient 10 | { 11 | public TestTypedClient(HttpClient httpClient) 12 | { 13 | HttpClient = httpClient; 14 | } 15 | 16 | public HttpClient HttpClient { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/HttpClientFactory/Polly/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/HttpClientFactory/Polly/test/Microsoft.Extensions.Http.Polly.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/HttpClientFactory/README.md: -------------------------------------------------------------------------------- 1 | HttpClient Factory 2 | ================== 3 | 4 | Contains an opinionated factory for creating HttpClient instances. 5 | -------------------------------------------------------------------------------- /src/HttpClientFactory/samples/HttpClientFactorySample/HttpClientFactorySample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | portable 6 | Exe 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Localization/Abstractions/src/IStringLocalizerOfT.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Localization 5 | { 6 | /// 7 | /// Represents an that provides strings for . 8 | /// 9 | /// The to provide strings for. 10 | public interface IStringLocalizer : IStringLocalizer 11 | { 12 | 13 | } 14 | } -------------------------------------------------------------------------------- /src/Localization/Abstractions/src/Microsoft.Extensions.Localization.Abstractions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Microsoft .NET Extensions 5 | Abstractions of application localization services. 6 | Commonly used types: 7 | Microsoft.Extensions.Localization.IStringLocalizer 8 | Microsoft.Extensions.Localization.IStringLocalizer<T> 9 | netstandard2.0 10 | $(NoWarn);CS1591 11 | true 12 | localization 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Localization/Localization/src/Internal/IResourceStringProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | using System.Globalization; 6 | 7 | namespace Microsoft.Extensions.Localization.Internal 8 | { 9 | public interface IResourceStringProvider 10 | { 11 | IList GetAllResourceStrings(CultureInfo culture, bool throwOnMissing); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Localization/Localization/src/LocalizationOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Localization 5 | { 6 | /// 7 | /// Provides programmatic configuration for localization. 8 | /// 9 | public class LocalizationOptions 10 | { 11 | /// 12 | /// The relative path under application root where resource files are located. 13 | /// 14 | public string ResourcesPath { get; set; } = string.Empty; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Localization/Localization/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Localization.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/Localization/Localization/test/Microsoft.Extensions.Localization.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Logging/Directory.Build.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | true 6 | logging 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Logging/Logging.Abstractions/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.Abstractions/src/Internal/NullScope.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging.Abstractions.Internal 7 | { 8 | /// 9 | /// An empty scope without any logic 10 | /// 11 | public class NullScope : IDisposable 12 | { 13 | public static NullScope Instance { get; } = new NullScope(); 14 | 15 | private NullScope() 16 | { 17 | } 18 | 19 | /// 20 | public void Dispose() 21 | { 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Logging/Logging.Abstractions/src/Microsoft.Extensions.Logging.Abstractions.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Logging abstractions for Microsoft.Extensions.Logging. 5 | Commonly used types: 6 | Microsoft.Extensions.Logging.ILogger 7 | Microsoft.Extensions.Logging.ILoggerFactory 8 | Microsoft.Extensions.Logging.ILogger<TCategoryName> 9 | Microsoft.Extensions.Logging.LogLevel 10 | Microsoft.Extensions.Logging.Logger<T> 11 | Microsoft.Extensions.Logging.LoggerMessage 12 | Microsoft.Extensions.Logging.Abstractions.NullLogger 13 | netstandard2.0 14 | $(NoWarn);CS1591 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/Logging/Logging.Abstractions/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/Logging/Logging.Analyzers/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | false 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Logging/Logging.Analyzers/test/xunit.runner.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/xunit.runner.schema", 3 | "appDomain": "denied", 4 | "methodDisplay": "method", 5 | "longRunningTestSeconds": 60 6 | } 7 | -------------------------------------------------------------------------------- /src/Logging/Logging.AzureAppServices/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.AzureAppServices/src/Internal/LogMessage.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging.AzureAppServices.Internal 7 | { 8 | public struct LogMessage 9 | { 10 | public DateTimeOffset Timestamp { get; set; } 11 | public string Message { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Logging/Logging.AzureAppServices/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | 7 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.AzureAppServices.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.AzureAppServices/test/Microsoft.Extensions.Logging.AzureAppServices.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/Logging/Logging.Configuration/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.Configuration/src/LoggingConfiguration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.Configuration; 5 | 6 | namespace Microsoft.Extensions.Logging.Configuration 7 | { 8 | internal class LoggingConfiguration 9 | { 10 | public IConfiguration Configuration { get; } 11 | 12 | public LoggingConfiguration(IConfiguration configuration) 13 | { 14 | Configuration = configuration; 15 | } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Logging/Logging.Configuration/src/Microsoft.Extensions.Logging.Configuration.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Configuration support for Microsoft.Extensions.Logging. 5 | netstandard2.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Logging/Logging.Console/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.Console/src/ConsoleLoggerOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging.Console 7 | { 8 | public class ConsoleLoggerOptions 9 | { 10 | public bool IncludeScopes { get; set; } 11 | public bool DisableColors { get; set; } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Logging/Logging.Console/src/ConsoleLoggerOptionsSetup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.Logging.Configuration; 3 | using Microsoft.Extensions.Options; 4 | 5 | namespace Microsoft.Extensions.Logging.Console 6 | { 7 | internal class ConsoleLoggerOptionsSetup : ConfigureFromConfigurationOptions 8 | { 9 | public ConsoleLoggerOptionsSetup(ILoggerProviderConfiguration providerConfiguration) 10 | : base(providerConfiguration.Configuration) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Logging/Logging.Console/src/IConsoleLoggerSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Microsoft.Extensions.Primitives; 3 | 4 | namespace Microsoft.Extensions.Logging.Console 5 | { 6 | [Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is ConsoleLoggerOptions.")] 7 | public interface IConsoleLoggerSettings 8 | { 9 | bool IncludeScopes { get; } 10 | 11 | IChangeToken ChangeToken { get; } 12 | 13 | bool TryGetSwitch(string name, out LogLevel level); 14 | 15 | IConsoleLoggerSettings Reload(); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Logging/Logging.Console/src/Internal/IAnsiSystemConsole.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Logging.Console.Internal 5 | { 6 | public interface IAnsiSystemConsole 7 | { 8 | void Write(string message); 9 | 10 | void WriteLine(string message); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Logging/Logging.Console/src/Internal/IConsole.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging.Console.Internal 7 | { 8 | public interface IConsole 9 | { 10 | void Write(string message, ConsoleColor? background, ConsoleColor? foreground); 11 | void WriteLine(string message, ConsoleColor? background, ConsoleColor? foreground); 12 | void Flush(); 13 | } 14 | } -------------------------------------------------------------------------------- /src/Logging/Logging.Console/src/Internal/LogMessageEntry.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging.Console.Internal 7 | { 8 | public struct LogMessageEntry 9 | { 10 | public string LevelString; 11 | public ConsoleColor? LevelBackground; 12 | public ConsoleColor? LevelForeground; 13 | public ConsoleColor? MessageColor; 14 | public string Message; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/Logging/Logging.Console/src/Microsoft.Extensions.Logging.Console.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Console logger provider implementation for Microsoft.Extensions.Logging. 5 | netstandard2.0 6 | $(NoWarn);CS1591 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Logging/Logging.Console/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | 7 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.Debug/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.Debug/src/Microsoft.Extensions.Logging.Debug.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug output logger provider implementation for Microsoft.Extensions.Logging. This logger logs messages to a debugger monitor by writing messages with System.Diagnostics.Debug.WriteLine(). 5 | netstandard2.0 6 | $(NoWarn);CS1591 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Logging/Logging.EventLog/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.EventLog/src/Internal/IEventLog.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Diagnostics; 5 | 6 | namespace Microsoft.Extensions.Logging.EventLog.Internal 7 | { 8 | public interface IEventLog 9 | { 10 | int MaxMessageSize { get; } 11 | 12 | void WriteEntry(string message, EventLogEntryType type, int eventID, short category); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/Logging/Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Windows Event Log logger provider implementation for Microsoft.Extensions.Logging. 5 | netstandard2.0;net461 6 | $(NoWarn);CS1591 7 | $(PackageTags);eventlog;windowseventlog 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Logging/Logging.EventSource/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.EventSource/src/Microsoft.Extensions.Logging.EventSource.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | EventSource/EventListener logger provider implementation for Microsoft.Extensions.Logging. 5 | netstandard2.0 6 | $(PackageTags);EventSource;ETW 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Logging/Logging.EventSource/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.EventSource.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/Logging/Logging.EventSource/test/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Xunit; 5 | 6 | // There can only be one EventSource per AppDomain, and when an event is raised through that EventSource, 7 | // all existing listeners that enabled that EventSource will receive the event. 8 | // This makes running EventSourceLogger tests in parallel difficult. We mark this assembly 9 | // with CollectionBehavior.CollectionPerAssembly to ensure that all tests in this assembly are executed serially. 10 | [assembly: CollectionBehavior(CollectionBehavior.CollectionPerAssembly)] -------------------------------------------------------------------------------- /src/Logging/Logging.EventSource/test/Microsoft.Extensions.Logging.EventSource.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Logging/Logging.Testing/src/BeginScopeContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Logging.Testing 5 | { 6 | public class BeginScopeContext 7 | { 8 | public object Scope { get; set; } 9 | 10 | public string LoggerName { get; set; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/Logging/Logging.Testing/src/ITestSink.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Concurrent; 3 | 4 | namespace Microsoft.Extensions.Logging.Testing 5 | { 6 | public interface ITestSink 7 | { 8 | Func WriteEnabled { get; set; } 9 | 10 | Func BeginEnabled { get; set; } 11 | 12 | IProducerConsumerCollection Scopes { get; set; } 13 | 14 | IProducerConsumerCollection Writes { get; set; } 15 | 16 | void Write(WriteContext context); 17 | 18 | void Begin(BeginScopeContext context); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/Logging/Logging.Testing/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Testing.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/Logging/Logging.Testing/src/RetryContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging.Testing 7 | { 8 | public class RetryContext 9 | { 10 | internal int Limit { get; set; } 11 | 12 | internal object TestClassInstance { get; set; } 13 | 14 | internal string Reason { get; set; } 15 | 16 | internal int CurrentIteration { get; set; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Logging/Logging.Testing/src/ShortClassNameAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright(c) .NET Foundation.All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging.Testing 7 | { 8 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly, AllowMultiple = false)] 9 | public class ShortClassNameAttribute : Attribute 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Logging/Logging.Testing/src/Xunit/LogLevelAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging.Testing 7 | { 8 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] 9 | public class LogLevelAttribute : Attribute 10 | { 11 | public LogLevelAttribute(LogLevel logLevel) 12 | { 13 | LogLevel = logLevel; 14 | } 15 | 16 | public LogLevel LogLevel { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Logging/Logging.Testing/test/Microsoft.Extensions.Logging.Testing.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | netcoreapp2.2;net461 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/Logging/Logging.TraceSource/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Logging/Logging.TraceSource/src/Microsoft.Extensions.Logging.TraceSource.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | TraceSource logger provider implementation for Microsoft.Extensions.Logging. This logger logs messages to a trace listener by writing messages with System.Diagnostics.TraceSource.TraceEvent(). 5 | netstandard2.0 6 | $(NoWarn);CS1591 7 | true 8 | logging;tracesource 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/Logging/Logging/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Logging/Logging/src/DefaultLoggerLevelConfigureOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.Options; 5 | 6 | namespace Microsoft.Extensions.Logging 7 | { 8 | internal class DefaultLoggerLevelConfigureOptions : ConfigureOptions 9 | { 10 | public DefaultLoggerLevelConfigureOptions(LogLevel level) : base(options => options.MinLevel = level) 11 | { 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/Logging/Logging/src/ILoggingBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace Microsoft.Extensions.Logging 7 | { 8 | /// 9 | /// An interface for configuring logging providers. 10 | /// 11 | public interface ILoggingBuilder 12 | { 13 | /// 14 | /// Gets the where Logging services are configured. 15 | /// 16 | IServiceCollection Services { get; } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Logging/Logging/src/LoggingBuilder.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using Microsoft.Extensions.DependencyInjection; 5 | 6 | namespace Microsoft.Extensions.Logging 7 | { 8 | internal class LoggingBuilder : ILoggingBuilder 9 | { 10 | public LoggingBuilder(IServiceCollection services) 11 | { 12 | Services = services; 13 | } 14 | 15 | public IServiceCollection Services { get; } 16 | } 17 | } -------------------------------------------------------------------------------- /src/Logging/Logging/src/Microsoft.Extensions.Logging.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Logging infrastructure default implementation for Microsoft.Extensions.Logging. 5 | netstandard2.0 6 | $(NoWarn);CS1591 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Logging/Logging/src/Properties/AssemlyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Logging.Configuration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -------------------------------------------------------------------------------- /src/Logging/README.md: -------------------------------------------------------------------------------- 1 | Logging 2 | ======= 3 | 4 | Common logging abstractions and a few implementations. 5 | 6 | ## Providers 7 | 8 | Community projects adapt _Microsoft.Extensions.Logging_ for use with different back-ends. 9 | 10 | * [Serilog](https://github.com/serilog/serilog-framework-logging) - provider for the Serilog library 11 | * [elmah.io](https://github.com/elmahio/Elmah.Io.Extensions.Logging) - provider for the elmah.io service 12 | * [Loggr](https://github.com/imobile3/Loggr.Extensions.Logging) - provider for the Loggr service 13 | * [NLog](https://github.com/NLog/NLog.Extensions.Logging) - provider for the NLog library 14 | * [Graylog](https://github.com/mattwcole/gelf-extensions-logging) - provider for the Graylog service 15 | -------------------------------------------------------------------------------- /src/Logging/samples/SampleApp/logging.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Debug", 5 | "System": "Information", 6 | "Microsoft": "Information" 7 | }, 8 | "Console": 9 | { 10 | "IncludeScopes": "true" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /src/Logging/test/Console/ConsoleContext.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging.Test.Console 7 | { 8 | public class ConsoleContext 9 | { 10 | public ConsoleColor? BackgroundColor { get; set; } 11 | 12 | public ConsoleColor? ForegroundColor { get; set; } 13 | 14 | public string Message { get; set; } 15 | } 16 | } -------------------------------------------------------------------------------- /src/Logging/test/Console/ConsoleSink.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Collections.Generic; 6 | 7 | namespace Microsoft.Extensions.Logging.Test.Console 8 | { 9 | public class ConsoleSink 10 | { 11 | public List Writes { get; set; } = new List(); 12 | 13 | public void Write(ConsoleContext context) 14 | { 15 | Writes.Add(context); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /src/Logging/test/ProviderAliasAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.Logging 7 | { 8 | /// 9 | /// Test implementation of ProviderAliasAttribute 10 | /// 11 | [AttributeUsage(AttributeTargets.Class)] 12 | public class ProviderAliasAttribute : Attribute 13 | { 14 | public ProviderAliasAttribute(string alias) 15 | { 16 | Alias = alias; 17 | } 18 | 19 | public string Alias { get; } 20 | } 21 | } -------------------------------------------------------------------------------- /src/ObjectPool/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/ObjectPool/perf/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | [assembly: BenchmarkDotNet.Attributes.AspNetCoreBenchmark] 5 | -------------------------------------------------------------------------------- /src/ObjectPool/src/DefaultObjectPoolProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.ObjectPool 7 | { 8 | public class DefaultObjectPoolProvider : ObjectPoolProvider 9 | { 10 | public int MaximumRetained { get; set; } = Environment.ProcessorCount * 2; 11 | 12 | public override ObjectPool Create(IPooledObjectPolicy policy) 13 | { 14 | return new DefaultObjectPool(policy, MaximumRetained); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/ObjectPool/src/IPooledObjectPolicy.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.ObjectPool 5 | { 6 | public interface IPooledObjectPolicy 7 | { 8 | T Create(); 9 | 10 | bool Return(T obj); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/ObjectPool/src/Microsoft.Extensions.ObjectPool.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | A simple object pool implementation. 5 | netstandard2.0 6 | $(NoWarn);CS1591 7 | true 8 | pooling 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/ObjectPool/src/ObjectPool.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.ObjectPool 5 | { 6 | public abstract class ObjectPool where T : class 7 | { 8 | public abstract T Get(); 9 | 10 | public abstract void Return(T obj); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/ObjectPool/src/ObjectPoolProvider.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.ObjectPool 5 | { 6 | public abstract class ObjectPoolProvider 7 | { 8 | public ObjectPool Create() where T : class, new() 9 | { 10 | return Create(new DefaultPooledObjectPolicy()); 11 | } 12 | 13 | public abstract ObjectPool Create(IPooledObjectPolicy policy) where T : class; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/ObjectPool/src/PooledObjectPolicy.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.ObjectPool 5 | { 6 | public abstract class PooledObjectPolicy : IPooledObjectPolicy 7 | { 8 | public abstract T Create(); 9 | 10 | public abstract bool Return(T obj); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/ObjectPool/test/Microsoft.Extensions.ObjectPool.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Options/ConfigurationExtensions/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Options/DataAnnotations/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Options/DataAnnotations/src/Microsoft.Extensions.Options.DataAnnotations.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Provides additional DataAnnotations specific functionality related to Options. 5 | netstandard2.0 6 | true 7 | aspnetcore;validation;options 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Options/DataAnnotations/src/baseline.netcore.json: -------------------------------------------------------------------------------- 1 | { 2 | } -------------------------------------------------------------------------------- /src/Options/Options/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Options/Options/src/IOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Options 5 | { 6 | /// 7 | /// Used to retrieve configured TOptions instances. 8 | /// 9 | /// The type of options being requested. 10 | public interface IOptions where TOptions : class, new() 11 | { 12 | /// 13 | /// The default configured TOptions instance 14 | /// 15 | TOptions Value { get; } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/Options/Options/src/IOptionsFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Options 5 | { 6 | /// 7 | /// Used to create TOptions instances. 8 | /// 9 | /// The type of options being requested. 10 | public interface IOptionsFactory where TOptions : class, new() 11 | { 12 | /// 13 | /// Returns a configured TOptions instance with the given name. 14 | /// 15 | TOptions Create(string name); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Options/Options/src/IOptionsSnapshot.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Options 5 | { 6 | /// 7 | /// Used to access the value of TOptions for the lifetime of a request. 8 | /// 9 | /// 10 | public interface IOptionsSnapshot : IOptions where TOptions : class, new() 11 | { 12 | /// 13 | /// Returns a configured TOptions instance with the given name. 14 | /// 15 | TOptions Get(string name); 16 | } 17 | } -------------------------------------------------------------------------------- /src/Options/Options/src/Microsoft.Extensions.Options.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Provides a strongly typed way of specifying and accessing settings using dependency injection. 5 | netstandard2.0 6 | true 7 | aspnetcore;options 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/Options/Options/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.Extensions.Options.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/Options/README.md: -------------------------------------------------------------------------------- 1 | Options 2 | ======= 3 | 4 | Options is a framework for accessing and configuring POCO settings. 5 | -------------------------------------------------------------------------------- /src/Options/test/FakeOptions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Options.Tests 5 | { 6 | public class FakeOptions 7 | { 8 | public FakeOptions() 9 | { 10 | Message = ""; 11 | } 12 | 13 | public string Message { get; set; } 14 | } 15 | 16 | public class FakeOptions2 : FakeOptions { } 17 | } 18 | -------------------------------------------------------------------------------- /src/Options/test/FakeOptionsFactory.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.Extensions.Options.Tests 5 | { 6 | public class FakeOptionsFactory : IOptionsFactory 7 | { 8 | public static FakeOptions Options = new FakeOptions(); 9 | 10 | public FakeOptions Create(string name) => Options; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/Options/test/Microsoft.Extensions.Options.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/Primitives/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/Primitives/perf/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | [assembly: BenchmarkDotNet.Attributes.AspNetCoreBenchmark] 5 | -------------------------------------------------------------------------------- /src/Primitives/test/Microsoft.Extensions.Primitives.Tests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/Shared/src/ActivatorUtilities/sharedsources.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | true 5 | $(ContentTargetFolders)\cs\netstandard1.0\ 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Shared/src/BenchmarkRunner/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Microsoft.AspNetCore.BenchmarkRunner.Sources 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Shared/src/BenchmarkRunner/ParameterizedJobConfigAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace BenchmarkDotNet.Attributes 7 | { 8 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)] 9 | internal class ParameterizedJobConfigAttribute: AspNetCoreBenchmarkAttribute 10 | { 11 | public ParameterizedJobConfigAttribute(Type configType) : base(configType) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/Shared/src/CommandLineUtils/CommandLine/CommandOptionType.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | 5 | namespace Microsoft.Extensions.CommandLineUtils 6 | { 7 | internal enum CommandOptionType 8 | { 9 | MultipleValue, 10 | SingleValue, 11 | NoValue 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/Shared/src/CommandLineUtils/CommandLine/CommandParsingException.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.CommandLineUtils 7 | { 8 | internal class CommandParsingException : Exception 9 | { 10 | public CommandParsingException(CommandLineApplication command, string message) 11 | : base(message) 12 | { 13 | Command = command; 14 | } 15 | 16 | public CommandLineApplication Command { get; } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/Shared/src/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Microsoft.Extensions.$(ProjectDirName).Sources 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/Shared/src/EmptyDisposable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.Extensions.FileProviders 7 | { 8 | internal class EmptyDisposable : IDisposable 9 | { 10 | public static EmptyDisposable Instance { get; } = new EmptyDisposable(); 11 | 12 | private EmptyDisposable() 13 | { 14 | } 15 | 16 | public void Dispose() 17 | { 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/TestingUtils/Internal.AspNetCore.Analyzers/src/Internal.AspNetCore.Analyzers.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | ASP.NET Core internal use analyzers. 5 | netstandard1.3 6 | $(PackageTags);analyzers 7 | $(NoWarn);CS1591 8 | false 9 | analyzers/dotnet/cs/ 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/TestingUtils/Internal.AspNetCore.Analyzers/test/Internal.AspNetCore.Analyzers.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | true 6 | Analyzers 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Analyzer.Testing/src/build/Microsoft.AspNetCore.Analyzer.Testing.props: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | true 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/src/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System.Runtime.CompilerServices; 5 | 6 | [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Testing.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] 7 | -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/src/contentFiles/cs/netstandard2.0/EventSourceTestCollection.cs: -------------------------------------------------------------------------------- 1 | namespace Microsoft.AspNetCore.Testing.Tracing 2 | { 3 | // This file comes from Microsoft.AspNetCore.Testing and has to be defined in the test assembly. 4 | // It enables EventSourceTestBase's parallel isolation functionality. 5 | 6 | [Xunit.CollectionDefinition(EventSourceTestBase.CollectionName, DisableParallelization = true)] 7 | public class EventSourceTestCollection 8 | { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/src/xunit/ConditionalFactAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Xunit; 6 | using Xunit.Sdk; 7 | 8 | namespace Microsoft.AspNetCore.Testing.xunit 9 | { 10 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] 11 | [XunitTestCaseDiscoverer("Microsoft.AspNetCore.Testing.xunit." + nameof(ConditionalFactDiscoverer), "Microsoft.AspNetCore.Testing")] 12 | public class ConditionalFactAttribute : FactAttribute 13 | { 14 | } 15 | } -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/src/xunit/ConditionalTheoryAttribute.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using Xunit; 6 | using Xunit.Sdk; 7 | 8 | namespace Microsoft.AspNetCore.Testing.xunit 9 | { 10 | [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] 11 | [XunitTestCaseDiscoverer("Microsoft.AspNetCore.Testing.xunit." + nameof(ConditionalTheoryDiscoverer), "Microsoft.AspNetCore.Testing")] 12 | public class ConditionalTheoryAttribute : TheoryAttribute 13 | { 14 | } 15 | } -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/src/xunit/IEnvironmentVariable.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.AspNetCore.Testing.xunit 5 | { 6 | internal interface IEnvironmentVariable 7 | { 8 | string Get(string name); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/src/xunit/ITestCondition.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.AspNetCore.Testing.xunit 5 | { 6 | public interface ITestCondition 7 | { 8 | bool IsMet { get; } 9 | 10 | string SkipReason { get; } 11 | } 12 | } -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/src/xunit/OperatingSystems.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.AspNetCore.Testing.xunit 7 | { 8 | [Flags] 9 | public enum OperatingSystems 10 | { 11 | Linux = 1, 12 | MacOSX = 2, 13 | Windows = 4, 14 | } 15 | } -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/src/xunit/RuntimeFrameworks.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace Microsoft.AspNetCore.Testing.xunit 7 | { 8 | [Flags] 9 | public enum RuntimeFrameworks 10 | { 11 | None = 0, 12 | Mono = 1 << 0, 13 | CLR = 1 << 1, 14 | CoreCLR = 1 << 2 15 | } 16 | } -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/src/xunit/WindowsVersions.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | namespace Microsoft.AspNetCore.Testing.xunit 5 | { 6 | public static class WindowsVersions 7 | { 8 | public const string Win7 = "6.1"; 9 | 10 | public const string Win2008R2 = Win7; 11 | 12 | public const string Win8 = "6.2"; 13 | 14 | public const string Win81 = "6.3"; 15 | 16 | public const string Win10 = "10.0"; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/test/DockerTests.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Runtime.InteropServices; 6 | using Microsoft.AspNetCore.Testing.xunit; 7 | using Xunit; 8 | 9 | namespace Microsoft.AspNetCore.Testing 10 | { 11 | public class DockerTests 12 | { 13 | [ConditionalFact] 14 | [DockerOnly] 15 | [Trait("Docker", "true")] 16 | public void DoesNotRunOnWindows() 17 | { 18 | Assert.False(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/TestingUtils/Microsoft.AspNetCore.Testing/test/TaskExtensionsTest.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) .NET Foundation. All rights reserved. 2 | // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. 3 | 4 | using System; 5 | using System.Threading.Tasks; 6 | using Xunit; 7 | 8 | namespace Microsoft.AspNetCore.Testing 9 | { 10 | public class TaskExtensionsTest 11 | { 12 | [Fact] 13 | public async Task TimeoutAfterTest() 14 | { 15 | await Assert.ThrowsAsync(async () => await Task.Delay(1000).TimeoutAfter(TimeSpan.FromMilliseconds(50))); 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /src/WebEncoders/Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/WebEncoders/test/Microsoft.Extensions.WebEncoders.Tests.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netcoreapp2.2;net461 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | --------------------------------------------------------------------------------