diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 4eea96ab69..0000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,17 +0,0 @@ -init: -- git config --global core.autocrlf true -branches: - only: - - dev - - /^release\/.*$/ - - /^(.*\/)?ci-.*$/ -build_script: -- ps: .\run.ps1 default-build -clone_depth: 1 -environment: - global: - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -test: 'off' -deploy: 'off' -os: Visual Studio 2017 diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 97b827b758..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,51 +0,0 @@ -*.doc diff=astextplain -*.DOC diff=astextplain -*.docx diff=astextplain -*.DOCX diff=astextplain -*.dot diff=astextplain -*.DOT diff=astextplain -*.pdf diff=astextplain -*.PDF diff=astextplain -*.rtf diff=astextplain -*.RTF diff=astextplain - -*.jpg binary -*.png binary -*.gif binary - -*.cs text=auto diff=csharp -*.vb text=auto -*.resx text=auto -*.c text=auto -*.cpp text=auto -*.cxx text=auto -*.h text=auto -*.hxx text=auto -*.py text=auto -*.rb text=auto -*.java text=auto -*.html text=auto -*.htm text=auto -*.css text=auto -*.scss text=auto -*.sass text=auto -*.less text=auto -*.js text=auto -*.lisp text=auto -*.clj text=auto -*.sql text=auto -*.php text=auto -*.lua text=auto -*.m text=auto -*.asm text=auto -*.erl text=auto -*.fs text=auto -*.fsx text=auto -*.hs text=auto - -*.csproj text=auto -*.vbproj text=auto -*.fsproj text=auto -*.dbproj text=auto -*.sln text=auto eol=crlf -*.sh eol=lf diff --git a/.gitignore b/.gitignore deleted file mode 100644 index edc4093242..0000000000 --- a/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -[Oo]bj/ -[Bb]in/ -TestResults/ -.nuget/ -_ReSharper.*/ -packages/ -artifacts/ -PublishProfiles/ -*.user -*.suo -*.cache -*.docstates -_ReSharper.* -nuget.exe -*net45.csproj -*net451.csproj -*k10.csproj -*.psess -*.vsp -*.pidb -*.userprefs -*DS_Store -*.ncrunchsolution -*.*sdf -*.ipch -*.sln.ide -project.lock.json -/.vs/ -.vscode/ -.build/ -.testPublish/ -global.json diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 64bdbb4441..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: csharp -sudo: false -dist: trusty -env: - global: - - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true - - DOTNET_CLI_TELEMETRY_OPTOUT: 1 -mono: none -os: -- linux -- osx -osx_image: xcode8.2 -addons: - apt: - packages: - - libunwind8 -branches: - only: - - dev - - /^release\/.*$/ - - /^(.*\/)?ci-.*$/ -before_install: -- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s - /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib - /usr/local/lib/; fi -script: -- ./build.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index 64ff041d5c..0000000000 --- a/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -Contributing -====== - -Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) in the Home repo. diff --git a/Directory.Build.props b/Directory.Build.props deleted file mode 100644 index fbb0c081f2..0000000000 --- a/Directory.Build.props +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - Microsoft ASP.NET Core - https://github.com/aspnet/Hosting - git - $(MSBuildThisFileDirectory) - $(MSBuildThisFileDirectory)build\Key.snk - true - true - true - - false - - - diff --git a/Directory.Build.targets b/Directory.Build.targets deleted file mode 100644 index 53b3f6e1da..0000000000 --- a/Directory.Build.targets +++ /dev/null @@ -1,7 +0,0 @@ - - - $(MicrosoftNETCoreApp20PackageVersion) - $(MicrosoftNETCoreApp21PackageVersion) - $(NETStandardLibrary20PackageVersion) - - diff --git a/Hosting.sln b/Hosting.sln deleted file mode 100644 index 3ec084ca0b..0000000000 --- a/Hosting.sln +++ /dev/null @@ -1,378 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.27130.2027 -MinimumVisualStudioVersion = 15.0.26730.03 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E0497F39-AFFB-4819-A116-E39E361915AB}" - ProjectSection(SolutionItems) = preProject - src\Directory.Build.props = src\Directory.Build.props - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{FEB39027-9158-4DE2-997F-7ADAEF8188D0}" - ProjectSection(SolutionItems) = preProject - test\Directory.Build.props = test\Directory.Build.props - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.TestHost.Tests", "test\Microsoft.AspNetCore.TestHost.Tests\Microsoft.AspNetCore.TestHost.Tests.csproj", "{0ACB2719-9484-49B5-B8E3-117091192511}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.TestHost", "src\Microsoft.AspNetCore.TestHost\Microsoft.AspNetCore.TestHost.csproj", "{1A415A3F-1081-45DB-809B-EE19CEA02DC0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Hosting", "src\Microsoft.AspNetCore.Hosting\Microsoft.AspNetCore.Hosting.csproj", "{3944F036-7E75-47E8-AA52-C4B89A64EC3A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Hosting.Tests", "test\Microsoft.AspNetCore.Hosting.Tests\Microsoft.AspNetCore.Hosting.Tests.csproj", "{D4F18D58-52B1-435D-A012-10F2CDF158C4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Hosting.Abstractions", "src\Microsoft.AspNetCore.Hosting.Abstractions\Microsoft.AspNetCore.Hosting.Abstractions.csproj", "{BB780FBB-7842-4759-8DE7-96FA2E5571C1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Hosting.Server.Abstractions", "src\Microsoft.AspNetCore.Hosting.Server.Abstractions\Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj", "{FDBBA081-5248-4FC0-9E08-B46BEF3FA438}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.IntegrationTesting", "src\Microsoft.AspNetCore.Server.IntegrationTesting\Microsoft.AspNetCore.Server.IntegrationTesting.csproj", "{3DA89347-6731-4366-80C4-548F24E8607B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{9C7520A0-F2EB-411C-8BB2-80B39C937217}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleStartups", "samples\SampleStartups\SampleStartups.csproj", "{485B6745-7648-400A-A969-F68FCF194E46}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Hosting.FunctionalTests", "test\Microsoft.AspNetCore.Hosting.FunctionalTests\Microsoft.AspNetCore.Hosting.FunctionalTests.csproj", "{FC578F4E-171C-4F82-B301-3ABF6318D082}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Hosting.Abstractions", "src\Microsoft.Extensions.Hosting.Abstractions\Microsoft.Extensions.Hosting.Abstractions.csproj", "{96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Hosting.WindowsServices", "src\Microsoft.AspNetCore.Hosting.WindowsServices\Microsoft.AspNetCore.Hosting.WindowsServices.csproj", "{9C93A93B-270A-4785-8F41-46C38DC33825}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestAssets", "TestAssets", "{FA7D2012-C1B4-4AF7-9ADD-381B2004EA16}" - ProjectSection(SolutionItems) = preProject - test\TestAssets\Directory.Build.props = test\TestAssets\Directory.Build.props - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Hosting.TestSites", "test\TestAssets\Microsoft.AspNetCore.Hosting.TestSites\Microsoft.AspNetCore.Hosting.TestSites.csproj", "{EDFF02F0-A8A4-4EB1-A179-94D7500FB266}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestStartupAssembly1", "test\TestAssets\TestStartupAssembly1\TestStartupAssembly1.csproj", "{58194285-5891-464A-A96B-0FE043029E8A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IStartupInjectionAssemblyName", "test\TestAssets\IStartupInjectionAssemblyName\IStartupInjectionAssemblyName.csproj", "{F894D8C5-B760-4734-AD31-3CA6FC557CCF}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{A7270417-6BC6-4E3F-A96A-79193D16BB82}" - ProjectSection(SolutionItems) = preProject - Directory.Build.props = Directory.Build.props - Directory.Build.targets = Directory.Build.targets - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenericHostSample", "samples\GenericHostSample\GenericHostSample.csproj", "{8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Hosting", "src\Microsoft.Extensions.Hosting\Microsoft.Extensions.Hosting.csproj", "{1DA77D55-5DB9-4426-87DC-758579335944}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenericWebHost", "samples\GenericWebHost\GenericWebHost.csproj", "{FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Hosting.Tests", "test\Microsoft.Extensions.Hosting.Tests\Microsoft.Extensions.Hosting.Tests.csproj", "{45E296BB-7628-49AF-B5A5-04CD9A89CAD3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests", "test\Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests\Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests.csproj", "{3834E274-3AF5-4751-8857-5B67BBE607DD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BuildWebHostPatternTestSite", "test\TestAssets\BuildWebHostPatternTestSite\BuildWebHostPatternTestSite.csproj", "{37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{F9074486-EAE4-4171-BC9E-1557C2A56DDE}" - ProjectSection(SolutionItems) = preProject - build\dependencies.props = build\dependencies.props - build\repo.props = build\repo.props - build\sources.props = build\sources.props - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CreateWebHostBuilderInvalidSignature", "test\TestAssets\CreateWebHostBuilderInvalidSignature\CreateWebHostBuilderInvalidSignature.csproj", "{ACB63E80-375C-4A8F-9210-8FD509148F31}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BuildWebHostInvalidSignature", "test\TestAssets\BuildWebHostInvalidSignature\BuildWebHostInvalidSignature.csproj", "{79D0E344-71C4-4D63-9632-01CC041C8788}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|Mixed Platforms = Debug|Mixed Platforms - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|Mixed Platforms = Release|Mixed Platforms - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0ACB2719-9484-49B5-B8E3-117091192511}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0ACB2719-9484-49B5-B8E3-117091192511}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0ACB2719-9484-49B5-B8E3-117091192511}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0ACB2719-9484-49B5-B8E3-117091192511}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0ACB2719-9484-49B5-B8E3-117091192511}.Debug|x86.ActiveCfg = Debug|Any CPU - {0ACB2719-9484-49B5-B8E3-117091192511}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0ACB2719-9484-49B5-B8E3-117091192511}.Release|Any CPU.Build.0 = Release|Any CPU - {0ACB2719-9484-49B5-B8E3-117091192511}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0ACB2719-9484-49B5-B8E3-117091192511}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {0ACB2719-9484-49B5-B8E3-117091192511}.Release|x86.ActiveCfg = Release|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Debug|x86.ActiveCfg = Debug|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Release|Any CPU.Build.0 = Release|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1A415A3F-1081-45DB-809B-EE19CEA02DC0}.Release|x86.ActiveCfg = Release|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Debug|x86.ActiveCfg = Debug|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Release|Any CPU.Build.0 = Release|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3944F036-7E75-47E8-AA52-C4B89A64EC3A}.Release|x86.ActiveCfg = Release|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Debug|x86.ActiveCfg = Debug|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Release|Any CPU.Build.0 = Release|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {D4F18D58-52B1-435D-A012-10F2CDF158C4}.Release|x86.ActiveCfg = Release|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Debug|x86.ActiveCfg = Debug|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Debug|x86.Build.0 = Debug|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Release|Any CPU.Build.0 = Release|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Release|x86.ActiveCfg = Release|Any CPU - {BB780FBB-7842-4759-8DE7-96FA2E5571C1}.Release|x86.Build.0 = Release|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Debug|x86.ActiveCfg = Debug|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Debug|x86.Build.0 = Debug|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Release|Any CPU.Build.0 = Release|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Release|x86.ActiveCfg = Release|Any CPU - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438}.Release|x86.Build.0 = Release|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Debug|x86.ActiveCfg = Debug|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Debug|x86.Build.0 = Debug|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Release|Any CPU.Build.0 = Release|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Release|x86.ActiveCfg = Release|Any CPU - {3DA89347-6731-4366-80C4-548F24E8607B}.Release|x86.Build.0 = Release|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Debug|Any CPU.Build.0 = Debug|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Debug|x86.ActiveCfg = Debug|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Debug|x86.Build.0 = Debug|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Release|Any CPU.ActiveCfg = Release|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Release|Any CPU.Build.0 = Release|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Release|x86.ActiveCfg = Release|Any CPU - {485B6745-7648-400A-A969-F68FCF194E46}.Release|x86.Build.0 = Release|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Debug|x86.ActiveCfg = Debug|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Debug|x86.Build.0 = Debug|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Release|Any CPU.Build.0 = Release|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Release|x86.ActiveCfg = Release|Any CPU - {FC578F4E-171C-4F82-B301-3ABF6318D082}.Release|x86.Build.0 = Release|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Debug|Any CPU.Build.0 = Debug|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Debug|x86.ActiveCfg = Debug|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Debug|x86.Build.0 = Debug|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Release|Any CPU.ActiveCfg = Release|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Release|Any CPU.Build.0 = Release|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Release|x86.ActiveCfg = Release|Any CPU - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12}.Release|x86.Build.0 = Release|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Debug|x86.ActiveCfg = Debug|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Debug|x86.Build.0 = Debug|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Release|Any CPU.Build.0 = Release|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Release|x86.ActiveCfg = Release|Any CPU - {9C93A93B-270A-4785-8F41-46C38DC33825}.Release|x86.Build.0 = Release|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Debug|x86.ActiveCfg = Debug|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Debug|x86.Build.0 = Debug|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Release|Any CPU.Build.0 = Release|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Release|x86.ActiveCfg = Release|Any CPU - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266}.Release|x86.Build.0 = Release|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Debug|x86.ActiveCfg = Debug|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Debug|x86.Build.0 = Debug|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Release|Any CPU.Build.0 = Release|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Release|x86.ActiveCfg = Release|Any CPU - {58194285-5891-464A-A96B-0FE043029E8A}.Release|x86.Build.0 = Release|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Debug|x86.ActiveCfg = Debug|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Debug|x86.Build.0 = Debug|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Release|Any CPU.Build.0 = Release|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Release|x86.ActiveCfg = Release|Any CPU - {F894D8C5-B760-4734-AD31-3CA6FC557CCF}.Release|x86.Build.0 = Release|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Debug|x86.ActiveCfg = Debug|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Debug|x86.Build.0 = Debug|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Release|Any CPU.Build.0 = Release|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Release|x86.ActiveCfg = Release|Any CPU - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE}.Release|x86.Build.0 = Release|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Debug|x86.ActiveCfg = Debug|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Debug|x86.Build.0 = Debug|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Release|Any CPU.Build.0 = Release|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Release|x86.ActiveCfg = Release|Any CPU - {1DA77D55-5DB9-4426-87DC-758579335944}.Release|x86.Build.0 = Release|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Debug|x86.ActiveCfg = Debug|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Debug|x86.Build.0 = Debug|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Release|Any CPU.Build.0 = Release|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Release|x86.ActiveCfg = Release|Any CPU - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF}.Release|x86.Build.0 = Release|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Debug|x86.ActiveCfg = Debug|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Debug|x86.Build.0 = Debug|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Release|Any CPU.Build.0 = Release|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Release|x86.ActiveCfg = Release|Any CPU - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3}.Release|x86.Build.0 = Release|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Debug|x86.ActiveCfg = Debug|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Debug|x86.Build.0 = Debug|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Release|Any CPU.Build.0 = Release|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Release|x86.ActiveCfg = Release|Any CPU - {3834E274-3AF5-4751-8857-5B67BBE607DD}.Release|x86.Build.0 = Release|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Debug|x86.ActiveCfg = Debug|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Debug|x86.Build.0 = Debug|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Release|Any CPU.Build.0 = Release|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Release|x86.ActiveCfg = Release|Any CPU - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1}.Release|x86.Build.0 = Release|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Debug|x86.ActiveCfg = Debug|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Debug|x86.Build.0 = Debug|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Release|Any CPU.Build.0 = Release|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Release|x86.ActiveCfg = Release|Any CPU - {ACB63E80-375C-4A8F-9210-8FD509148F31}.Release|x86.Build.0 = Release|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Debug|Any CPU.Build.0 = Debug|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Debug|x86.ActiveCfg = Debug|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Debug|x86.Build.0 = Debug|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Release|Any CPU.ActiveCfg = Release|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Release|Any CPU.Build.0 = Release|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Release|x86.ActiveCfg = Release|Any CPU - {79D0E344-71C4-4D63-9632-01CC041C8788}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {0ACB2719-9484-49B5-B8E3-117091192511} = {FEB39027-9158-4DE2-997F-7ADAEF8188D0} - {1A415A3F-1081-45DB-809B-EE19CEA02DC0} = {E0497F39-AFFB-4819-A116-E39E361915AB} - {3944F036-7E75-47E8-AA52-C4B89A64EC3A} = {E0497F39-AFFB-4819-A116-E39E361915AB} - {D4F18D58-52B1-435D-A012-10F2CDF158C4} = {FEB39027-9158-4DE2-997F-7ADAEF8188D0} - {BB780FBB-7842-4759-8DE7-96FA2E5571C1} = {E0497F39-AFFB-4819-A116-E39E361915AB} - {FDBBA081-5248-4FC0-9E08-B46BEF3FA438} = {E0497F39-AFFB-4819-A116-E39E361915AB} - {3DA89347-6731-4366-80C4-548F24E8607B} = {E0497F39-AFFB-4819-A116-E39E361915AB} - {485B6745-7648-400A-A969-F68FCF194E46} = {9C7520A0-F2EB-411C-8BB2-80B39C937217} - {FC578F4E-171C-4F82-B301-3ABF6318D082} = {FEB39027-9158-4DE2-997F-7ADAEF8188D0} - {96BC7EEA-64D9-4DA5-8E87-1C18CBFE7D12} = {E0497F39-AFFB-4819-A116-E39E361915AB} - {9C93A93B-270A-4785-8F41-46C38DC33825} = {E0497F39-AFFB-4819-A116-E39E361915AB} - {FA7D2012-C1B4-4AF7-9ADD-381B2004EA16} = {FEB39027-9158-4DE2-997F-7ADAEF8188D0} - {EDFF02F0-A8A4-4EB1-A179-94D7500FB266} = {FA7D2012-C1B4-4AF7-9ADD-381B2004EA16} - {58194285-5891-464A-A96B-0FE043029E8A} = {FA7D2012-C1B4-4AF7-9ADD-381B2004EA16} - {F894D8C5-B760-4734-AD31-3CA6FC557CCF} = {FA7D2012-C1B4-4AF7-9ADD-381B2004EA16} - {8529E5F7-059F-4A06-AD6E-ECDF4F4838FE} = {9C7520A0-F2EB-411C-8BB2-80B39C937217} - {1DA77D55-5DB9-4426-87DC-758579335944} = {E0497F39-AFFB-4819-A116-E39E361915AB} - {FCDD1C82-623C-4779-8A9C-B0D827CEA8BF} = {9C7520A0-F2EB-411C-8BB2-80B39C937217} - {45E296BB-7628-49AF-B5A5-04CD9A89CAD3} = {FEB39027-9158-4DE2-997F-7ADAEF8188D0} - {3834E274-3AF5-4751-8857-5B67BBE607DD} = {FEB39027-9158-4DE2-997F-7ADAEF8188D0} - {37C4BD55-CD39-4C4E-BA01-0AEAFCE128F1} = {FA7D2012-C1B4-4AF7-9ADD-381B2004EA16} - {F9074486-EAE4-4171-BC9E-1557C2A56DDE} = {A7270417-6BC6-4E3F-A96A-79193D16BB82} - {ACB63E80-375C-4A8F-9210-8FD509148F31} = {FA7D2012-C1B4-4AF7-9ADD-381B2004EA16} - {79D0E344-71C4-4D63-9632-01CC041C8788} = {FA7D2012-C1B4-4AF7-9ADD-381B2004EA16} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {AABD536D-E05F-409B-A716-535E0C478076} - EndGlobalSection -EndGlobal diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index 7b2956ecee..0000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,14 +0,0 @@ -Copyright (c) .NET Foundation and Contributors - -All rights reserved. - -Licensed under the Apache License, Version 2.0 (the "License"); you may not use -this file except in compliance with the License. You may obtain a copy of the -License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software distributed -under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -CONDITIONS OF ANY KIND, either express or implied. See the License for the -specific language governing permissions and limitations under the License. diff --git a/NuGet.config b/NuGet.config deleted file mode 100644 index e32bddfd51..0000000000 --- a/NuGet.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/NuGetPackageVerifier.json b/NuGetPackageVerifier.json deleted file mode 100644 index 7e6fb60925..0000000000 --- a/NuGetPackageVerifier.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "nonshipping": { - "rules": [ - // Don't run any rules for packages that don't ship. - ], - "packages": { - "Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Sources": {}, - "Microsoft.AspNetCore.Server.IntegrationTesting": {} - } - }, - "Default": { - "rules": [ - "DefaultCompositeRule" - ] - } -} diff --git a/README.md b/README.md deleted file mode 100644 index 28ecfa142d..0000000000 --- a/README.md +++ /dev/null @@ -1,9 +0,0 @@ -Hosting -======= -AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/99mq30o3hcs9p39n/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/Hosting/branch/dev) - -Travis: [![Travis](https://travis-ci.org/aspnet/Hosting.svg?branch=dev)](https://travis-ci.org/aspnet/Hosting) - -The Hosting repo contains code required to host an ASP.NET Core application, it is the entry point used when self-hosting an application. - -This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo. diff --git a/build.cmd b/build.cmd deleted file mode 100644 index c0050bda12..0000000000 --- a/build.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE" diff --git a/build.sh b/build.sh deleted file mode 100755 index 98a4b22765..0000000000 --- a/build.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs) -chmod +x "$DIR/run.sh"; sync -"$DIR/run.sh" default-build "$@" diff --git a/build/Key.snk b/build/Key.snk deleted file mode 100644 index e10e4889c1..0000000000 Binary files a/build/Key.snk and /dev/null differ diff --git a/build/dependencies.props b/build/dependencies.props deleted file mode 100644 index f117594e09..0000000000 --- a/build/dependencies.props +++ /dev/null @@ -1,59 +0,0 @@ - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - 2.1.3-rtm-15802 - 2.0.0 - 2.1.2 - 1.0.1 - 15.6.1 - 4.7.49 - 2.0.3 - 1.4.0 - 3.2.0 - 4.5.0 - 4.5.0 - 1.6.0 - 4.5.0 - 2.3.1 - 2.4.0-beta.1.build3945 - - - - - - - - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.0 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.0 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - 2.1.1 - - \ No newline at end of file diff --git a/build/repo.props b/build/repo.props deleted file mode 100644 index 63b8297bfc..0000000000 --- a/build/repo.props +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - Internal.AspNetCore.Universe.Lineup - 2.1.0-rc1-* - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json - - - - - - - diff --git a/build/sources.props b/build/sources.props deleted file mode 100644 index 9215df9751..0000000000 --- a/build/sources.props +++ /dev/null @@ -1,17 +0,0 @@ - - - - - $(DotNetRestoreSources) - - $(RestoreSources); - https://dotnet.myget.org/F/dotnet-core/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json; - https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json; - - - $(RestoreSources); - https://api.nuget.org/v3/index.json; - - - diff --git a/korebuild-lock.txt b/korebuild-lock.txt deleted file mode 100644 index 1dfc352a0a..0000000000 --- a/korebuild-lock.txt +++ /dev/null @@ -1,2 +0,0 @@ -version:2.1.3-rtm-15802 -commithash:a7c08b45b440a7d2058a0aa1eaa3eb6ba811976a diff --git a/korebuild.json b/korebuild.json deleted file mode 100644 index 678d8bb948..0000000000 --- a/korebuild.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/release/2.1/tools/korebuild.schema.json", - "channel": "release/2.1" -} diff --git a/run.cmd b/run.cmd deleted file mode 100644 index d52d5c7e68..0000000000 --- a/run.cmd +++ /dev/null @@ -1,2 +0,0 @@ -@ECHO OFF -PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE" diff --git a/run.ps1 b/run.ps1 deleted file mode 100644 index 27dcf848f8..0000000000 --- a/run.ps1 +++ /dev/null @@ -1,196 +0,0 @@ -#!/usr/bin/env powershell -#requires -version 4 - -<# -.SYNOPSIS -Executes KoreBuild commands. - -.DESCRIPTION -Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`. - -.PARAMETER Command -The KoreBuild command to run. - -.PARAMETER Path -The folder to build. Defaults to the folder containing this script. - -.PARAMETER Channel -The channel of KoreBuild to download. Overrides the value from the config file. - -.PARAMETER DotNetHome -The directory where .NET Core tools will be stored. - -.PARAMETER ToolsSource -The base url where build tools can be downloaded. Overrides the value from the config file. - -.PARAMETER Update -Updates KoreBuild to the latest version even if a lock file is present. - -.PARAMETER ConfigFile -The path to the configuration file that stores values. Defaults to korebuild.json. - -.PARAMETER ToolsSourceSuffix -The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores. - -.PARAMETER Arguments -Arguments to be passed to the command - -.NOTES -This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be. -When the lockfile is not present, KoreBuild will create one using latest available version from $Channel. - -The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set -in the file are overridden by command line parameters. - -.EXAMPLE -Example config file: -```json -{ - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json", - "channel": "dev", - "toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools" -} -``` -#> -[CmdletBinding(PositionalBinding = $false)] -param( - [Parameter(Mandatory = $true, Position = 0)] - [string]$Command, - [string]$Path = $PSScriptRoot, - [Alias('c')] - [string]$Channel, - [Alias('d')] - [string]$DotNetHome, - [Alias('s')] - [string]$ToolsSource, - [Alias('u')] - [switch]$Update, - [string]$ConfigFile, - [string]$ToolsSourceSuffix, - [Parameter(ValueFromRemainingArguments = $true)] - [string[]]$Arguments -) - -Set-StrictMode -Version 2 -$ErrorActionPreference = 'Stop' - -# -# Functions -# - -function Get-KoreBuild { - - $lockFile = Join-Path $Path 'korebuild-lock.txt' - - if (!(Test-Path $lockFile) -or $Update) { - Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix - } - - $version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1 - if (!$version) { - Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'" - } - $version = $version.TrimStart('version:').Trim() - $korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version) - - if (!(Test-Path $korebuildPath)) { - Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version" - New-Item -ItemType Directory -Path $korebuildPath | Out-Null - $remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip" - - try { - $tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip" - Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix - if (Get-Command -Name 'Expand-Archive' -ErrorAction Ignore) { - # Use built-in commands where possible as they are cross-plat compatible - Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath - } - else { - # Fallback to old approach for old installations of PowerShell - Add-Type -AssemblyName System.IO.Compression.FileSystem - [System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath) - } - } - catch { - Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore - throw - } - finally { - Remove-Item $tmpfile -ErrorAction Ignore - } - } - - return $korebuildPath -} - -function Join-Paths([string]$path, [string[]]$childPaths) { - $childPaths | ForEach-Object { $path = Join-Path $path $_ } - return $path -} - -function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) { - if ($RemotePath -notlike 'http*') { - Copy-Item $RemotePath $LocalPath - return - } - - $retries = 10 - while ($retries -gt 0) { - $retries -= 1 - try { - Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath - return - } - catch { - Write-Verbose "Request failed. $retries retries remaining" - } - } - - Write-Error "Download failed: '$RemotePath'." -} - -# -# Main -# - -# Load configuration or set defaults - -$Path = Resolve-Path $Path -if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' } - -if (Test-Path $ConfigFile) { - try { - $config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json - if ($config) { - if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel } - if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource} - } - } - catch { - Write-Warning "$ConfigFile could not be read. Its settings will be ignored." - Write-Warning $Error[0] - } -} - -if (!$DotNetHome) { - $DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } ` - elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} ` - elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}` - else { Join-Path $PSScriptRoot '.dotnet'} -} - -if (!$Channel) { $Channel = 'dev' } -if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' } - -# Execute - -$korebuildPath = Get-KoreBuild -Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1') - -try { - Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile - Invoke-KoreBuildCommand $Command @Arguments -} -finally { - Remove-Module 'KoreBuild' -ErrorAction Ignore -} diff --git a/run.sh b/run.sh deleted file mode 100755 index 834961fc3a..0000000000 --- a/run.sh +++ /dev/null @@ -1,231 +0,0 @@ -#!/usr/bin/env bash - -set -euo pipefail - -# -# variables -# - -RESET="\033[0m" -RED="\033[0;31m" -YELLOW="\033[0;33m" -MAGENTA="\033[0;95m" -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet" -verbose=false -update=false -repo_path="$DIR" -channel='' -tools_source='' -tools_source_suffix='' - -# -# Functions -# -__usage() { - echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] ...]" - echo "" - echo "Arguments:" - echo " command The command to be run." - echo " ... Arguments passed to the command. Variable number of arguments allowed." - echo "" - echo "Options:" - echo " --verbose Show verbose output." - echo " -c|--channel The channel of KoreBuild to download. Overrides the value from the config file.." - echo " --config-file The path to the configuration file that stores values. Defaults to korebuild.json." - echo " -d|--dotnet-home The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet." - echo " --path The directory to build. Defaults to the directory containing the script." - echo " -s|--tools-source|-ToolsSource The base url where build tools can be downloaded. Overrides the value from the config file." - echo " --tools-source-suffix|-ToolsSourceSuffix The suffix to append to tools-source. Useful for query strings." - echo " -u|--update Update to the latest KoreBuild even if the lock file is present." - echo "" - echo "Description:" - echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be." - echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel." - - if [[ "${1:-}" != '--no-exit' ]]; then - exit 2 - fi -} - -get_korebuild() { - local version - local lock_file="$repo_path/korebuild-lock.txt" - if [ ! -f "$lock_file" ] || [ "$update" = true ]; then - __get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix" - fi - version="$(grep 'version:*' -m 1 "$lock_file")" - if [[ "$version" == '' ]]; then - __error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'" - return 1 - fi - version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" - local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version" - - { - if [ ! -d "$korebuild_path" ]; then - mkdir -p "$korebuild_path" - local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip" - tmpfile="$(mktemp)" - echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}" - if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then - unzip -q -d "$korebuild_path" "$tmpfile" - fi - rm "$tmpfile" || true - fi - - source "$korebuild_path/KoreBuild.sh" - } || { - if [ -d "$korebuild_path" ]; then - echo "Cleaning up after failed installation" - rm -rf "$korebuild_path" || true - fi - return 1 - } -} - -__error() { - echo -e "${RED}error: $*${RESET}" 1>&2 -} - -__warn() { - echo -e "${YELLOW}warning: $*${RESET}" -} - -__machine_has() { - hash "$1" > /dev/null 2>&1 - return $? -} - -__get_remote_file() { - local remote_path=$1 - local local_path=$2 - local remote_path_suffix=$3 - - if [[ "$remote_path" != 'http'* ]]; then - cp "$remote_path" "$local_path" - return 0 - fi - - local failed=false - if __machine_has wget; then - wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true - else - failed=true - fi - - if [ "$failed" = true ] && __machine_has curl; then - failed=false - curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true - fi - - if [ "$failed" = true ]; then - __error "Download failed: $remote_path" 1>&2 - return 1 - fi -} - -# -# main -# - -command="${1:-}" -shift - -while [[ $# -gt 0 ]]; do - case $1 in - -\?|-h|--help) - __usage --no-exit - exit 0 - ;; - -c|--channel|-Channel) - shift - channel="${1:-}" - [ -z "$channel" ] && __usage - ;; - --config-file|-ConfigFile) - shift - config_file="${1:-}" - [ -z "$config_file" ] && __usage - if [ ! -f "$config_file" ]; then - __error "Invalid value for --config-file. $config_file does not exist." - exit 1 - fi - ;; - -d|--dotnet-home|-DotNetHome) - shift - DOTNET_HOME="${1:-}" - [ -z "$DOTNET_HOME" ] && __usage - ;; - --path|-Path) - shift - repo_path="${1:-}" - [ -z "$repo_path" ] && __usage - ;; - -s|--tools-source|-ToolsSource) - shift - tools_source="${1:-}" - [ -z "$tools_source" ] && __usage - ;; - --tools-source-suffix|-ToolsSourceSuffix) - shift - tools_source_suffix="${1:-}" - [ -z "$tools_source_suffix" ] && __usage - ;; - -u|--update|-Update) - update=true - ;; - --verbose|-Verbose) - verbose=true - ;; - --) - shift - break - ;; - *) - break - ;; - esac - shift -done - -if ! __machine_has unzip; then - __error 'Missing required command: unzip' - exit 1 -fi - -if ! __machine_has curl && ! __machine_has wget; then - __error 'Missing required command. Either wget or curl is required.' - exit 1 -fi - -[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json" -if [ -f "$config_file" ]; then - if __machine_has jq ; then - if jq '.' "$config_file" >/dev/null ; then - config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")" - config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")" - else - __warn "$config_file is invalid JSON. Its settings will be ignored." - fi - elif __machine_has python ; then - if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then - config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")" - config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" - else - __warn "$config_file is invalid JSON. Its settings will be ignored." - fi - else - __warn 'Missing required command: jq or pyton. Could not parse the JSON file. Its settings will be ignored.' - fi - - [ ! -z "${config_channel:-}" ] && channel="$config_channel" - [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" -fi - -[ -z "$channel" ] && channel='dev' -[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' - -get_korebuild -set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" -invoke_korebuild_command "$command" "$@" diff --git a/samples/GenericHostSample/GenericHostSample.csproj b/samples/GenericHostSample/GenericHostSample.csproj deleted file mode 100644 index 83a4ea2fc7..0000000000 --- a/samples/GenericHostSample/GenericHostSample.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - netcoreapp2.1;net461 - GenericHostSample.ProgramHelloWorld - Exe - latest - - - - - - - - - - - - - - - - - diff --git a/samples/GenericHostSample/MyContainer.cs b/samples/GenericHostSample/MyContainer.cs deleted file mode 100644 index 11556a845e..0000000000 --- a/samples/GenericHostSample/MyContainer.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace GenericHostSample -{ - internal class MyContainer - { - } -} \ No newline at end of file diff --git a/samples/GenericHostSample/MyContainerFactory.cs b/samples/GenericHostSample/MyContainerFactory.cs deleted file mode 100644 index d4fd399d77..0000000000 --- a/samples/GenericHostSample/MyContainerFactory.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace GenericHostSample -{ - internal class MyContainerFactory : IServiceProviderFactory - { - public MyContainer CreateBuilder(IServiceCollection services) - { - return new MyContainer(); - } - - public IServiceProvider CreateServiceProvider(MyContainer containerBuilder) - { - throw new NotImplementedException(); - } - } -} \ No newline at end of file diff --git a/samples/GenericHostSample/MyServiceA.cs b/samples/GenericHostSample/MyServiceA.cs deleted file mode 100644 index d8f8c6f039..0000000000 --- a/samples/GenericHostSample/MyServiceA.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Hosting; - -namespace GenericHostSample -{ - public class MyServiceA : BackgroundService - { - protected override async Task ExecuteAsync(CancellationToken stoppingToken) - { - Console.WriteLine("MyServiceA is starting."); - - stoppingToken.Register(() => Console.WriteLine("MyServiceA is stopping.")); - - while (!stoppingToken.IsCancellationRequested) - { - Console.WriteLine("MyServiceA is doing background work."); - - await Task.Delay(TimeSpan.FromSeconds(5), stoppingToken); - } - - Console.WriteLine("MyServiceA background task is stopping."); - } - } -} diff --git a/samples/GenericHostSample/MyServiceB.cs b/samples/GenericHostSample/MyServiceB.cs deleted file mode 100644 index fbc231d1c1..0000000000 --- a/samples/GenericHostSample/MyServiceB.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Hosting; - -namespace GenericHostSample -{ - public class MyServiceB : IHostedService, IDisposable - { - private bool _stopping; - private Task _backgroundTask; - - public Task StartAsync(CancellationToken cancellationToken) - { - Console.WriteLine("MyServiceB is starting."); - _backgroundTask = BackgroundTask(); - return Task.CompletedTask; - } - - private async Task BackgroundTask() - { - while (!_stopping) - { - await Task.Delay(TimeSpan.FromSeconds(7)); - Console.WriteLine("MyServiceB is doing background work."); - } - - Console.WriteLine("MyServiceB background task is stopping."); - } - - public async Task StopAsync(CancellationToken cancellationToken) - { - Console.WriteLine("MyServiceB is stopping."); - _stopping = true; - if (_backgroundTask != null) - { - // TODO: cancellation - await _backgroundTask; - } - } - - public void Dispose() - { - Console.WriteLine("MyServiceB is disposing."); - } - } -} diff --git a/samples/GenericHostSample/ProgramExternallyControlled.cs b/samples/GenericHostSample/ProgramExternallyControlled.cs deleted file mode 100644 index 7691b73ef2..0000000000 --- a/samples/GenericHostSample/ProgramExternallyControlled.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace GenericHostSample -{ - public class ProgramExternallyControlled - { - private IHost _host; - - public ProgramExternallyControlled() - { - _host = new HostBuilder() - .UseServiceProviderFactory(new MyContainerFactory()) - .ConfigureContainer((hostContext, container) => - { - }) - .ConfigureAppConfiguration((hostContext, config) => - { - config.AddEnvironmentVariables(); - config.AddJsonFile("appsettings.json", optional: true); - }) - .ConfigureServices((hostContext, services) => - { - services.AddHostedService(); - services.AddHostedService(); - }) - .Build(); - } - - public void Start() - { - _host.Start(); - } - - public async Task StopAsync() - { - await _host.StopAsync(TimeSpan.FromSeconds(5)); - _host.Dispose(); - } - } -} diff --git a/samples/GenericHostSample/ProgramFullControl.cs b/samples/GenericHostSample/ProgramFullControl.cs deleted file mode 100644 index e94477e003..0000000000 --- a/samples/GenericHostSample/ProgramFullControl.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace GenericHostSample -{ - public class ProgramFullControl - { - public static async Task Main(string[] args) - { - var host = new HostBuilder() - .UseServiceProviderFactory(new MyContainerFactory()) - .ConfigureContainer((hostContext, container) => - { - }) - .ConfigureAppConfiguration((hostContext, config) => - { - config.AddEnvironmentVariables(); - config.AddJsonFile("appsettings.json", optional: true); - config.AddCommandLine(args); - }) - .ConfigureServices((hostContext, services) => - { - services.AddHostedService(); - services.AddHostedService(); - }) - .Build(); - - var s = host.Services; - - using (host) - { - Console.WriteLine("Starting!"); - - await host.StartAsync(); - - Console.WriteLine("Started! Press to stop."); - - Console.ReadLine(); - - Console.WriteLine("Stopping!"); - - await host.StopAsync(); - - Console.WriteLine("Stopped!"); - } - } - } -} diff --git a/samples/GenericHostSample/ProgramHelloWorld.cs b/samples/GenericHostSample/ProgramHelloWorld.cs deleted file mode 100644 index 3145c40773..0000000000 --- a/samples/GenericHostSample/ProgramHelloWorld.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace GenericHostSample -{ - public class ProgramHelloWorld - { - public static async Task Main(string[] args) - { - var builder = new HostBuilder() - .ConfigureServices((hostContext, services) => - { - services.AddHostedService(); - services.AddHostedService(); - }); - - await builder.RunConsoleAsync(); - } - } -} diff --git a/samples/GenericHostSample/ServiceBaseControlled.cs b/samples/GenericHostSample/ServiceBaseControlled.cs deleted file mode 100644 index 24f63f992d..0000000000 --- a/samples/GenericHostSample/ServiceBaseControlled.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if NET461 -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace GenericHostSample -{ - public class ServiceBaseControlled - { - public static async Task Main(string[] args) - { - var builder = new HostBuilder() - .ConfigureServices((hostContext, services) => - { - services.AddHostedService(); - services.AddHostedService(); - }); - - await builder.RunAsServiceAsync(); - } - } -} -#endif \ No newline at end of file diff --git a/samples/GenericHostSample/ServiceBaseLifetime.cs b/samples/GenericHostSample/ServiceBaseLifetime.cs deleted file mode 100644 index df5c8368e9..0000000000 --- a/samples/GenericHostSample/ServiceBaseLifetime.cs +++ /dev/null @@ -1,79 +0,0 @@ -#if NET461 -using System; -using System.ServiceProcess; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace GenericHostSample -{ - public static class ServiceBaseLifetimeHostExtensions - { - public static IHostBuilder UseServiceBaseLifetime(this IHostBuilder hostBuilder) - { - return hostBuilder.ConfigureServices((hostContext, services) => services.AddSingleton()); - } - - public static Task RunAsServiceAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default) - { - return hostBuilder.UseServiceBaseLifetime().Build().RunAsync(cancellationToken); - } - } - - public class ServiceBaseLifetime : ServiceBase, IHostLifetime - { - private TaskCompletionSource _delayStart = new TaskCompletionSource(); - - public ServiceBaseLifetime(IApplicationLifetime applicationLifetime) - { - ApplicationLifetime = applicationLifetime ?? throw new ArgumentNullException(nameof(applicationLifetime)); - } - - private IApplicationLifetime ApplicationLifetime { get; } - - public Task WaitForStartAsync(CancellationToken cancellationToken) - { - cancellationToken.Register(() => _delayStart.TrySetCanceled()); - ApplicationLifetime.ApplicationStopping.Register(Stop); - - new Thread(Run).Start(); // Otherwise this would block and prevent IHost.StartAsync from finishing. - return _delayStart.Task; - } - - private void Run() - { - try - { - Run(this); // This blocks until the service is stopped. - _delayStart.TrySetException(new InvalidOperationException("Stopped without starting")); - } - catch (Exception ex) - { - _delayStart.TrySetException(ex); - } - } - - public Task StopAsync(CancellationToken cancellationToken) - { - Stop(); - return Task.CompletedTask; - } - - // Called by base.Run when the service is ready to start. - protected override void OnStart(string[] args) - { - _delayStart.TrySetResult(null); - base.OnStart(args); - } - - // Called by base.Stop. This may be called multiple times by service Stop, ApplicationStopping, and StopAsync. - // That's OK because StopApplication uses a CancellationTokenSource and prevents any recursion. - protected override void OnStop() - { - ApplicationLifetime.StopApplication(); - base.OnStop(); - } - } -} -#endif \ No newline at end of file diff --git a/samples/GenericWebHost/GenericWebHost.csproj b/samples/GenericWebHost/GenericWebHost.csproj deleted file mode 100644 index 34abb4e990..0000000000 --- a/samples/GenericWebHost/GenericWebHost.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - Exe - netcoreapp2.1;net461 - latest - true - - - - - - - - - - - - - - diff --git a/samples/SampleStartups/SampleStartups.csproj b/samples/SampleStartups/SampleStartups.csproj deleted file mode 100644 index 52a90cdc3c..0000000000 --- a/samples/SampleStartups/SampleStartups.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netcoreapp2.1;net461 - SampleStartups.StartupInjection - exe - - - - - - - - - - - - diff --git a/src/Directory.Build.props b/src/Directory.Build.props deleted file mode 100644 index 4b89a431e7..0000000000 --- a/src/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/EnvironmentName.cs b/src/Hosting/Abstractions/src/EnvironmentName.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/EnvironmentName.cs rename to src/Hosting/Abstractions/src/EnvironmentName.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/HostingAbstractionsWebHostBuilderExtensions.cs b/src/Hosting/Abstractions/src/HostingAbstractionsWebHostBuilderExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/HostingAbstractionsWebHostBuilderExtensions.cs rename to src/Hosting/Abstractions/src/HostingAbstractionsWebHostBuilderExtensions.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/HostingEnvironmentExtensions.cs b/src/Hosting/Abstractions/src/HostingEnvironmentExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/HostingEnvironmentExtensions.cs rename to src/Hosting/Abstractions/src/HostingEnvironmentExtensions.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/HostingStartupAttribute.cs b/src/Hosting/Abstractions/src/HostingStartupAttribute.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/HostingStartupAttribute.cs rename to src/Hosting/Abstractions/src/HostingStartupAttribute.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs b/src/Hosting/Abstractions/src/IApplicationLifetime.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/IApplicationLifetime.cs rename to src/Hosting/Abstractions/src/IApplicationLifetime.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs b/src/Hosting/Abstractions/src/IHostingEnvironment.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingEnvironment.cs rename to src/Hosting/Abstractions/src/IHostingEnvironment.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingStartup.cs b/src/Hosting/Abstractions/src/IHostingStartup.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/IHostingStartup.cs rename to src/Hosting/Abstractions/src/IHostingStartup.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IStartup.cs b/src/Hosting/Abstractions/src/IStartup.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/IStartup.cs rename to src/Hosting/Abstractions/src/IStartup.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IStartupFilter.cs b/src/Hosting/Abstractions/src/IStartupFilter.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/IStartupFilter.cs rename to src/Hosting/Abstractions/src/IStartupFilter.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IWebHost.cs b/src/Hosting/Abstractions/src/IWebHost.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/IWebHost.cs rename to src/Hosting/Abstractions/src/IWebHost.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/IWebHostBuilder.cs b/src/Hosting/Abstractions/src/IWebHostBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/IWebHostBuilder.cs rename to src/Hosting/Abstractions/src/IWebHostBuilder.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/Internal/IStartupConfigureContainerFilter.cs b/src/Hosting/Abstractions/src/Internal/IStartupConfigureContainerFilter.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/Internal/IStartupConfigureContainerFilter.cs rename to src/Hosting/Abstractions/src/Internal/IStartupConfigureContainerFilter.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/Internal/IStartupConfigureServicesFilter.cs b/src/Hosting/Abstractions/src/Internal/IStartupConfigureServicesFilter.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/Internal/IStartupConfigureServicesFilter.cs rename to src/Hosting/Abstractions/src/Internal/IStartupConfigureServicesFilter.cs diff --git a/src/Hosting/Abstractions/src/Microsoft.AspNetCore.Hosting.Abstractions.csproj b/src/Hosting/Abstractions/src/Microsoft.AspNetCore.Hosting.Abstractions.csproj new file mode 100644 index 0000000000..a01be8ea3f --- /dev/null +++ b/src/Hosting/Abstractions/src/Microsoft.AspNetCore.Hosting.Abstractions.csproj @@ -0,0 +1,17 @@ + + + + ASP.NET Core hosting and startup abstractions for web applications. + netstandard2.0 + $(NoWarn);CS1591 + true + aspnetcore;hosting + + + + + + + + + diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/WebHostBuilderContext.cs b/src/Hosting/Abstractions/src/WebHostBuilderContext.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/WebHostBuilderContext.cs rename to src/Hosting/Abstractions/src/WebHostBuilderContext.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/WebHostDefaults.cs b/src/Hosting/Abstractions/src/WebHostDefaults.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/WebHostDefaults.cs rename to src/Hosting/Abstractions/src/WebHostDefaults.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/baseline.netcore.json b/src/Hosting/Abstractions/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Abstractions/baseline.netcore.json rename to src/Hosting/Abstractions/src/baseline.netcore.json diff --git a/src/Microsoft.AspNetCore.Hosting/Builder/ApplicationBuilderFactory.cs b/src/Hosting/Hosting/src/Builder/ApplicationBuilderFactory.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Builder/ApplicationBuilderFactory.cs rename to src/Hosting/Hosting/src/Builder/ApplicationBuilderFactory.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Builder/IApplicationBuilderFactory.cs b/src/Hosting/Hosting/src/Builder/IApplicationBuilderFactory.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Builder/IApplicationBuilderFactory.cs rename to src/Hosting/Hosting/src/Builder/IApplicationBuilderFactory.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs b/src/Hosting/Hosting/src/Internal/ApplicationLifetime.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/ApplicationLifetime.cs rename to src/Hosting/Hosting/src/Internal/ApplicationLifetime.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/AutoRequestServicesStartupFilter.cs b/src/Hosting/Hosting/src/Internal/AutoRequestServicesStartupFilter.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/AutoRequestServicesStartupFilter.cs rename to src/Hosting/Hosting/src/Internal/AutoRequestServicesStartupFilter.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/ConfigureBuilder.cs b/src/Hosting/Hosting/src/Internal/ConfigureBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/ConfigureBuilder.cs rename to src/Hosting/Hosting/src/Internal/ConfigureBuilder.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/ConfigureContainerBuilder.cs b/src/Hosting/Hosting/src/Internal/ConfigureContainerBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/ConfigureContainerBuilder.cs rename to src/Hosting/Hosting/src/Internal/ConfigureContainerBuilder.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/ConfigureServicesBuilder.cs b/src/Hosting/Hosting/src/Internal/ConfigureServicesBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/ConfigureServicesBuilder.cs rename to src/Hosting/Hosting/src/Internal/ConfigureServicesBuilder.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostedServiceExecutor.cs b/src/Hosting/Hosting/src/Internal/HostedServiceExecutor.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/HostedServiceExecutor.cs rename to src/Hosting/Hosting/src/Internal/HostedServiceExecutor.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingApplication.cs b/src/Hosting/Hosting/src/Internal/HostingApplication.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/HostingApplication.cs rename to src/Hosting/Hosting/src/Internal/HostingApplication.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingApplicationDiagnostics.cs b/src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/HostingApplicationDiagnostics.cs rename to src/Hosting/Hosting/src/Internal/HostingApplicationDiagnostics.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs b/src/Hosting/Hosting/src/Internal/HostingEnvironment.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironment.cs rename to src/Hosting/Hosting/src/Internal/HostingEnvironment.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironmentExtensions.cs b/src/Hosting/Hosting/src/Internal/HostingEnvironmentExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/HostingEnvironmentExtensions.cs rename to src/Hosting/Hosting/src/Internal/HostingEnvironmentExtensions.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingEventSource.cs b/src/Hosting/Hosting/src/Internal/HostingEventSource.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/HostingEventSource.cs rename to src/Hosting/Hosting/src/Internal/HostingEventSource.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingLoggerExtensions.cs b/src/Hosting/Hosting/src/Internal/HostingLoggerExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/HostingLoggerExtensions.cs rename to src/Hosting/Hosting/src/Internal/HostingLoggerExtensions.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingRequestFinishedLog.cs b/src/Hosting/Hosting/src/Internal/HostingRequestFinishedLog.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/HostingRequestFinishedLog.cs rename to src/Hosting/Hosting/src/Internal/HostingRequestFinishedLog.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/HostingRequestStartingLog.cs b/src/Hosting/Hosting/src/Internal/HostingRequestStartingLog.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/HostingRequestStartingLog.cs rename to src/Hosting/Hosting/src/Internal/HostingRequestStartingLog.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/LoggerEventIds.cs b/src/Hosting/Hosting/src/Internal/LoggerEventIds.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/LoggerEventIds.cs rename to src/Hosting/Hosting/src/Internal/LoggerEventIds.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/RequestServicesContainerMiddleware.cs b/src/Hosting/Hosting/src/Internal/RequestServicesContainerMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/RequestServicesContainerMiddleware.cs rename to src/Hosting/Hosting/src/Internal/RequestServicesContainerMiddleware.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/RequestServicesFeature.cs b/src/Hosting/Hosting/src/Internal/RequestServicesFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/RequestServicesFeature.cs rename to src/Hosting/Hosting/src/Internal/RequestServicesFeature.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/ServiceCollectionExtensions.cs b/src/Hosting/Hosting/src/Internal/ServiceCollectionExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/ServiceCollectionExtensions.cs rename to src/Hosting/Hosting/src/Internal/ServiceCollectionExtensions.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/StartupLoader.cs b/src/Hosting/Hosting/src/Internal/StartupLoader.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/StartupLoader.cs rename to src/Hosting/Hosting/src/Internal/StartupLoader.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/StartupMethods.cs b/src/Hosting/Hosting/src/Internal/StartupMethods.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/StartupMethods.cs rename to src/Hosting/Hosting/src/Internal/StartupMethods.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs b/src/Hosting/Hosting/src/Internal/WebHost.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/WebHost.cs rename to src/Hosting/Hosting/src/Internal/WebHost.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/WebHostOptions.cs b/src/Hosting/Hosting/src/Internal/WebHostOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/WebHostOptions.cs rename to src/Hosting/Hosting/src/Internal/WebHostOptions.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Internal/WebHostUtilities.cs b/src/Hosting/Hosting/src/Internal/WebHostUtilities.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Internal/WebHostUtilities.cs rename to src/Hosting/Hosting/src/Internal/WebHostUtilities.cs diff --git a/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj b/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj new file mode 100644 index 0000000000..627b36bbc2 --- /dev/null +++ b/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj @@ -0,0 +1,30 @@ + + + + ASP.NET Core hosting infrastructure and startup logic for web applications. + netstandard2.0 + $(NoWarn);CS1591 + true + aspnetcore;hosting + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Microsoft.AspNetCore.Hosting/Properties/AssemblyInfo.cs b/src/Hosting/Hosting/src/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Properties/AssemblyInfo.cs rename to src/Hosting/Hosting/src/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Properties/Resources.Designer.cs b/src/Hosting/Hosting/src/Properties/Resources.Designer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Properties/Resources.Designer.cs rename to src/Hosting/Hosting/src/Properties/Resources.Designer.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Resources.resx b/src/Hosting/Hosting/src/Resources.resx similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Resources.resx rename to src/Hosting/Hosting/src/Resources.resx diff --git a/src/Microsoft.AspNetCore.Hosting/Server/Features/ServerAddressesFeature.cs b/src/Hosting/Hosting/src/Server/Features/ServerAddressesFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Server/Features/ServerAddressesFeature.cs rename to src/Hosting/Hosting/src/Server/Features/ServerAddressesFeature.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Startup/ConventionBasedStartup.cs b/src/Hosting/Hosting/src/Startup/ConventionBasedStartup.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Startup/ConventionBasedStartup.cs rename to src/Hosting/Hosting/src/Startup/ConventionBasedStartup.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Startup/DelegateStartup.cs b/src/Hosting/Hosting/src/Startup/DelegateStartup.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Startup/DelegateStartup.cs rename to src/Hosting/Hosting/src/Startup/DelegateStartup.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPage.Designer.cs b/src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPage.Designer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPage.Designer.cs rename to src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPage.Designer.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPage.cshtml b/src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPage.cshtml similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPage.cshtml rename to src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPage.cshtml diff --git a/src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPage.css b/src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPage.css similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPage.css rename to src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPage.css diff --git a/src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPage.js b/src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPage.js similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPage.js rename to src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPage.js diff --git a/src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPageModel.cs b/src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPageModel.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Startup/ExceptionPage/Views/ErrorPageModel.cs rename to src/Hosting/Hosting/src/Startup/ExceptionPage/Views/ErrorPageModel.cs diff --git a/src/Microsoft.AspNetCore.Hosting/Startup/StartupBase.cs b/src/Hosting/Hosting/src/Startup/StartupBase.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/Startup/StartupBase.cs rename to src/Hosting/Hosting/src/Startup/StartupBase.cs diff --git a/src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs b/src/Hosting/Hosting/src/WebHostBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/WebHostBuilder.cs rename to src/Hosting/Hosting/src/WebHostBuilder.cs diff --git a/src/Microsoft.AspNetCore.Hosting/WebHostBuilderExtensions.cs b/src/Hosting/Hosting/src/WebHostBuilderExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/WebHostBuilderExtensions.cs rename to src/Hosting/Hosting/src/WebHostBuilderExtensions.cs diff --git a/src/Microsoft.AspNetCore.Hosting/WebHostExtensions.cs b/src/Hosting/Hosting/src/WebHostExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/WebHostExtensions.cs rename to src/Hosting/Hosting/src/WebHostExtensions.cs diff --git a/src/Microsoft.AspNetCore.Hosting/baseline.netcore.json b/src/Hosting/Hosting/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/baseline.netcore.json rename to src/Hosting/Hosting/src/baseline.netcore.json diff --git a/src/Microsoft.AspNetCore.Hosting/compiler/resources/GenericError.html b/src/Hosting/Hosting/src/compiler/resources/GenericError.html similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/compiler/resources/GenericError.html rename to src/Hosting/Hosting/src/compiler/resources/GenericError.html diff --git a/src/Microsoft.AspNetCore.Hosting/compiler/resources/GenericError_Exception.html b/src/Hosting/Hosting/src/compiler/resources/GenericError_Exception.html similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/compiler/resources/GenericError_Exception.html rename to src/Hosting/Hosting/src/compiler/resources/GenericError_Exception.html diff --git a/src/Microsoft.AspNetCore.Hosting/compiler/resources/GenericError_Footer.html b/src/Hosting/Hosting/src/compiler/resources/GenericError_Footer.html similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/compiler/resources/GenericError_Footer.html rename to src/Hosting/Hosting/src/compiler/resources/GenericError_Footer.html diff --git a/src/Microsoft.AspNetCore.Hosting/compiler/resources/GenericError_Message.html b/src/Hosting/Hosting/src/compiler/resources/GenericError_Message.html similarity index 100% rename from src/Microsoft.AspNetCore.Hosting/compiler/resources/GenericError_Message.html rename to src/Hosting/Hosting/src/compiler/resources/GenericError_Message.html diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/ConfigureBuilderTests.cs b/src/Hosting/Hosting/test/ConfigureBuilderTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/ConfigureBuilderTests.cs rename to src/Hosting/Hosting/test/ConfigureBuilderTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/CustomLoggerFactory.cs b/src/Hosting/Hosting/test/Fakes/CustomLoggerFactory.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/CustomLoggerFactory.cs rename to src/Hosting/Hosting/test/Fakes/CustomLoggerFactory.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/FakeOptions.cs b/src/Hosting/Hosting/test/Fakes/FakeOptions.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/FakeOptions.cs rename to src/Hosting/Hosting/test/Fakes/FakeOptions.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/FakeService.cs b/src/Hosting/Hosting/test/Fakes/FakeService.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/FakeService.cs rename to src/Hosting/Hosting/test/Fakes/FakeService.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFactoryService.cs b/src/Hosting/Hosting/test/Fakes/IFactoryService.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFactoryService.cs rename to src/Hosting/Hosting/test/Fakes/IFactoryService.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeEveryService.cs b/src/Hosting/Hosting/test/Fakes/IFakeEveryService.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeEveryService.cs rename to src/Hosting/Hosting/test/Fakes/IFakeEveryService.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeScopedService.cs b/src/Hosting/Hosting/test/Fakes/IFakeScopedService.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeScopedService.cs rename to src/Hosting/Hosting/test/Fakes/IFakeScopedService.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeService.cs b/src/Hosting/Hosting/test/Fakes/IFakeService.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeService.cs rename to src/Hosting/Hosting/test/Fakes/IFakeService.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeServiceInstance.cs b/src/Hosting/Hosting/test/Fakes/IFakeServiceInstance.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeServiceInstance.cs rename to src/Hosting/Hosting/test/Fakes/IFakeServiceInstance.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeSingletonService.cs b/src/Hosting/Hosting/test/Fakes/IFakeSingletonService.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeSingletonService.cs rename to src/Hosting/Hosting/test/Fakes/IFakeSingletonService.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeStartupCallback.cs b/src/Hosting/Hosting/test/Fakes/IFakeStartupCallback.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/IFakeStartupCallback.cs rename to src/Hosting/Hosting/test/Fakes/IFakeStartupCallback.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/INonexistentService.cs b/src/Hosting/Hosting/test/Fakes/INonexistentService.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/INonexistentService.cs rename to src/Hosting/Hosting/test/Fakes/INonexistentService.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/Startup.cs b/src/Hosting/Hosting/test/Fakes/Startup.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/Startup.cs rename to src/Hosting/Hosting/test/Fakes/Startup.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupBase.cs b/src/Hosting/Hosting/test/Fakes/StartupBase.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupBase.cs rename to src/Hosting/Hosting/test/Fakes/StartupBase.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupBoom.cs b/src/Hosting/Hosting/test/Fakes/StartupBoom.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupBoom.cs rename to src/Hosting/Hosting/test/Fakes/StartupBoom.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupCaseInsensitive.cs b/src/Hosting/Hosting/test/Fakes/StartupCaseInsensitive.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupCaseInsensitive.cs rename to src/Hosting/Hosting/test/Fakes/StartupCaseInsensitive.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupConfigureServicesThrows.cs b/src/Hosting/Hosting/test/Fakes/StartupConfigureServicesThrows.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupConfigureServicesThrows.cs rename to src/Hosting/Hosting/test/Fakes/StartupConfigureServicesThrows.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupConfigureThrows.cs b/src/Hosting/Hosting/test/Fakes/StartupConfigureThrows.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupConfigureThrows.cs rename to src/Hosting/Hosting/test/Fakes/StartupConfigureThrows.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupCtorThrows.cs b/src/Hosting/Hosting/test/Fakes/StartupCtorThrows.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupCtorThrows.cs rename to src/Hosting/Hosting/test/Fakes/StartupCtorThrows.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupNoServices.cs b/src/Hosting/Hosting/test/Fakes/StartupNoServices.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupNoServices.cs rename to src/Hosting/Hosting/test/Fakes/StartupNoServices.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupPrivateConfigure.cs b/src/Hosting/Hosting/test/Fakes/StartupPrivateConfigure.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupPrivateConfigure.cs rename to src/Hosting/Hosting/test/Fakes/StartupPrivateConfigure.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupStaticCtorThrows.cs b/src/Hosting/Hosting/test/Fakes/StartupStaticCtorThrows.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupStaticCtorThrows.cs rename to src/Hosting/Hosting/test/Fakes/StartupStaticCtorThrows.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupThrowTypeLoadException.cs b/src/Hosting/Hosting/test/Fakes/StartupThrowTypeLoadException.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupThrowTypeLoadException.cs rename to src/Hosting/Hosting/test/Fakes/StartupThrowTypeLoadException.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupTwoConfigureServices.cs b/src/Hosting/Hosting/test/Fakes/StartupTwoConfigureServices.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupTwoConfigureServices.cs rename to src/Hosting/Hosting/test/Fakes/StartupTwoConfigureServices.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupTwoConfigures.cs b/src/Hosting/Hosting/test/Fakes/StartupTwoConfigures.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupTwoConfigures.cs rename to src/Hosting/Hosting/test/Fakes/StartupTwoConfigures.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithConfigureServices.cs b/src/Hosting/Hosting/test/Fakes/StartupWithConfigureServices.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithConfigureServices.cs rename to src/Hosting/Hosting/test/Fakes/StartupWithConfigureServices.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithConfigureServicesNotResolved.cs b/src/Hosting/Hosting/test/Fakes/StartupWithConfigureServicesNotResolved.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithConfigureServicesNotResolved.cs rename to src/Hosting/Hosting/test/Fakes/StartupWithConfigureServicesNotResolved.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithHostingEnvironment.cs b/src/Hosting/Hosting/test/Fakes/StartupWithHostingEnvironment.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithHostingEnvironment.cs rename to src/Hosting/Hosting/test/Fakes/StartupWithHostingEnvironment.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithILoggerFactory.cs b/src/Hosting/Hosting/test/Fakes/StartupWithILoggerFactory.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithILoggerFactory.cs rename to src/Hosting/Hosting/test/Fakes/StartupWithILoggerFactory.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithNullConfigureServices.cs b/src/Hosting/Hosting/test/Fakes/StartupWithNullConfigureServices.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithNullConfigureServices.cs rename to src/Hosting/Hosting/test/Fakes/StartupWithNullConfigureServices.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithScopedServices.cs b/src/Hosting/Hosting/test/Fakes/StartupWithScopedServices.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithScopedServices.cs rename to src/Hosting/Hosting/test/Fakes/StartupWithScopedServices.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithServices.cs b/src/Hosting/Hosting/test/Fakes/StartupWithServices.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Fakes/StartupWithServices.cs rename to src/Hosting/Hosting/test/Fakes/StartupWithServices.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/HostingApplicationTests.cs b/src/Hosting/Hosting/test/HostingApplicationTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/HostingApplicationTests.cs rename to src/Hosting/Hosting/test/HostingApplicationTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/HostingEnvironmentExtensionsTests.cs b/src/Hosting/Hosting/test/HostingEnvironmentExtensionsTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/HostingEnvironmentExtensionsTests.cs rename to src/Hosting/Hosting/test/HostingEnvironmentExtensionsTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Internal/HostingEventSourceTests.cs b/src/Hosting/Hosting/test/Internal/HostingEventSourceTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Internal/HostingEventSourceTests.cs rename to src/Hosting/Hosting/test/Internal/HostingEventSourceTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Internal/HostingRequestStartLogTests.cs b/src/Hosting/Hosting/test/Internal/HostingRequestStartLogTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Internal/HostingRequestStartLogTests.cs rename to src/Hosting/Hosting/test/Internal/HostingRequestStartLogTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Internal/MyBadContainerFactory.cs b/src/Hosting/Hosting/test/Internal/MyBadContainerFactory.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Internal/MyBadContainerFactory.cs rename to src/Hosting/Hosting/test/Internal/MyBadContainerFactory.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Internal/MyContainer.cs b/src/Hosting/Hosting/test/Internal/MyContainer.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Internal/MyContainer.cs rename to src/Hosting/Hosting/test/Internal/MyContainer.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Internal/MyContainerFactory.cs b/src/Hosting/Hosting/test/Internal/MyContainerFactory.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/Internal/MyContainerFactory.cs rename to src/Hosting/Hosting/test/Internal/MyContainerFactory.cs diff --git a/src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj b/src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj new file mode 100644 index 0000000000..151a66777a --- /dev/null +++ b/src/Hosting/Hosting/test/Microsoft.AspNetCore.Hosting.Tests.csproj @@ -0,0 +1,22 @@ + + + + $(StandardTestTfms) + + + + + + + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/RequestServicesContainerMiddlewareTests.cs b/src/Hosting/Hosting/test/RequestServicesContainerMiddlewareTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/RequestServicesContainerMiddlewareTests.cs rename to src/Hosting/Hosting/test/RequestServicesContainerMiddlewareTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/StartupManagerTests.cs b/src/Hosting/Hosting/test/StartupManagerTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/StartupManagerTests.cs rename to src/Hosting/Hosting/test/StartupManagerTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/WebHostBuilderTests.cs b/src/Hosting/Hosting/test/WebHostBuilderTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/WebHostBuilderTests.cs rename to src/Hosting/Hosting/test/WebHostBuilderTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/WebHostConfigurationsTests.cs b/src/Hosting/Hosting/test/WebHostConfigurationsTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/WebHostConfigurationsTests.cs rename to src/Hosting/Hosting/test/WebHostConfigurationsTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/WebHostTests.cs b/src/Hosting/Hosting/test/WebHostTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/WebHostTests.cs rename to src/Hosting/Hosting/test/WebHostTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/testroot/TextFile.txt b/src/Hosting/Hosting/test/testroot/TextFile.txt similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/testroot/TextFile.txt rename to src/Hosting/Hosting/test/testroot/TextFile.txt diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/testroot/wwwroot/README b/src/Hosting/Hosting/test/testroot/wwwroot/README similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.Tests/testroot/wwwroot/README rename to src/Hosting/Hosting/test/testroot/wwwroot/README diff --git a/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/Features/IServerAddressesFeature.cs b/src/Hosting/Server.Abstractions/src/Features/IServerAddressesFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Server.Abstractions/Features/IServerAddressesFeature.cs rename to src/Hosting/Server.Abstractions/src/Features/IServerAddressesFeature.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/IHttpApplication.cs b/src/Hosting/Server.Abstractions/src/IHttpApplication.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Server.Abstractions/IHttpApplication.cs rename to src/Hosting/Server.Abstractions/src/IHttpApplication.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/IServer.cs b/src/Hosting/Server.Abstractions/src/IServer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Server.Abstractions/IServer.cs rename to src/Hosting/Server.Abstractions/src/IServer.cs diff --git a/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj b/src/Hosting/Server.Abstractions/src/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj similarity index 59% rename from src/Microsoft.AspNetCore.Hosting.Server.Abstractions/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj rename to src/Hosting/Server.Abstractions/src/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj index 2e9fa385c9..13896a3b2d 100644 --- a/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj +++ b/src/Hosting/Server.Abstractions/src/Microsoft.AspNetCore.Hosting.Server.Abstractions.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/src/Microsoft.AspNetCore.Hosting.Server.Abstractions/baseline.netcore.json b/src/Hosting/Server.Abstractions/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.Server.Abstractions/baseline.netcore.json rename to src/Hosting/Server.Abstractions/src/baseline.netcore.json diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/ApplicationType.cs b/src/Hosting/Server.IntegrationTesting/src/Common/ApplicationType.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/ApplicationType.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/ApplicationType.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs b/src/Hosting/Server.IntegrationTesting/src/Common/DeploymentParameters.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentParameters.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/DeploymentParameters.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentResult.cs b/src/Hosting/Server.IntegrationTesting/src/Common/DeploymentResult.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/DeploymentResult.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/DeploymentResult.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/HostingModel.cs b/src/Hosting/Server.IntegrationTesting/src/Common/HostingModel.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/HostingModel.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/HostingModel.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/LoggingHandler.cs b/src/Hosting/Server.IntegrationTesting/src/Common/LoggingHandler.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/LoggingHandler.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/LoggingHandler.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/ProcessLoggingExtensions.cs b/src/Hosting/Server.IntegrationTesting/src/Common/ProcessLoggingExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/ProcessLoggingExtensions.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/ProcessLoggingExtensions.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RetryHelper.cs b/src/Hosting/Server.IntegrationTesting/src/Common/RetryHelper.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RetryHelper.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/RetryHelper.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RuntimeArchitecture.cs b/src/Hosting/Server.IntegrationTesting/src/Common/RuntimeArchitecture.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RuntimeArchitecture.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/RuntimeArchitecture.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RuntimeFlavor.cs b/src/Hosting/Server.IntegrationTesting/src/Common/RuntimeFlavor.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/RuntimeFlavor.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/RuntimeFlavor.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/ServerType.cs b/src/Hosting/Server.IntegrationTesting/src/Common/ServerType.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/ServerType.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/ServerType.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/TestUriHelper.cs b/src/Hosting/Server.IntegrationTesting/src/Common/TestUriHelper.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Common/TestUriHelper.cs rename to src/Hosting/Server.IntegrationTesting/src/Common/TestUriHelper.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs b/src/Hosting/Server.IntegrationTesting/src/Deployers/ApplicationDeployer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployer.cs rename to src/Hosting/Server.IntegrationTesting/src/Deployers/ApplicationDeployer.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployerFactory.cs b/src/Hosting/Server.IntegrationTesting/src/Deployers/ApplicationDeployerFactory.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/ApplicationDeployerFactory.cs rename to src/Hosting/Server.IntegrationTesting/src/Deployers/ApplicationDeployerFactory.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IApplicationDeployer.cs b/src/Hosting/Server.IntegrationTesting/src/Deployers/IApplicationDeployer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IApplicationDeployer.cs rename to src/Hosting/Server.IntegrationTesting/src/Deployers/IApplicationDeployer.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs b/src/Hosting/Server.IntegrationTesting/src/Deployers/IISExpressDeployer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/IISExpressDeployer.cs rename to src/Hosting/Server.IntegrationTesting/src/Deployers/IISExpressDeployer.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/NginxDeployer.cs b/src/Hosting/Server.IntegrationTesting/src/Deployers/NginxDeployer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/NginxDeployer.cs rename to src/Hosting/Server.IntegrationTesting/src/Deployers/NginxDeployer.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/RemotePSSessionHelper.ps1 b/src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/RemotePSSessionHelper.ps1 similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/RemotePSSessionHelper.ps1 rename to src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/RemotePSSessionHelper.ps1 diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/RemoteWindowsDeployer.cs b/src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/RemoteWindowsDeployer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/RemoteWindowsDeployer.cs rename to src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/RemoteWindowsDeployer.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/RemoteWindowsDeploymentParameters.cs b/src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/RemoteWindowsDeploymentParameters.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/RemoteWindowsDeploymentParameters.cs rename to src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/RemoteWindowsDeploymentParameters.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/StartServer.ps1 b/src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/StartServer.ps1 similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/StartServer.ps1 rename to src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/StartServer.ps1 diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/StopServer.ps1 b/src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/StopServer.ps1 similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/RemoteWindowsDeployer/StopServer.ps1 rename to src/Hosting/Server.IntegrationTesting/src/Deployers/RemoteWindowsDeployer/StopServer.ps1 diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs b/src/Hosting/Server.IntegrationTesting/src/Deployers/SelfHostDeployer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Deployers/SelfHostDeployer.cs rename to src/Hosting/Server.IntegrationTesting/src/Deployers/SelfHostDeployer.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Microsoft.AspNetCore.Server.IntegrationTesting.csproj b/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj similarity index 51% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/Microsoft.AspNetCore.Server.IntegrationTesting.csproj rename to src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj index c38a2ded59..59e2f49cdc 100644 --- a/src/Microsoft.AspNetCore.Server.IntegrationTesting/Microsoft.AspNetCore.Server.IntegrationTesting.csproj +++ b/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj @@ -18,15 +18,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/baseline.netcore.json b/src/Hosting/Server.IntegrationTesting/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/baseline.netcore.json rename to src/Hosting/Server.IntegrationTesting/src/baseline.netcore.json diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/xunit/SkipIfEnvironmentVariableNotEnabled.cs b/src/Hosting/Server.IntegrationTesting/src/xunit/SkipIfEnvironmentVariableNotEnabled.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/xunit/SkipIfEnvironmentVariableNotEnabled.cs rename to src/Hosting/Server.IntegrationTesting/src/xunit/SkipIfEnvironmentVariableNotEnabled.cs diff --git a/src/Microsoft.AspNetCore.Server.IntegrationTesting/xunit/SkipOn32BitOSAttribute.cs b/src/Hosting/Server.IntegrationTesting/src/xunit/SkipOn32BitOSAttribute.cs similarity index 100% rename from src/Microsoft.AspNetCore.Server.IntegrationTesting/xunit/SkipOn32BitOSAttribute.cs rename to src/Hosting/Server.IntegrationTesting/src/xunit/SkipOn32BitOSAttribute.cs diff --git a/src/Microsoft.AspNetCore.TestHost/ClientHandler.cs b/src/Hosting/TestHost/src/ClientHandler.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/ClientHandler.cs rename to src/Hosting/TestHost/src/ClientHandler.cs diff --git a/src/Microsoft.AspNetCore.TestHost/HttpContextBuilder.cs b/src/Hosting/TestHost/src/HttpContextBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/HttpContextBuilder.cs rename to src/Hosting/TestHost/src/HttpContextBuilder.cs diff --git a/src/Microsoft.AspNetCore.TestHost/Microsoft.AspNetCore.TestHost.csproj b/src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj similarity index 77% rename from src/Microsoft.AspNetCore.TestHost/Microsoft.AspNetCore.TestHost.csproj rename to src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj index 92a0795d05..6b00e0767d 100644 --- a/src/Microsoft.AspNetCore.TestHost/Microsoft.AspNetCore.TestHost.csproj +++ b/src/Hosting/TestHost/src/Microsoft.AspNetCore.TestHost.csproj @@ -15,11 +15,8 @@ - - - - - + + diff --git a/src/Microsoft.AspNetCore.TestHost/Properties/AssemblyInfo.cs b/src/Hosting/TestHost/src/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/Properties/AssemblyInfo.cs rename to src/Hosting/TestHost/src/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNetCore.TestHost/RequestBuilder.cs b/src/Hosting/TestHost/src/RequestBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/RequestBuilder.cs rename to src/Hosting/TestHost/src/RequestBuilder.cs diff --git a/src/Microsoft.AspNetCore.TestHost/RequestFeature.cs b/src/Hosting/TestHost/src/RequestFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/RequestFeature.cs rename to src/Hosting/TestHost/src/RequestFeature.cs diff --git a/src/Microsoft.AspNetCore.TestHost/ResponseFeature.cs b/src/Hosting/TestHost/src/ResponseFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/ResponseFeature.cs rename to src/Hosting/TestHost/src/ResponseFeature.cs diff --git a/src/Microsoft.AspNetCore.TestHost/ResponseStream.cs b/src/Hosting/TestHost/src/ResponseStream.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/ResponseStream.cs rename to src/Hosting/TestHost/src/ResponseStream.cs diff --git a/src/Microsoft.AspNetCore.TestHost/TestServer.cs b/src/Hosting/TestHost/src/TestServer.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/TestServer.cs rename to src/Hosting/TestHost/src/TestServer.cs diff --git a/src/Microsoft.AspNetCore.TestHost/TestWebSocket.cs b/src/Hosting/TestHost/src/TestWebSocket.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/TestWebSocket.cs rename to src/Hosting/TestHost/src/TestWebSocket.cs diff --git a/src/Microsoft.AspNetCore.TestHost/WebHostBuilderExtensions.cs b/src/Hosting/TestHost/src/WebHostBuilderExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/WebHostBuilderExtensions.cs rename to src/Hosting/TestHost/src/WebHostBuilderExtensions.cs diff --git a/src/Microsoft.AspNetCore.TestHost/WebHostBuilderFactory.cs b/src/Hosting/TestHost/src/WebHostBuilderFactory.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/WebHostBuilderFactory.cs rename to src/Hosting/TestHost/src/WebHostBuilderFactory.cs diff --git a/src/Microsoft.AspNetCore.TestHost/WebSocketClient.cs b/src/Hosting/TestHost/src/WebSocketClient.cs similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/WebSocketClient.cs rename to src/Hosting/TestHost/src/WebSocketClient.cs diff --git a/src/Microsoft.AspNetCore.TestHost/baseline.netcore.json b/src/Hosting/TestHost/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.TestHost/baseline.netcore.json rename to src/Hosting/TestHost/src/baseline.netcore.json diff --git a/test/Microsoft.AspNetCore.TestHost.Tests/ClientHandlerTests.cs b/src/Hosting/TestHost/test/ClientHandlerTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.TestHost.Tests/ClientHandlerTests.cs rename to src/Hosting/TestHost/test/ClientHandlerTests.cs diff --git a/test/Microsoft.AspNetCore.TestHost.Tests/HttpContextBuilderTests.cs b/src/Hosting/TestHost/test/HttpContextBuilderTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.TestHost.Tests/HttpContextBuilderTests.cs rename to src/Hosting/TestHost/test/HttpContextBuilderTests.cs diff --git a/src/Hosting/TestHost/test/Microsoft.AspNetCore.TestHost.Tests.csproj b/src/Hosting/TestHost/test/Microsoft.AspNetCore.TestHost.Tests.csproj new file mode 100644 index 0000000000..51041799c4 --- /dev/null +++ b/src/Hosting/TestHost/test/Microsoft.AspNetCore.TestHost.Tests.csproj @@ -0,0 +1,12 @@ + + + + $(StandardTestTfms) + + + + + + + + diff --git a/test/Microsoft.AspNetCore.TestHost.Tests/RequestBuilderTests.cs b/src/Hosting/TestHost/test/RequestBuilderTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.TestHost.Tests/RequestBuilderTests.cs rename to src/Hosting/TestHost/test/RequestBuilderTests.cs diff --git a/test/Microsoft.AspNetCore.TestHost.Tests/ResponseFeatureTests.cs b/src/Hosting/TestHost/test/ResponseFeatureTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.TestHost.Tests/ResponseFeatureTests.cs rename to src/Hosting/TestHost/test/ResponseFeatureTests.cs diff --git a/test/Microsoft.AspNetCore.TestHost.Tests/TestClientTests.cs b/src/Hosting/TestHost/test/TestClientTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.TestHost.Tests/TestClientTests.cs rename to src/Hosting/TestHost/test/TestClientTests.cs diff --git a/test/Microsoft.AspNetCore.TestHost.Tests/TestServerTests.cs b/src/Hosting/TestHost/test/TestServerTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.TestHost.Tests/TestServerTests.cs rename to src/Hosting/TestHost/test/TestServerTests.cs diff --git a/src/Microsoft.AspNetCore.Hosting.WindowsServices/Microsoft.AspNetCore.Hosting.WindowsServices.csproj b/src/Hosting/WindowsServices/src/Microsoft.AspNetCore.Hosting.WindowsServices.csproj similarity index 73% rename from src/Microsoft.AspNetCore.Hosting.WindowsServices/Microsoft.AspNetCore.Hosting.WindowsServices.csproj rename to src/Hosting/WindowsServices/src/Microsoft.AspNetCore.Hosting.WindowsServices.csproj index db548cbbfa..0c4112a61c 100644 --- a/src/Microsoft.AspNetCore.Hosting.WindowsServices/Microsoft.AspNetCore.Hosting.WindowsServices.csproj +++ b/src/Hosting/WindowsServices/src/Microsoft.AspNetCore.Hosting.WindowsServices.csproj @@ -9,13 +9,13 @@ - + - + diff --git a/src/Microsoft.AspNetCore.Hosting.WindowsServices/WebHostService.cs b/src/Hosting/WindowsServices/src/WebHostService.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.WindowsServices/WebHostService.cs rename to src/Hosting/WindowsServices/src/WebHostService.cs diff --git a/src/Microsoft.AspNetCore.Hosting.WindowsServices/WebHostWindowsServiceExtensions.cs b/src/Hosting/WindowsServices/src/WebHostWindowsServiceExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.WindowsServices/WebHostWindowsServiceExtensions.cs rename to src/Hosting/WindowsServices/src/WebHostWindowsServiceExtensions.cs diff --git a/src/Microsoft.AspNetCore.Hosting.WindowsServices/baseline.netcore.json b/src/Hosting/WindowsServices/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.WindowsServices/baseline.netcore.json rename to src/Hosting/WindowsServices/src/baseline.netcore.json diff --git a/src/Microsoft.AspNetCore.Hosting.WindowsServices/baseline.netframework.json b/src/Hosting/WindowsServices/src/baseline.netframework.json similarity index 100% rename from src/Microsoft.AspNetCore.Hosting.WindowsServices/baseline.netframework.json rename to src/Hosting/WindowsServices/src/baseline.netframework.json diff --git a/samples/GenericWebHost/FakeServer.cs b/src/Hosting/samples/GenericWebHost/FakeServer.cs similarity index 100% rename from samples/GenericWebHost/FakeServer.cs rename to src/Hosting/samples/GenericWebHost/FakeServer.cs diff --git a/src/Hosting/samples/GenericWebHost/GenericWebHost.csproj b/src/Hosting/samples/GenericWebHost/GenericWebHost.csproj new file mode 100644 index 0000000000..74f18791c8 --- /dev/null +++ b/src/Hosting/samples/GenericWebHost/GenericWebHost.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp2.1;net461 + latest + true + + + + + + + + + + + diff --git a/samples/GenericWebHost/Program.cs b/src/Hosting/samples/GenericWebHost/Program.cs similarity index 100% rename from samples/GenericWebHost/Program.cs rename to src/Hosting/samples/GenericWebHost/Program.cs diff --git a/samples/GenericWebHost/WebHostExtensions.cs b/src/Hosting/samples/GenericWebHost/WebHostExtensions.cs similarity index 100% rename from samples/GenericWebHost/WebHostExtensions.cs rename to src/Hosting/samples/GenericWebHost/WebHostExtensions.cs diff --git a/samples/GenericWebHost/WebHostService.cs b/src/Hosting/samples/GenericWebHost/WebHostService.cs similarity index 100% rename from samples/GenericWebHost/WebHostService.cs rename to src/Hosting/samples/GenericWebHost/WebHostService.cs diff --git a/samples/GenericWebHost/WebHostServiceOptions.cs b/src/Hosting/samples/GenericWebHost/WebHostServiceOptions.cs similarity index 100% rename from samples/GenericWebHost/WebHostServiceOptions.cs rename to src/Hosting/samples/GenericWebHost/WebHostServiceOptions.cs diff --git a/samples/SampleStartups/FakeServer.cs b/src/Hosting/samples/SampleStartups/FakeServer.cs similarity index 100% rename from samples/SampleStartups/FakeServer.cs rename to src/Hosting/samples/SampleStartups/FakeServer.cs diff --git a/src/Hosting/samples/SampleStartups/SampleStartups.csproj b/src/Hosting/samples/SampleStartups/SampleStartups.csproj new file mode 100644 index 0000000000..9c881e56e3 --- /dev/null +++ b/src/Hosting/samples/SampleStartups/SampleStartups.csproj @@ -0,0 +1,15 @@ + + + + netcoreapp2.1;net461 + SampleStartups.StartupInjection + exe + + + + + + + + + diff --git a/samples/SampleStartups/StartupBlockingOnStart.cs b/src/Hosting/samples/SampleStartups/StartupBlockingOnStart.cs similarity index 100% rename from samples/SampleStartups/StartupBlockingOnStart.cs rename to src/Hosting/samples/SampleStartups/StartupBlockingOnStart.cs diff --git a/samples/SampleStartups/StartupConfigureAddresses.cs b/src/Hosting/samples/SampleStartups/StartupConfigureAddresses.cs similarity index 100% rename from samples/SampleStartups/StartupConfigureAddresses.cs rename to src/Hosting/samples/SampleStartups/StartupConfigureAddresses.cs diff --git a/samples/SampleStartups/StartupExternallyControlled.cs b/src/Hosting/samples/SampleStartups/StartupExternallyControlled.cs similarity index 100% rename from samples/SampleStartups/StartupExternallyControlled.cs rename to src/Hosting/samples/SampleStartups/StartupExternallyControlled.cs diff --git a/samples/SampleStartups/StartupFullControl.cs b/src/Hosting/samples/SampleStartups/StartupFullControl.cs similarity index 100% rename from samples/SampleStartups/StartupFullControl.cs rename to src/Hosting/samples/SampleStartups/StartupFullControl.cs diff --git a/samples/SampleStartups/StartupHelloWorld.cs b/src/Hosting/samples/SampleStartups/StartupHelloWorld.cs similarity index 100% rename from samples/SampleStartups/StartupHelloWorld.cs rename to src/Hosting/samples/SampleStartups/StartupHelloWorld.cs diff --git a/samples/SampleStartups/StartupInjection.cs b/src/Hosting/samples/SampleStartups/StartupInjection.cs similarity index 100% rename from samples/SampleStartups/StartupInjection.cs rename to src/Hosting/samples/SampleStartups/StartupInjection.cs diff --git a/src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj b/src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj new file mode 100644 index 0000000000..3daae1c597 --- /dev/null +++ b/src/Hosting/test/FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj @@ -0,0 +1,17 @@ + + + + netcoreapp2.0 + + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.Hosting.FunctionalTests/Properties/AssemblyInfo.cs b/src/Hosting/test/FunctionalTests/Properties/AssemblyInfo.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.FunctionalTests/Properties/AssemblyInfo.cs rename to src/Hosting/test/FunctionalTests/Properties/AssemblyInfo.cs diff --git a/test/Microsoft.AspNetCore.Hosting.FunctionalTests/ShutdownTests.cs b/src/Hosting/test/FunctionalTests/ShutdownTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.FunctionalTests/ShutdownTests.cs rename to src/Hosting/test/FunctionalTests/ShutdownTests.cs diff --git a/test/Microsoft.AspNetCore.Hosting.FunctionalTests/WebHostBuilderTests.cs b/src/Hosting/test/FunctionalTests/WebHostBuilderTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.FunctionalTests/WebHostBuilderTests.cs rename to src/Hosting/test/FunctionalTests/WebHostBuilderTests.cs diff --git a/src/Hosting/test/WebHostBuilderFactory.Tests/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests.csproj b/src/Hosting/test/WebHostBuilderFactory.Tests/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests.csproj new file mode 100644 index 0000000000..95412eec30 --- /dev/null +++ b/src/Hosting/test/WebHostBuilderFactory.Tests/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests.csproj @@ -0,0 +1,22 @@ + + + + $(StandardTestTfms) + + + + + + + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests/WebHostFactoryResolverTests.cs b/src/Hosting/test/WebHostBuilderFactory.Tests/WebHostFactoryResolverTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests/WebHostFactoryResolverTests.cs rename to src/Hosting/test/WebHostBuilderFactory.Tests/WebHostFactoryResolverTests.cs diff --git a/src/Hosting/test/testassets/BuildWebHostInvalidSignature/BuildWebHostInvalidSignature.csproj b/src/Hosting/test/testassets/BuildWebHostInvalidSignature/BuildWebHostInvalidSignature.csproj new file mode 100644 index 0000000000..40bd0c87a3 --- /dev/null +++ b/src/Hosting/test/testassets/BuildWebHostInvalidSignature/BuildWebHostInvalidSignature.csproj @@ -0,0 +1,14 @@ + + + + netcoreapp2.1;netcoreapp2.0;net461 + Exe + + + + + + + + + diff --git a/test/TestAssets/BuildWebHostInvalidSignature/Program.cs b/src/Hosting/test/testassets/BuildWebHostInvalidSignature/Program.cs similarity index 100% rename from test/TestAssets/BuildWebHostInvalidSignature/Program.cs rename to src/Hosting/test/testassets/BuildWebHostInvalidSignature/Program.cs diff --git a/test/TestAssets/BuildWebHostInvalidSignature/Startup.cs b/src/Hosting/test/testassets/BuildWebHostInvalidSignature/Startup.cs similarity index 100% rename from test/TestAssets/BuildWebHostInvalidSignature/Startup.cs rename to src/Hosting/test/testassets/BuildWebHostInvalidSignature/Startup.cs diff --git a/src/Hosting/test/testassets/BuildWebHostPatternTestSite/BuildWebHostPatternTestSite.csproj b/src/Hosting/test/testassets/BuildWebHostPatternTestSite/BuildWebHostPatternTestSite.csproj new file mode 100644 index 0000000000..40bd0c87a3 --- /dev/null +++ b/src/Hosting/test/testassets/BuildWebHostPatternTestSite/BuildWebHostPatternTestSite.csproj @@ -0,0 +1,14 @@ + + + + netcoreapp2.1;netcoreapp2.0;net461 + Exe + + + + + + + + + diff --git a/test/TestAssets/BuildWebHostPatternTestSite/Program.cs b/src/Hosting/test/testassets/BuildWebHostPatternTestSite/Program.cs similarity index 100% rename from test/TestAssets/BuildWebHostPatternTestSite/Program.cs rename to src/Hosting/test/testassets/BuildWebHostPatternTestSite/Program.cs diff --git a/test/TestAssets/BuildWebHostPatternTestSite/Startup.cs b/src/Hosting/test/testassets/BuildWebHostPatternTestSite/Startup.cs similarity index 100% rename from test/TestAssets/BuildWebHostPatternTestSite/Startup.cs rename to src/Hosting/test/testassets/BuildWebHostPatternTestSite/Startup.cs diff --git a/src/Hosting/test/testassets/CreateWebHostBuilderInvalidSignature/CreateWebHostBuilderInvalidSignature.csproj b/src/Hosting/test/testassets/CreateWebHostBuilderInvalidSignature/CreateWebHostBuilderInvalidSignature.csproj new file mode 100644 index 0000000000..40bd0c87a3 --- /dev/null +++ b/src/Hosting/test/testassets/CreateWebHostBuilderInvalidSignature/CreateWebHostBuilderInvalidSignature.csproj @@ -0,0 +1,14 @@ + + + + netcoreapp2.1;netcoreapp2.0;net461 + Exe + + + + + + + + + diff --git a/test/TestAssets/CreateWebHostBuilderInvalidSignature/Program.cs b/src/Hosting/test/testassets/CreateWebHostBuilderInvalidSignature/Program.cs similarity index 100% rename from test/TestAssets/CreateWebHostBuilderInvalidSignature/Program.cs rename to src/Hosting/test/testassets/CreateWebHostBuilderInvalidSignature/Program.cs diff --git a/test/TestAssets/CreateWebHostBuilderInvalidSignature/Startup.cs b/src/Hosting/test/testassets/CreateWebHostBuilderInvalidSignature/Startup.cs similarity index 100% rename from test/TestAssets/CreateWebHostBuilderInvalidSignature/Startup.cs rename to src/Hosting/test/testassets/CreateWebHostBuilderInvalidSignature/Startup.cs diff --git a/src/Hosting/test/testassets/IStartupInjectionAssemblyName/IStartupInjectionAssemblyName.csproj b/src/Hosting/test/testassets/IStartupInjectionAssemblyName/IStartupInjectionAssemblyName.csproj new file mode 100644 index 0000000000..40bd0c87a3 --- /dev/null +++ b/src/Hosting/test/testassets/IStartupInjectionAssemblyName/IStartupInjectionAssemblyName.csproj @@ -0,0 +1,14 @@ + + + + netcoreapp2.1;netcoreapp2.0;net461 + Exe + + + + + + + + + diff --git a/test/TestAssets/IStartupInjectionAssemblyName/Program.cs b/src/Hosting/test/testassets/IStartupInjectionAssemblyName/Program.cs similarity index 100% rename from test/TestAssets/IStartupInjectionAssemblyName/Program.cs rename to src/Hosting/test/testassets/IStartupInjectionAssemblyName/Program.cs diff --git a/test/TestAssets/IStartupInjectionAssemblyName/Startup.cs b/src/Hosting/test/testassets/IStartupInjectionAssemblyName/Startup.cs similarity index 100% rename from test/TestAssets/IStartupInjectionAssemblyName/Startup.cs rename to src/Hosting/test/testassets/IStartupInjectionAssemblyName/Startup.cs diff --git a/src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj b/src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj new file mode 100644 index 0000000000..7b87b0eed5 --- /dev/null +++ b/src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp2.1;netcoreapp2.0;net461 + Exe + + + + + + + + + + + diff --git a/test/TestAssets/Microsoft.AspNetCore.Hosting.TestSites/Program.cs b/src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/Program.cs similarity index 100% rename from test/TestAssets/Microsoft.AspNetCore.Hosting.TestSites/Program.cs rename to src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/Program.cs diff --git a/test/TestAssets/Microsoft.AspNetCore.Hosting.TestSites/StartupShutdown.cs b/src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/StartupShutdown.cs similarity index 100% rename from test/TestAssets/Microsoft.AspNetCore.Hosting.TestSites/StartupShutdown.cs rename to src/Hosting/test/testassets/Microsoft.AspNetCore.Hosting.TestSites/StartupShutdown.cs diff --git a/test/TestAssets/TestStartupAssembly1/TestHostingStartup1.cs b/src/Hosting/test/testassets/TestStartupAssembly1/TestHostingStartup1.cs similarity index 100% rename from test/TestAssets/TestStartupAssembly1/TestHostingStartup1.cs rename to src/Hosting/test/testassets/TestStartupAssembly1/TestHostingStartup1.cs diff --git a/test/TestAssets/TestStartupAssembly1/TestStartupAssembly1.csproj b/src/Hosting/test/testassets/TestStartupAssembly1/TestStartupAssembly1.csproj similarity index 52% rename from test/TestAssets/TestStartupAssembly1/TestStartupAssembly1.csproj rename to src/Hosting/test/testassets/TestStartupAssembly1/TestStartupAssembly1.csproj index 5cf442c4ac..951d8c69e3 100644 --- a/test/TestAssets/TestStartupAssembly1/TestStartupAssembly1.csproj +++ b/src/Hosting/test/testassets/TestStartupAssembly1/TestStartupAssembly1.csproj @@ -5,7 +5,7 @@ - + \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Hosting.Abstractions/Microsoft.AspNetCore.Hosting.Abstractions.csproj b/src/Microsoft.AspNetCore.Hosting.Abstractions/Microsoft.AspNetCore.Hosting.Abstractions.csproj deleted file mode 100644 index a023842bcf..0000000000 --- a/src/Microsoft.AspNetCore.Hosting.Abstractions/Microsoft.AspNetCore.Hosting.Abstractions.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - ASP.NET Core hosting and startup abstractions for web applications. - netstandard2.0 - $(NoWarn);CS1591 - true - aspnetcore;hosting - - - - - - - - - - - - diff --git a/src/Microsoft.AspNetCore.Hosting/Microsoft.AspNetCore.Hosting.csproj b/src/Microsoft.AspNetCore.Hosting/Microsoft.AspNetCore.Hosting.csproj deleted file mode 100644 index 830ff401e9..0000000000 --- a/src/Microsoft.AspNetCore.Hosting/Microsoft.AspNetCore.Hosting.csproj +++ /dev/null @@ -1,33 +0,0 @@ - - - - ASP.NET Core hosting infrastructure and startup logic for web applications. - netstandard2.0 - $(NoWarn);CS1591 - true - aspnetcore;hosting - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/BackgroundService.cs b/src/Microsoft.Extensions.Hosting.Abstractions/BackgroundService.cs deleted file mode 100644 index 65b2bf7e84..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/BackgroundService.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// Base class for implementing a long running . - /// - public abstract class BackgroundService : IHostedService, IDisposable - { - private Task _executingTask; - private readonly CancellationTokenSource _stoppingCts = new CancellationTokenSource(); - - /// - /// This method is called when the starts. The implementation should return a task that represents - /// the lifetime of the long running operation(s) being performed. - /// - /// Triggered when is called. - /// A that represents the long running operations. - protected abstract Task ExecuteAsync(CancellationToken stoppingToken); - - /// - /// Triggered when the application host is ready to start the service. - /// - /// Indicates that the start process has been aborted. - public virtual Task StartAsync(CancellationToken cancellationToken) - { - // Store the task we're executing - _executingTask = ExecuteAsync(_stoppingCts.Token); - - // If the task is completed then return it, this will bubble cancellation and failure to the caller - if (_executingTask.IsCompleted) - { - return _executingTask; - } - - // Otherwise it's running - return Task.CompletedTask; - } - - /// - /// Triggered when the application host is performing a graceful shutdown. - /// - /// Indicates that the shutdown process should no longer be graceful. - public virtual async Task StopAsync(CancellationToken cancellationToken) - { - // Stop called without start - if (_executingTask == null) - { - return; - } - - try - { - // Signal cancellation to the executing method - _stoppingCts.Cancel(); - } - finally - { - // Wait until the task completes or the stop token triggers - await Task.WhenAny(_executingTask, Task.Delay(Timeout.Infinite, cancellationToken)); - } - - } - - public virtual void Dispose() - { - _stoppingCts.Cancel(); - } - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/EnvironmentName.cs b/src/Microsoft.Extensions.Hosting.Abstractions/EnvironmentName.cs deleted file mode 100644 index c3b18c5044..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/EnvironmentName.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting -{ - /// - /// Commonly used environment names. - /// - public static class EnvironmentName - { - public static readonly string Development = "Development"; - public static readonly string Staging = "Staging"; - public static readonly string Production = "Production"; - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/HostBuilderContext.cs b/src/Microsoft.Extensions.Hosting.Abstractions/HostBuilderContext.cs deleted file mode 100644 index b30d133ff4..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/HostBuilderContext.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Collections.Generic; -using Microsoft.Extensions.Configuration; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// Context containing the common services on the . Some properties may be null until set by the . - /// - public class HostBuilderContext - { - public HostBuilderContext(IDictionary properties) - { - Properties = properties ?? throw new System.ArgumentNullException(nameof(properties)); - } - - /// - /// The initialized by the . - /// - public IHostingEnvironment HostingEnvironment { get; set; } - - /// - /// The containing the merged configuration of the application and the . - /// - public IConfiguration Configuration { get; set; } - - /// - /// A central location for sharing state between components during the host building process. - /// - public IDictionary Properties { get; } - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/HostDefaults.cs b/src/Microsoft.Extensions.Hosting.Abstractions/HostDefaults.cs deleted file mode 100644 index e39be7330f..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/HostDefaults.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting -{ - /// - /// Constants for HostBuilder configuration keys. - /// - public static class HostDefaults - { - /// - /// The configuration key used to set . - /// - public static readonly string ApplicationKey = "applicationName"; - - /// - /// The configuration key used to set . - /// - public static readonly string EnvironmentKey = "environment"; - - /// - /// The configuration key used to set - /// and . - /// - public static readonly string ContentRootKey = "contentRoot"; - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/HostingAbstractionsHostBuilderExtensions.cs b/src/Microsoft.Extensions.Hosting.Abstractions/HostingAbstractionsHostBuilderExtensions.cs deleted file mode 100644 index 8b1c4d3494..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/HostingAbstractionsHostBuilderExtensions.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Threading; - -namespace Microsoft.Extensions.Hosting -{ - public static class HostingAbstractionsHostBuilderExtensions - { - /// - /// Start the host and listen on the specified urls. - /// - /// The to start. - /// The . - public static IHost Start(this IHostBuilder hostBuilder) - { - var host = hostBuilder.Build(); - host.StartAsync(CancellationToken.None).GetAwaiter().GetResult(); - return host; - } - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/HostingAbstractionsHostExtensions.cs b/src/Microsoft.Extensions.Hosting.Abstractions/HostingAbstractionsHostExtensions.cs deleted file mode 100644 index 1681e504bc..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/HostingAbstractionsHostExtensions.cs +++ /dev/null @@ -1,95 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; - -namespace Microsoft.Extensions.Hosting -{ - public static class HostingAbstractionsHostExtensions - { - /// - /// Starts the host synchronously. - /// - /// - public static void Start(this IHost host) - { - host.StartAsync().GetAwaiter().GetResult(); - } - - /// - /// Attempts to gracefully stop the host with the given timeout. - /// - /// - /// The timeout for stopping gracefully. Once expired the - /// server may terminate any remaining active connections. - /// - public static Task StopAsync(this IHost host, TimeSpan timeout) - { - return host.StopAsync(new CancellationTokenSource(timeout).Token); - } - - /// - /// Block the calling thread until shutdown is triggered via Ctrl+C or SIGTERM. - /// - /// The running . - public static void WaitForShutdown(this IHost host) - { - host.WaitForShutdownAsync().GetAwaiter().GetResult(); - } - - /// - /// Runs an application and block the calling thread until host shutdown. - /// - /// The to run. - public static void Run(this IHost host) - { - host.RunAsync().GetAwaiter().GetResult(); - } - - /// - /// Runs an application and returns a Task that only completes when the token is triggered or shutdown is triggered. - /// - /// The to run. - /// The token to trigger shutdown. - public static async Task RunAsync(this IHost host, CancellationToken token = default) - { - using (host) - { - await host.StartAsync(token); - - await host.WaitForShutdownAsync(token); - } - } - - /// - /// Returns a Task that completes when shutdown is triggered via the given token. - /// - /// The running . - /// The token to trigger shutdown. - public static async Task WaitForShutdownAsync(this IHost host, CancellationToken token = default) - { - var applicationLifetime = host.Services.GetService(); - - token.Register(state => - { - ((IApplicationLifetime)state).StopApplication(); - }, - applicationLifetime); - - var waitForStop = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - applicationLifetime.ApplicationStopping.Register(obj => - { - var tcs = (TaskCompletionSource)obj; - tcs.TrySetResult(null); - }, waitForStop); - - await waitForStop.Task; - - // Host will use its default ShutdownTimeout if none is specified. - await host.StopAsync(); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/HostingEnvironmentExtensions.cs b/src/Microsoft.Extensions.Hosting.Abstractions/HostingEnvironmentExtensions.cs deleted file mode 100644 index 1b1e49aa2f..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/HostingEnvironmentExtensions.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// Extension methods for . - /// - public static class HostingEnvironmentExtensions - { - /// - /// Checks if the current hosting environment name is . - /// - /// An instance of . - /// True if the environment name is , otherwise false. - public static bool IsDevelopment(this IHostingEnvironment hostingEnvironment) - { - if (hostingEnvironment == null) - { - throw new ArgumentNullException(nameof(hostingEnvironment)); - } - - return hostingEnvironment.IsEnvironment(EnvironmentName.Development); - } - - /// - /// Checks if the current hosting environment name is . - /// - /// An instance of . - /// True if the environment name is , otherwise false. - public static bool IsStaging(this IHostingEnvironment hostingEnvironment) - { - if (hostingEnvironment == null) - { - throw new ArgumentNullException(nameof(hostingEnvironment)); - } - - return hostingEnvironment.IsEnvironment(EnvironmentName.Staging); - } - - /// - /// Checks if the current hosting environment name is . - /// - /// An instance of . - /// True if the environment name is , otherwise false. - public static bool IsProduction(this IHostingEnvironment hostingEnvironment) - { - if (hostingEnvironment == null) - { - throw new ArgumentNullException(nameof(hostingEnvironment)); - } - - return hostingEnvironment.IsEnvironment(EnvironmentName.Production); - } - - /// - /// Compares the current hosting environment name against the specified value. - /// - /// An instance of . - /// Environment name to validate against. - /// True if the specified name is the same as the current environment, otherwise false. - public static bool IsEnvironment( - this IHostingEnvironment hostingEnvironment, - string environmentName) - { - if (hostingEnvironment == null) - { - throw new ArgumentNullException(nameof(hostingEnvironment)); - } - - return string.Equals( - hostingEnvironment.EnvironmentName, - environmentName, - StringComparison.OrdinalIgnoreCase); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/IApplicationLifetime.cs b/src/Microsoft.Extensions.Hosting.Abstractions/IApplicationLifetime.cs deleted file mode 100644 index 07f8249a26..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/IApplicationLifetime.cs +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Threading; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// Allows consumers to perform cleanup during a graceful shutdown. - /// - public interface IApplicationLifetime - { - /// - /// Triggered when the application host has fully started and is about to wait - /// for a graceful shutdown. - /// - CancellationToken ApplicationStarted { get; } - - /// - /// Triggered when the application host is performing a graceful shutdown. - /// Requests may still be in flight. Shutdown will block until this event completes. - /// - CancellationToken ApplicationStopping { get; } - - /// - /// Triggered when the application host is performing a graceful shutdown. - /// All requests should be complete at this point. Shutdown will block - /// until this event completes. - /// - CancellationToken ApplicationStopped { get; } - - /// - /// Requests termination of the current application. - /// - void StopApplication(); - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/IHost.cs b/src/Microsoft.Extensions.Hosting.Abstractions/IHost.cs deleted file mode 100644 index cd5a6b1c1d..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/IHost.cs +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// A program abstraction. - /// - public interface IHost : IDisposable - { - /// - /// The programs configured services. - /// - IServiceProvider Services { get; } - - /// - /// Start the program. - /// - /// Used to abort program start. - /// - Task StartAsync(CancellationToken cancellationToken = default); - - /// - /// Attempts to gracefully stop the program. - /// - /// Used to indicate when stop should no longer be graceful. - /// - Task StopAsync(CancellationToken cancellationToken = default); - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/IHostBuilder.cs b/src/Microsoft.Extensions.Hosting.Abstractions/IHostBuilder.cs deleted file mode 100644 index 66fbbea09f..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/IHostBuilder.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// A program initialization abstraction. - /// - public interface IHostBuilder - { - /// - /// A central location for sharing state between components during the host building process. - /// - IDictionary Properties { get; } - - /// - /// Set up the configuration for the builder itself. This will be used to initialize the - /// for use later in the build process. This can be called multiple times and the results will be additive. - /// - /// The delegate for configuring the that will be used - /// to construct the for the host. - /// The same instance of the for chaining. - IHostBuilder ConfigureHostConfiguration(Action configureDelegate); - - /// - /// Sets up the configuration for the remainder of the build process and application. This can be called multiple times and - /// the results will be additive. The results will be available at for - /// subsequent operations, as well as in . - /// - /// The delegate for configuring the that will be used - /// to construct the for the application. - /// The same instance of the for chaining. - IHostBuilder ConfigureAppConfiguration(Action configureDelegate); - - /// - /// Adds services to the container. This can be called multiple times and the results will be additive. - /// - /// The delegate for configuring the that will be used - /// to construct the . - /// The same instance of the for chaining. - IHostBuilder ConfigureServices(Action configureDelegate); - - /// - /// Overrides the factory used to create the service provider. - /// - /// - /// - /// The same instance of the for chaining. - IHostBuilder UseServiceProviderFactory(IServiceProviderFactory factory); - - /// - /// Enables configuring the instantiated dependency container. This can be called multiple times and - /// the results will be additive. - /// - /// - /// - /// The same instance of the for chaining. - IHostBuilder ConfigureContainer(Action configureDelegate); - - /// - /// Run the given actions to initialize the host. This can only be called once. - /// - /// An initialized - IHost Build(); - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/IHostLifetime.cs b/src/Microsoft.Extensions.Hosting.Abstractions/IHostLifetime.cs deleted file mode 100644 index 129fb44c8a..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/IHostLifetime.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Extensions.Hosting -{ - public interface IHostLifetime - { - /// - /// Called at the start of which will wait until it's compete before - /// continuing. This can be used to delay startup until signaled by an external event. - /// - Task WaitForStartAsync(CancellationToken cancellationToken); - - /// - /// Called from to indicate that the host as stopped and clean up resources. - /// - /// Used to indicate when stop should no longer be graceful. - /// - Task StopAsync(CancellationToken cancellationToken); - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/IHostedService.cs b/src/Microsoft.Extensions.Hosting.Abstractions/IHostedService.cs deleted file mode 100644 index bc83fd0f99..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/IHostedService.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// Defines methods for objects that are managed by the host. - /// - public interface IHostedService - { - /// - /// Triggered when the application host is ready to start the service. - /// - /// Indicates that the start process has been aborted. - Task StartAsync(CancellationToken cancellationToken); - - /// - /// Triggered when the application host is performing a graceful shutdown. - /// - /// Indicates that the shutdown process should no longer be graceful. - Task StopAsync(CancellationToken cancellationToken); - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/IHostingEnvironment.cs b/src/Microsoft.Extensions.Hosting.Abstractions/IHostingEnvironment.cs deleted file mode 100644 index e667a53285..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/IHostingEnvironment.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.Extensions.FileProviders; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// Provides information about the hosting environment an application is running in. - /// - public interface IHostingEnvironment - { - /// - /// Gets or sets the name of the environment. The host automatically sets this property to the value of the - /// of the "environment" key as specified in configuration. - /// - string EnvironmentName { get; set; } - - /// - /// Gets or sets the name of the application. This property is automatically set by the host to the assembly containing - /// the application entry point. - /// - string ApplicationName { get; set; } - - /// - /// Gets or sets the absolute path to the directory that contains the application content files. - /// - string ContentRootPath { get; set; } - - /// - /// Gets or sets an pointing at . - /// - IFileProvider ContentRootFileProvider { get; set; } - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/Microsoft.Extensions.Hosting.Abstractions.csproj b/src/Microsoft.Extensions.Hosting.Abstractions/Microsoft.Extensions.Hosting.Abstractions.csproj deleted file mode 100644 index 19024d2fee..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/Microsoft.Extensions.Hosting.Abstractions.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - .NET Core hosting and startup abstractions for applications. - netstandard2.0 - $(NoWarn);CS1591 - true - hosting - false - Microsoft.Extensions.Hosting - - - - - - - - - - diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/ServiceCollectionHostedServiceExtensions.cs b/src/Microsoft.Extensions.Hosting.Abstractions/ServiceCollectionHostedServiceExtensions.cs deleted file mode 100644 index 98bdbd333a..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/ServiceCollectionHostedServiceExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.Extensions.Hosting; - -namespace Microsoft.Extensions.DependencyInjection -{ - public static class ServiceCollectionHostedServiceExtensions - { - /// - /// Add an registration for the given type. - /// - /// An to register. - /// The to register with. - /// The original . - public static IServiceCollection AddHostedService(this IServiceCollection services) - where THostedService : class, IHostedService - => services.AddTransient(); - } -} diff --git a/src/Microsoft.Extensions.Hosting.Abstractions/baseline.netcore.json b/src/Microsoft.Extensions.Hosting.Abstractions/baseline.netcore.json deleted file mode 100644 index 02869ba4fa..0000000000 --- a/src/Microsoft.Extensions.Hosting.Abstractions/baseline.netcore.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.Extensions.Hosting.Abstractions, Version=2.0.2.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - { - "Name": "Microsoft.Extensions.Hosting.IHostedService", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "StartAsync", - "Parameters": [ - { - "Name": "cancellationToken", - "Type": "System.Threading.CancellationToken" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "StopAsync", - "Parameters": [ - { - "Name": "cancellationToken", - "Type": "System.Threading.CancellationToken" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "GenericParameter": [] - } - ], - "GenericParameters": [] - } - ] -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting/ConsoleLifetimeOptions.cs b/src/Microsoft.Extensions.Hosting/ConsoleLifetimeOptions.cs deleted file mode 100644 index e1aa9a1d4d..0000000000 --- a/src/Microsoft.Extensions.Hosting/ConsoleLifetimeOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting -{ - public class ConsoleLifetimeOptions - { - /// - /// Indicates if host lifetime status messages should be supressed such as on startup. - /// The default is false. - /// - public bool SuppressStatusMessages { get; set; } - } -} diff --git a/src/Microsoft.Extensions.Hosting/HostBuilder.cs b/src/Microsoft.Extensions.Hosting/HostBuilder.cs deleted file mode 100644 index bb6fdec478..0000000000 --- a/src/Microsoft.Extensions.Hosting/HostBuilder.cs +++ /dev/null @@ -1,206 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.FileProviders; -using Microsoft.Extensions.Hosting.Internal; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// A program initialization utility. - /// - public class HostBuilder : IHostBuilder - { - private List> _configureHostConfigActions = new List>(); - private List> _configureAppConfigActions = new List>(); - private List> _configureServicesActions = new List>(); - private List _configureContainerActions = new List(); - private IServiceFactoryAdapter _serviceProviderFactory = new ServiceFactoryAdapter(new DefaultServiceProviderFactory()); - private bool _hostBuilt; - private IConfiguration _hostConfiguration; - private IConfiguration _appConfiguration; - private HostBuilderContext _hostBuilderContext; - private IHostingEnvironment _hostingEnvironment; - private IServiceProvider _appServices; - - /// - /// A central location for sharing state between components during the host building process. - /// - public IDictionary Properties { get; } = new Dictionary(); - - /// - /// Set up the configuration for the builder itself. This will be used to initialize the - /// for use later in the build process. This can be called multiple times and the results will be additive. - /// - /// - /// The same instance of the for chaining. - public IHostBuilder ConfigureHostConfiguration(Action configureDelegate) - { - _configureHostConfigActions.Add(configureDelegate ?? throw new ArgumentNullException(nameof(configureDelegate))); - return this; - } - - /// - /// Sets up the configuration for the remainder of the build process and application. This can be called multiple times and - /// the results will be additive. The results will be available at for - /// subsequent operations, as well as in . - /// - /// - /// The same instance of the for chaining. - public IHostBuilder ConfigureAppConfiguration(Action configureDelegate) - { - _configureAppConfigActions.Add(configureDelegate ?? throw new ArgumentNullException(nameof(configureDelegate))); - return this; - } - - /// - /// Adds services to the container. This can be called multiple times and the results will be additive. - /// - /// - /// The same instance of the for chaining. - public IHostBuilder ConfigureServices(Action configureDelegate) - { - _configureServicesActions.Add(configureDelegate ?? throw new ArgumentNullException(nameof(configureDelegate))); - return this; - } - - /// - /// Overrides the factory used to create the service provider. - /// - /// - /// - /// The same instance of the for chaining. - public IHostBuilder UseServiceProviderFactory(IServiceProviderFactory factory) - { - _serviceProviderFactory = new ServiceFactoryAdapter(factory ?? throw new ArgumentNullException(nameof(factory))); - return this; - } - - /// - /// Enables configuring the instantiated dependency container. This can be called multiple times and - /// the results will be additive. - /// - /// - /// - /// The same instance of the for chaining. - public IHostBuilder ConfigureContainer(Action configureDelegate) - { - _configureContainerActions.Add(new ConfigureContainerAdapter(configureDelegate - ?? throw new ArgumentNullException(nameof(configureDelegate)))); - return this; - } - - /// - /// Run the given actions to initialize the host. This can only be called once. - /// - /// An initialized - public IHost Build() - { - if (_hostBuilt) - { - throw new InvalidOperationException("Build can only be called once."); - } - _hostBuilt = true; - - BuildHostConfiguration(); - CreateHostingEnvironment(); - CreateHostBuilderContext(); - BuildAppConfiguration(); - CreateServiceProvider(); - - return _appServices.GetRequiredService(); - } - - private void BuildHostConfiguration() - { - var configBuilder = new ConfigurationBuilder(); - foreach (var buildAction in _configureHostConfigActions) - { - buildAction(configBuilder); - } - _hostConfiguration = configBuilder.Build(); - } - - private void CreateHostingEnvironment() - { - _hostingEnvironment = new HostingEnvironment() - { - ApplicationName = _hostConfiguration[HostDefaults.ApplicationKey], - EnvironmentName = _hostConfiguration[HostDefaults.EnvironmentKey] ?? EnvironmentName.Production, - ContentRootPath = ResolveContentRootPath(_hostConfiguration[HostDefaults.ContentRootKey], AppContext.BaseDirectory), - }; - _hostingEnvironment.ContentRootFileProvider = new PhysicalFileProvider(_hostingEnvironment.ContentRootPath); - } - - private string ResolveContentRootPath(string contentRootPath, string basePath) - { - if (string.IsNullOrEmpty(contentRootPath)) - { - return basePath; - } - if (Path.IsPathRooted(contentRootPath)) - { - return contentRootPath; - } - return Path.Combine(Path.GetFullPath(basePath), contentRootPath); - } - - private void CreateHostBuilderContext() - { - _hostBuilderContext = new HostBuilderContext(Properties) - { - HostingEnvironment = _hostingEnvironment, - Configuration = _hostConfiguration - }; - } - - private void BuildAppConfiguration() - { - var configBuilder = new ConfigurationBuilder(); - configBuilder.AddConfiguration(_hostConfiguration); - foreach (var buildAction in _configureAppConfigActions) - { - buildAction(_hostBuilderContext, configBuilder); - } - _appConfiguration = configBuilder.Build(); - _hostBuilderContext.Configuration = _appConfiguration; - } - - private void CreateServiceProvider() - { - var services = new ServiceCollection(); - services.AddSingleton(_hostingEnvironment); - services.AddSingleton(_hostBuilderContext); - services.AddSingleton(_appConfiguration); - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - services.AddOptions(); - services.AddLogging(); - - foreach (var configureServicesAction in _configureServicesActions) - { - configureServicesAction(_hostBuilderContext, services); - } - - var containerBuilder = _serviceProviderFactory.CreateBuilder(services); - - foreach (var containerAction in _configureContainerActions) - { - containerAction.ConfigureContainer(_hostBuilderContext, containerBuilder); - } - - _appServices = _serviceProviderFactory.CreateServiceProvider(containerBuilder); - - if (_appServices == null) - { - throw new InvalidOperationException($"The IServiceProviderFactory returned a null IServiceProvider."); - } - } - } -} diff --git a/src/Microsoft.Extensions.Hosting/HostOptions.cs b/src/Microsoft.Extensions.Hosting/HostOptions.cs deleted file mode 100644 index 45fb9a187f..0000000000 --- a/src/Microsoft.Extensions.Hosting/HostOptions.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.Extensions.Hosting -{ - /// - /// Options for - /// - public class HostOptions - { - /// - /// The default timeout for . - /// - public TimeSpan ShutdownTimeout { get; set; } = TimeSpan.FromSeconds(5); - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting/HostingHostBuilderExtensions.cs b/src/Microsoft.Extensions.Hosting/HostingHostBuilderExtensions.cs deleted file mode 100644 index dcbfdb3c33..0000000000 --- a/src/Microsoft.Extensions.Hosting/HostingHostBuilderExtensions.cs +++ /dev/null @@ -1,133 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting.Internal; -using Microsoft.Extensions.Logging; - -namespace Microsoft.Extensions.Hosting -{ - public static class HostingHostBuilderExtensions - { - /// - /// Specify the environment to be used by the host. - /// - /// The to configure. - /// The environment to host the application in. - /// The . - public static IHostBuilder UseEnvironment(this IHostBuilder hostBuilder, string environment) - { - return hostBuilder.ConfigureHostConfiguration(configBuilder => - { - configBuilder.AddInMemoryCollection(new[] - { - new KeyValuePair(HostDefaults.EnvironmentKey, - environment ?? throw new ArgumentNullException(nameof(environment))) - }); - }); - } - - /// - /// Specify the content root directory to be used by the host. - /// - /// The to configure. - /// Path to root directory of the application. - /// The . - public static IHostBuilder UseContentRoot(this IHostBuilder hostBuilder, string contentRoot) - { - return hostBuilder.ConfigureHostConfiguration(configBuilder => - { - configBuilder.AddInMemoryCollection(new[] - { - new KeyValuePair(HostDefaults.ContentRootKey, - contentRoot ?? throw new ArgumentNullException(nameof(contentRoot))) - }); - }); - } - - /// - /// Adds a delegate for configuring the provided . This may be called multiple times. - /// - /// The to configure. - /// The delegate that configures the . - /// The same instance of the for chaining. - public static IHostBuilder ConfigureLogging(this IHostBuilder hostBuilder, Action configureLogging) - { - return hostBuilder.ConfigureServices((context, collection) => collection.AddLogging(builder => configureLogging(context, builder))); - } - - /// - /// Adds a delegate for configuring the provided . This may be called multiple times. - /// - /// The to configure. - /// The delegate that configures the . - /// The same instance of the for chaining. - public static IHostBuilder ConfigureLogging(this IHostBuilder hostBuilder, Action configureLogging) - { - return hostBuilder.ConfigureServices((context, collection) => collection.AddLogging(builder => configureLogging(builder))); - } - /// - /// Sets up the configuration for the remainder of the build process and application. This can be called multiple times and - /// the results will be additive. The results will be available at for - /// subsequent operations, as well as in . - /// - /// The to configure. - /// - /// The same instance of the for chaining. - public static IHostBuilder ConfigureAppConfiguration(this IHostBuilder hostBuilder, Action configureDelegate) - { - return hostBuilder.ConfigureAppConfiguration((context, builder) => configureDelegate(builder)); - } - - /// - /// Adds services to the container. This can be called multiple times and the results will be additive. - /// - /// The to configure. - /// - /// The same instance of the for chaining. - public static IHostBuilder ConfigureServices(this IHostBuilder hostBuilder, Action configureDelegate) - { - return hostBuilder.ConfigureServices((context, collection) => configureDelegate(collection)); - } - - /// - /// Enables configuring the instantiated dependency container. This can be called multiple times and - /// the results will be additive. - /// - /// - /// The to configure. - /// - /// The same instance of the for chaining. - public static IHostBuilder ConfigureContainer(this IHostBuilder hostBuilder, Action configureDelegate) - { - return hostBuilder.ConfigureContainer((context, builder) => configureDelegate(builder)); - } - - /// - /// Listens for Ctrl+C or SIGTERM and calls to start the shutdown process. - /// This will unblock extensions like RunAsync and WaitForShutdownAsync. - /// - /// The to configure. - /// The same instance of the for chaining. - public static IHostBuilder UseConsoleLifetime(this IHostBuilder hostBuilder) - { - return hostBuilder.ConfigureServices((context, collection) => collection.AddSingleton()); - } - - /// - /// Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down. - /// - /// The to configure. - /// - /// - public static Task RunConsoleAsync(this IHostBuilder hostBuilder, CancellationToken cancellationToken = default) - { - return hostBuilder.UseConsoleLifetime().Build().RunAsync(cancellationToken); - } - } -} diff --git a/src/Microsoft.Extensions.Hosting/Internal/ApplicationLifetime.cs b/src/Microsoft.Extensions.Hosting/Internal/ApplicationLifetime.cs deleted file mode 100644 index c9bb70415d..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/ApplicationLifetime.cs +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Threading; -using Microsoft.Extensions.Logging; - -namespace Microsoft.Extensions.Hosting.Internal -{ - /// - /// Allows consumers to perform cleanup during a graceful shutdown. - /// - public class ApplicationLifetime : IApplicationLifetime - { - private readonly CancellationTokenSource _startedSource = new CancellationTokenSource(); - private readonly CancellationTokenSource _stoppingSource = new CancellationTokenSource(); - private readonly CancellationTokenSource _stoppedSource = new CancellationTokenSource(); - private readonly ILogger _logger; - - public ApplicationLifetime(ILogger logger) - { - _logger = logger; - } - - /// - /// Triggered when the application host has fully started and is about to wait - /// for a graceful shutdown. - /// - public CancellationToken ApplicationStarted => _startedSource.Token; - - /// - /// Triggered when the application host is performing a graceful shutdown. - /// Request may still be in flight. Shutdown will block until this event completes. - /// - public CancellationToken ApplicationStopping => _stoppingSource.Token; - - /// - /// Triggered when the application host is performing a graceful shutdown. - /// All requests should be complete at this point. Shutdown will block - /// until this event completes. - /// - public CancellationToken ApplicationStopped => _stoppedSource.Token; - - /// - /// Signals the ApplicationStopping event and blocks until it completes. - /// - public void StopApplication() - { - // Lock on CTS to synchronize multiple calls to StopApplication. This guarantees that the first call - // to StopApplication and its callbacks run to completion before subsequent calls to StopApplication, - // which will no-op since the first call already requested cancellation, get a chance to execute. - lock (_stoppingSource) - { - try - { - ExecuteHandlers(_stoppingSource); - } - catch (Exception ex) - { - _logger.ApplicationError(LoggerEventIds.ApplicationStoppingException, - "An error occurred stopping the application", - ex); - } - } - } - - /// - /// Signals the ApplicationStarted event and blocks until it completes. - /// - public void NotifyStarted() - { - try - { - ExecuteHandlers(_startedSource); - } - catch (Exception ex) - { - _logger.ApplicationError(LoggerEventIds.ApplicationStartupException, - "An error occurred starting the application", - ex); - } - } - - /// - /// Signals the ApplicationStopped event and blocks until it completes. - /// - public void NotifyStopped() - { - try - { - ExecuteHandlers(_stoppedSource); - } - catch (Exception ex) - { - _logger.ApplicationError(LoggerEventIds.ApplicationStoppedException, - "An error occurred stopping the application", - ex); - } - } - - private void ExecuteHandlers(CancellationTokenSource cancel) - { - // Noop if this is already cancelled - if (cancel.IsCancellationRequested) - { - return; - } - - // Run the cancellation token callbacks - cancel.Cancel(throwOnFirstException: false); - } - } -} diff --git a/src/Microsoft.Extensions.Hosting/Internal/ConfigureContainerAdapter.cs b/src/Microsoft.Extensions.Hosting/Internal/ConfigureContainerAdapter.cs deleted file mode 100644 index 6b443b0e73..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/ConfigureContainerAdapter.cs +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.Extensions.Hosting.Internal -{ - internal class ConfigureContainerAdapter : IConfigureContainerAdapter - { - private Action _action; - - public ConfigureContainerAdapter(Action action) - { - _action = action ?? throw new ArgumentNullException(nameof(action)); - } - - public void ConfigureContainer(HostBuilderContext hostContext, object containerBuilder) - { - _action(hostContext, (TContainerBuilder)containerBuilder); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting/Internal/ConsoleLifetime.cs b/src/Microsoft.Extensions.Hosting/Internal/ConsoleLifetime.cs deleted file mode 100644 index 1e34d72741..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/ConsoleLifetime.cs +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Options; - -namespace Microsoft.Extensions.Hosting.Internal -{ - /// - /// Listens for Ctrl+C or SIGTERM and initiates shutdown. - /// - public class ConsoleLifetime : IHostLifetime, IDisposable - { - private readonly ManualResetEvent _shutdownBlock = new ManualResetEvent(false); - - public ConsoleLifetime(IOptions options, IHostingEnvironment environment, IApplicationLifetime applicationLifetime) - { - Options = options?.Value ?? throw new ArgumentNullException(nameof(options)); - Environment = environment ?? throw new ArgumentNullException(nameof(environment)); - ApplicationLifetime = applicationLifetime ?? throw new ArgumentNullException(nameof(applicationLifetime)); - } - - private ConsoleLifetimeOptions Options { get; } - - private IHostingEnvironment Environment { get; } - - private IApplicationLifetime ApplicationLifetime { get; } - - public Task WaitForStartAsync(CancellationToken cancellationToken) - { - if (!Options.SuppressStatusMessages) - { - ApplicationLifetime.ApplicationStarted.Register(() => - { - Console.WriteLine("Application started. Press Ctrl+C to shut down."); - Console.WriteLine($"Hosting environment: {Environment.EnvironmentName}"); - Console.WriteLine($"Content root path: {Environment.ContentRootPath}"); - }); - } - - AppDomain.CurrentDomain.ProcessExit += (sender, eventArgs) => - { - ApplicationLifetime.StopApplication(); - _shutdownBlock.WaitOne(); - }; - Console.CancelKeyPress += (sender, e) => - { - e.Cancel = true; - ApplicationLifetime.StopApplication(); - }; - - // Console applications start immediately. - return Task.CompletedTask; - } - - public Task StopAsync(CancellationToken cancellationToken) - { - // There's nothing to do here - return Task.CompletedTask; - } - - public void Dispose() - { - _shutdownBlock.Set(); - } - } -} diff --git a/src/Microsoft.Extensions.Hosting/Internal/Host.cs b/src/Microsoft.Extensions.Hosting/Internal/Host.cs deleted file mode 100644 index 451d0fb103..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/Host.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace Microsoft.Extensions.Hosting.Internal -{ - internal class Host : IHost - { - private readonly ILogger _logger; - private readonly IHostLifetime _hostLifetime; - private readonly ApplicationLifetime _applicationLifetime; - private readonly HostOptions _options; - private IEnumerable _hostedServices; - - public Host(IServiceProvider services, IApplicationLifetime applicationLifetime, ILogger logger, - IHostLifetime hostLifetime, IOptions options) - { - Services = services ?? throw new ArgumentNullException(nameof(services)); - _applicationLifetime = (applicationLifetime ?? throw new ArgumentNullException(nameof(applicationLifetime))) as ApplicationLifetime; - _logger = logger ?? throw new ArgumentNullException(nameof(logger)); - _hostLifetime = hostLifetime ?? throw new ArgumentNullException(nameof(hostLifetime)); - _options = options?.Value ?? throw new ArgumentNullException(nameof(options)); - } - - public IServiceProvider Services { get; } - - public async Task StartAsync(CancellationToken cancellationToken = default) - { - _logger.Starting(); - - await _hostLifetime.WaitForStartAsync(cancellationToken); - - cancellationToken.ThrowIfCancellationRequested(); - _hostedServices = Services.GetService>(); - - foreach (var hostedService in _hostedServices) - { - // Fire IHostedService.Start - await hostedService.StartAsync(cancellationToken).ConfigureAwait(false); - } - - // Fire IApplicationLifetime.Started - _applicationLifetime?.NotifyStarted(); - - _logger.Started(); - } - - public async Task StopAsync(CancellationToken cancellationToken = default) - { - _logger.Stopping(); - - using (var cts = new CancellationTokenSource(_options.ShutdownTimeout)) - using (var linkedCts = CancellationTokenSource.CreateLinkedTokenSource(cts.Token, cancellationToken)) - { - var token = linkedCts.Token; - // Trigger IApplicationLifetime.ApplicationStopping - _applicationLifetime?.StopApplication(); - - IList exceptions = new List(); - if (_hostedServices != null) // Started? - { - foreach (var hostedService in _hostedServices.Reverse()) - { - token.ThrowIfCancellationRequested(); - try - { - await hostedService.StopAsync(token).ConfigureAwait(false); - } - catch (Exception ex) - { - exceptions.Add(ex); - } - } - } - - token.ThrowIfCancellationRequested(); - await _hostLifetime.StopAsync(token); - - // Fire IApplicationLifetime.Stopped - _applicationLifetime?.NotifyStopped(); - - if (exceptions.Count > 0) - { - var ex = new AggregateException("One or more hosted services failed to stop.", exceptions); - _logger.StoppedWithException(ex); - throw ex; - } - } - - _logger.Stopped(); - } - - public void Dispose() - { - (Services as IDisposable)?.Dispose(); - } - } -} diff --git a/src/Microsoft.Extensions.Hosting/Internal/HostingEnvironment.cs b/src/Microsoft.Extensions.Hosting/Internal/HostingEnvironment.cs deleted file mode 100644 index 8227718eee..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/HostingEnvironment.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using Microsoft.Extensions.FileProviders; - -namespace Microsoft.Extensions.Hosting.Internal -{ - public class HostingEnvironment : IHostingEnvironment - { - public string EnvironmentName { get; set; } - - public string ApplicationName { get; set; } - - public string ContentRootPath { get; set; } - - public IFileProvider ContentRootFileProvider { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting/Internal/HostingLoggerExtensions.cs b/src/Microsoft.Extensions.Hosting/Internal/HostingLoggerExtensions.cs deleted file mode 100644 index ffc5c8288a..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/HostingLoggerExtensions.cs +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Globalization; -using System.Reflection; -using Microsoft.Extensions.Logging; - -namespace Microsoft.Extensions.Hosting.Internal -{ - internal static class HostingLoggerExtensions - { - public static void ApplicationError(this ILogger logger, EventId eventId, string message, Exception exception) - { - var reflectionTypeLoadException = exception as ReflectionTypeLoadException; - if (reflectionTypeLoadException != null) - { - foreach (var ex in reflectionTypeLoadException.LoaderExceptions) - { - message = message + Environment.NewLine + ex.Message; - } - } - - logger.LogCritical( - eventId: eventId, - message: message, - exception: exception); - } - - public static void Starting(this ILogger logger) - { - if (logger.IsEnabled(LogLevel.Debug)) - { - logger.LogDebug( - eventId: LoggerEventIds.Starting, - message: "Hosting starting"); - } - } - - public static void Started(this ILogger logger) - { - if (logger.IsEnabled(LogLevel.Debug)) - { - logger.LogDebug( - eventId: LoggerEventIds.Started, - message: "Hosting started"); - } - } - - public static void Stopping(this ILogger logger) - { - if (logger.IsEnabled(LogLevel.Debug)) - { - logger.LogDebug( - eventId: LoggerEventIds.Stopping, - message: "Hosting stopping"); - } - } - - public static void Stopped(this ILogger logger) - { - if (logger.IsEnabled(LogLevel.Debug)) - { - logger.LogDebug( - eventId: LoggerEventIds.Stopped, - message: "Hosting stopped"); - } - } - - public static void StoppedWithException(this ILogger logger, Exception ex) - { - if (logger.IsEnabled(LogLevel.Debug)) - { - logger.LogDebug( - eventId: LoggerEventIds.StoppedWithException, - exception: ex, - message: "Hosting shutdown exception"); - } - } - } -} - diff --git a/src/Microsoft.Extensions.Hosting/Internal/IConfigureContainerAdapter.cs b/src/Microsoft.Extensions.Hosting/Internal/IConfigureContainerAdapter.cs deleted file mode 100644 index b517137243..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/IConfigureContainerAdapter.cs +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting.Internal -{ - internal interface IConfigureContainerAdapter - { - void ConfigureContainer(HostBuilderContext hostContext, object containerBuilder); - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting/Internal/IServiceFactoryAdapter.cs b/src/Microsoft.Extensions.Hosting/Internal/IServiceFactoryAdapter.cs deleted file mode 100644 index ba409d6b46..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/IServiceFactoryAdapter.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Microsoft.Extensions.Hosting.Internal -{ - internal interface IServiceFactoryAdapter - { - object CreateBuilder(IServiceCollection services); - - IServiceProvider CreateServiceProvider(object containerBuilder); - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting/Internal/LoggerEventIds.cs b/src/Microsoft.Extensions.Hosting/Internal/LoggerEventIds.cs deleted file mode 100644 index 9ab9bdc6d0..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/LoggerEventIds.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting.Internal -{ - internal static class LoggerEventIds - { - public const int Starting = 1; - public const int Started = 2; - public const int Stopping = 3; - public const int Stopped = 4; - public const int StoppedWithException = 5; - public const int ApplicationStartupException = 6; - public const int ApplicationStoppingException = 7; - public const int ApplicationStoppedException = 8; - } -} diff --git a/src/Microsoft.Extensions.Hosting/Internal/ServiceFactoryAdapter.cs b/src/Microsoft.Extensions.Hosting/Internal/ServiceFactoryAdapter.cs deleted file mode 100644 index 39cca44c7e..0000000000 --- a/src/Microsoft.Extensions.Hosting/Internal/ServiceFactoryAdapter.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Microsoft.Extensions.Hosting.Internal -{ - internal class ServiceFactoryAdapter : IServiceFactoryAdapter - { - private IServiceProviderFactory _serviceProviderFactory; - - public ServiceFactoryAdapter(IServiceProviderFactory serviceProviderFactory) - { - _serviceProviderFactory = serviceProviderFactory ?? throw new System.ArgumentNullException(nameof(serviceProviderFactory)); - } - - public object CreateBuilder(IServiceCollection services) - { - return _serviceProviderFactory.CreateBuilder(services); - } - - public IServiceProvider CreateServiceProvider(object containerBuilder) - { - return _serviceProviderFactory.CreateServiceProvider((TContainerBuilder)containerBuilder); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Hosting/Microsoft.Extensions.Hosting.csproj b/src/Microsoft.Extensions.Hosting/Microsoft.Extensions.Hosting.csproj deleted file mode 100644 index 98b168421d..0000000000 --- a/src/Microsoft.Extensions.Hosting/Microsoft.Extensions.Hosting.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - .NET Core hosting and startup infrastructures for applications. - netstandard2.0 - $(NoWarn);CS1591 - true - hosting - false - - - - - - - - - - - - - - diff --git a/shared/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Sources/FactoryResolutionResult.cs b/src/Shared/Hosting.WebHostBuilderFactory/FactoryResolutionResult.cs similarity index 100% rename from shared/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Sources/FactoryResolutionResult.cs rename to src/Shared/Hosting.WebHostBuilderFactory/FactoryResolutionResult.cs diff --git a/shared/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Sources/FactoryResolutionResultKind.cs b/src/Shared/Hosting.WebHostBuilderFactory/FactoryResolutionResultKind.cs similarity index 100% rename from shared/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Sources/FactoryResolutionResultKind.cs rename to src/Shared/Hosting.WebHostBuilderFactory/FactoryResolutionResultKind.cs diff --git a/shared/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Sources/WebHostFactoryResolver.cs b/src/Shared/Hosting.WebHostBuilderFactory/WebHostFactoryResolver.cs similarity index 100% rename from shared/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Sources/WebHostFactoryResolver.cs rename to src/Shared/Hosting.WebHostBuilderFactory/WebHostFactoryResolver.cs diff --git a/test/Directory.Build.props b/test/Directory.Build.props deleted file mode 100644 index ffda45d379..0000000000 --- a/test/Directory.Build.props +++ /dev/null @@ -1,19 +0,0 @@ - - - - - netcoreapp2.1 - $(DeveloperBuildTestTfms) - $(StandardTestTfms);netcoreapp2.0 - $(StandardTestTfms);net461 - - - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.Hosting.FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj b/test/Microsoft.AspNetCore.Hosting.FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj deleted file mode 100644 index 8abf2de680..0000000000 --- a/test/Microsoft.AspNetCore.Hosting.FunctionalTests/Microsoft.AspNetCore.Hosting.FunctionalTests.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netcoreapp2.0 - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.Hosting.Tests/Microsoft.AspNetCore.Hosting.Tests.csproj b/test/Microsoft.AspNetCore.Hosting.Tests/Microsoft.AspNetCore.Hosting.Tests.csproj deleted file mode 100644 index 5b24d9e604..0000000000 --- a/test/Microsoft.AspNetCore.Hosting.Tests/Microsoft.AspNetCore.Hosting.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - $(StandardTestTfms) - - - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests.csproj b/test/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests.csproj deleted file mode 100644 index af6ea3865b..0000000000 --- a/test/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests/Microsoft.AspNetCore.Hosting.WebHostBuilderFactory.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - $(StandardTestTfms) - - - - - - - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.TestHost.Tests/Microsoft.AspNetCore.TestHost.Tests.csproj b/test/Microsoft.AspNetCore.TestHost.Tests/Microsoft.AspNetCore.TestHost.Tests.csproj deleted file mode 100644 index 25b877467c..0000000000 --- a/test/Microsoft.AspNetCore.TestHost.Tests/Microsoft.AspNetCore.TestHost.Tests.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - $(StandardTestTfms) - - - - - - - - - - - diff --git a/test/Microsoft.Extensions.Hosting.Tests/BackgroundHostedServiceTests.cs b/test/Microsoft.Extensions.Hosting.Tests/BackgroundHostedServiceTests.cs deleted file mode 100644 index 40b537fafb..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/BackgroundHostedServiceTests.cs +++ /dev/null @@ -1,171 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Xunit; - -namespace Microsoft.Extensions.Hosting.Tests -{ - public class BackgroundHostedServiceTests - { - [Fact] - public void StartReturnsCompletedTaskIfLongRunningTaskIsIncomplete() - { - var tcs = new TaskCompletionSource(); - var service = new MyBackgroundService(tcs.Task); - - var task = service.StartAsync(CancellationToken.None); - - Assert.True(task.IsCompleted); - Assert.False(tcs.Task.IsCompleted); - - // Complete the tsk - tcs.TrySetResult(null); - } - - [Fact] - public void StartReturnsCompletedTaskIfCancelled() - { - var tcs = new TaskCompletionSource(); - tcs.TrySetCanceled(); - var service = new MyBackgroundService(tcs.Task); - - var task = service.StartAsync(CancellationToken.None); - - Assert.True(task.IsCompleted); - } - - [Fact] - public async Task StartReturnsLongRunningTaskIfFailed() - { - var tcs = new TaskCompletionSource(); - tcs.TrySetException(new Exception("fail!")); - var service = new MyBackgroundService(tcs.Task); - - var exception = await Assert.ThrowsAsync(() => service.StartAsync(CancellationToken.None)); - - Assert.Equal("fail!", exception.Message); - } - - [Fact] - public async Task StopAsyncWithoutStartAsyncNoops() - { - var tcs = new TaskCompletionSource(); - var service = new MyBackgroundService(tcs.Task); - - await service.StopAsync(CancellationToken.None); - } - - [Fact] - public async Task StopAsyncStopsBackgroundService() - { - var tcs = new TaskCompletionSource(); - var service = new MyBackgroundService(tcs.Task); - - await service.StartAsync(CancellationToken.None); - - Assert.False(service.ExecuteTask.IsCompleted); - - await service.StopAsync(CancellationToken.None); - - Assert.True(service.ExecuteTask.IsCompleted); - } - - [Fact] - public async Task StopAsyncStopsEvenIfTaskNeverEnds() - { - var service = new IgnoreCancellationService(); - - await service.StartAsync(CancellationToken.None); - - var cts = new CancellationTokenSource(TimeSpan.FromSeconds(1)); - await service.StopAsync(cts.Token); - } - - [Fact] - public async Task StopAsyncThrowsIfCancellationCallbackThrows() - { - var service = new ThrowOnCancellationService(); - - await service.StartAsync(CancellationToken.None); - - var cts = new CancellationTokenSource(TimeSpan.FromSeconds(1)); - await Assert.ThrowsAsync(() => service.StopAsync(cts.Token)); - - Assert.Equal(2, service.TokenCalls); - } - - [Fact] - public async Task StartAsyncThenDisposeTriggersCancelledToken() - { - var service = new WaitForCancelledTokenService(); - - await service.StartAsync(CancellationToken.None); - - service.Dispose(); - } - - private class WaitForCancelledTokenService : BackgroundService - { - protected override Task ExecuteAsync(CancellationToken stoppingToken) - { - return Task.Delay(Timeout.Infinite, stoppingToken); - } - } - - private class ThrowOnCancellationService : BackgroundService - { - public int TokenCalls { get; set; } - - protected override Task ExecuteAsync(CancellationToken stoppingToken) - { - stoppingToken.Register(() => - { - TokenCalls++; - throw new InvalidOperationException(); - }); - - stoppingToken.Register(() => - { - TokenCalls++; - }); - - return new TaskCompletionSource().Task; - } - } - - private class IgnoreCancellationService : BackgroundService - { - protected override Task ExecuteAsync(CancellationToken stoppingToken) - { - return new TaskCompletionSource().Task; - } - } - - private class MyBackgroundService : BackgroundService - { - private readonly Task _task; - - public Task ExecuteTask { get; set; } - - public MyBackgroundService(Task task) - { - _task = task; - } - - protected override async Task ExecuteAsync(CancellationToken stoppingToken) - { - ExecuteTask = ExecuteCore(stoppingToken); - await ExecuteTask; - } - - private async Task ExecuteCore(CancellationToken stoppingToken) - { - var task = await Task.WhenAny(_task, Task.Delay(Timeout.Infinite, stoppingToken)); - - await task; - } - } - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeHostLifetime.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeHostLifetime.cs deleted file mode 100644 index 35ed57a9a2..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeHostLifetime.cs +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Extensions.Hosting.Tests.Fakes -{ - public class FakeHostLifetime : IHostLifetime - { - public int StartCount { get; internal set; } - public int StopCount { get; internal set; } - - public Action StartAction { get; set; } - public Action StopAction { get; set; } - - public Task WaitForStartAsync(CancellationToken cancellationToken) - { - StartCount++; - StartAction?.Invoke(cancellationToken); - return Task.CompletedTask; - } - - public Task StopAsync(CancellationToken cancellationToken) - { - StopCount++; - StopAction?.Invoke(); - return Task.CompletedTask; - } - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeHostedService.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeHostedService.cs deleted file mode 100644 index d867574269..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeHostedService.cs +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Extensions.Hosting.Tests.Fakes -{ - public class FakeHostedService : IHostedService, IDisposable - { - public int StartCount { get; internal set; } - public int StopCount { get; internal set; } - public int DisposeCount { get; internal set; } - - public Action StartAction { get; set; } - public Action StopAction { get; set; } - public Action DisposeAction { get; set; } - - public Task StartAsync(CancellationToken cancellationToken) - { - StartCount++; - StartAction?.Invoke(cancellationToken); - return Task.CompletedTask; - } - - public Task StopAsync(CancellationToken cancellationToken) - { - StopCount++; - StopAction?.Invoke(cancellationToken); - return Task.CompletedTask; - } - - public void Dispose() - { - DisposeCount++; - DisposeAction?.Invoke(); - } - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeOptions.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeOptions.cs deleted file mode 100644 index 730e1ed5b8..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeOptions.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting.Fakes -{ - public class FakeOptions - { - public bool Configured { get; set; } - public string Environment { get; set; } - public string Message { get; set; } - } -} \ No newline at end of file diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeService.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeService.cs deleted file mode 100644 index 3e24f22d7b..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeService.cs +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; - -namespace Microsoft.Extensions.Hosting.Fakes -{ - public class FakeService : IFakeEveryService, IDisposable - { - public bool Disposed { get; private set; } - - public void Dispose() - { - Disposed = true; - } - } -} \ No newline at end of file diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeServiceCollection.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeServiceCollection.cs deleted file mode 100644 index a0de90ef19..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeServiceCollection.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Microsoft.Extensions.Hosting.Fakes -{ - public class FakeServiceCollection : IServiceProvider - { - private IServiceProvider _inner; - private IServiceCollection _services; - - public bool FancyMethodCalled { get; private set; } - - public IServiceCollection Services => _services; - - public string State { get; set; } - - public object GetService(Type serviceType) - { - return _inner.GetService(serviceType); - } - - public void Populate(IServiceCollection services) - { - _services = services; - _services.AddSingleton(this); - } - - public void Build() - { - _inner = _services.BuildServiceProvider(); - } - - public void MyFancyContainerMethod() - { - FancyMethodCalled = true; - } - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeServiceProviderFactory.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeServiceProviderFactory.cs deleted file mode 100644 index 5e7b1db3b1..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/FakeServiceProviderFactory.cs +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using Microsoft.Extensions.DependencyInjection; - -namespace Microsoft.Extensions.Hosting.Fakes -{ - public class FakeServiceProviderFactory : IServiceProviderFactory - { - public FakeServiceCollection CreateBuilder(IServiceCollection services) - { - var container = new FakeServiceCollection(); - container.Populate(services); - return container; - } - - public IServiceProvider CreateServiceProvider(FakeServiceCollection containerBuilder) - { - containerBuilder.Build(); - return containerBuilder; - } - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeEveryService.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeEveryService.cs deleted file mode 100644 index 3e472caf8a..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeEveryService.cs +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting.Fakes -{ - interface IFakeEveryService : - IFakeScopedService, - IFakeServiceInstance, - IFakeSingletonService - { - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeScopedService.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeScopedService.cs deleted file mode 100644 index 945a748c6c..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeScopedService.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting.Fakes -{ - public interface IFakeScopedService : IFakeService - { - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeService.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeService.cs deleted file mode 100644 index b4489a6057..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeService.cs +++ /dev/null @@ -1,7 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting.Fakes -{ - public interface IFakeService { } -} \ No newline at end of file diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeServiceInstance.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeServiceInstance.cs deleted file mode 100644 index 479565bd1f..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeServiceInstance.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting.Fakes -{ - interface IFakeServiceInstance : IFakeService - { - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeSingletonService.cs b/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeSingletonService.cs deleted file mode 100644 index ae6e7e79a4..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Fakes/IFakeSingletonService.cs +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -namespace Microsoft.Extensions.Hosting.Fakes -{ - interface IFakeSingletonService : IFakeService - { - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/HostBuilderTests.cs b/test/Microsoft.Extensions.Hosting.Tests/HostBuilderTests.cs deleted file mode 100644 index 6296c815f1..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/HostBuilderTests.cs +++ /dev/null @@ -1,475 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.IO; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.FileProviders; -using Microsoft.Extensions.Hosting.Fakes; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Xunit; - -namespace Microsoft.Extensions.Hosting -{ - public class HostBuilderTests - { - [Fact] - public void ConfigureHostConfigurationPropagated() - { - var host = new HostBuilder() - .ConfigureHostConfiguration(configBuilder => - { - configBuilder.AddInMemoryCollection(new[] - { - new KeyValuePair("key1", "value1") - }); - }) - .ConfigureHostConfiguration(configBuilder => - { - configBuilder.AddInMemoryCollection(new[] - { - new KeyValuePair("key2", "value2") - }); - }) - .ConfigureHostConfiguration(configBuilder => - { - configBuilder.AddInMemoryCollection(new[] - { - // Hides value2 - new KeyValuePair("key2", "value3") - }); - }) - .ConfigureAppConfiguration((context, configBuilder) => - { - Assert.Equal("value1", context.Configuration["key1"]); - Assert.Equal("value3", context.Configuration["key2"]); - var config = configBuilder.Build(); - Assert.Equal("value1", config["key1"]); - Assert.Equal("value3", config["key2"]); - }) - .Build(); - - using (host) - { - var config = host.Services.GetRequiredService(); - Assert.Equal("value1", config["key1"]); - Assert.Equal("value3", config["key2"]); - } - } - - [Fact] - public void CanConfigureAppConfigurationAndRetrieveFromDI() - { - var hostBuilder = new HostBuilder() - .ConfigureAppConfiguration((configBuilder) => - { - configBuilder.AddInMemoryCollection( - new KeyValuePair[] - { - new KeyValuePair("key1", "value1") - }); - }) - .ConfigureAppConfiguration((configBuilder) => - { - configBuilder.AddInMemoryCollection( - new KeyValuePair[] - { - new KeyValuePair("key2", "value2") - }); - }) - .ConfigureAppConfiguration((configBuilder) => - { - configBuilder.AddInMemoryCollection( - new KeyValuePair[] - { - // Hides value2 - new KeyValuePair("key2", "value3") - }); - }); - - using (var host = hostBuilder.Build()) - { - var config = host.Services.GetService(); - Assert.NotNull(config); - Assert.Equal("value1", config["key1"]); - Assert.Equal("value3", config["key2"]); - } - } - - [Fact] - public void DefaultIHostingEnvironmentValues() - { - var hostBuilder = new HostBuilder() - .ConfigureAppConfiguration((hostContext, appConfig) => - { - var env = hostContext.HostingEnvironment; - Assert.Equal(EnvironmentName.Production, env.EnvironmentName); - Assert.Null(env.ApplicationName); - Assert.Equal(AppContext.BaseDirectory, env.ContentRootPath); - Assert.IsAssignableFrom(env.ContentRootFileProvider); - }); - - using (var host = hostBuilder.Build()) - { - var env = host.Services.GetRequiredService(); - Assert.Equal(EnvironmentName.Production, env.EnvironmentName); - Assert.Null(env.ApplicationName); - Assert.Equal(AppContext.BaseDirectory, env.ContentRootPath); - Assert.IsAssignableFrom(env.ContentRootFileProvider); - } - } - - [Fact] - public void ConfigBasedSettingsConfigBasedOverride() - { - var settings = new Dictionary - { - { HostDefaults.EnvironmentKey, "EnvA" } - }; - - var config = new ConfigurationBuilder() - .AddInMemoryCollection(settings) - .Build(); - - var overrideSettings = new Dictionary - { - { HostDefaults.EnvironmentKey, "EnvB" } - }; - - var overrideConfig = new ConfigurationBuilder() - .AddInMemoryCollection(overrideSettings) - .Build(); - - var hostBuilder = new HostBuilder() - .ConfigureHostConfiguration(configBuilder => configBuilder.AddConfiguration(config)) - .ConfigureHostConfiguration(configBuilder => configBuilder.AddConfiguration(overrideConfig)); - - using (var host = hostBuilder.Build()) - { - Assert.Equal("EnvB", host.Services.GetRequiredService().EnvironmentName); - } - } - - [Fact] - public void UseEnvironmentIsNotOverriden() - { - var vals = new Dictionary - { - { "ENV", "Dev" }, - }; - var builder = new ConfigurationBuilder() - .AddInMemoryCollection(vals); - var config = builder.Build(); - - var expected = "MY_TEST_ENVIRONMENT"; - - - using (var host = new HostBuilder() - .ConfigureHostConfiguration(configBuilder => configBuilder.AddConfiguration(config)) - .UseEnvironment(expected) - .Build()) - { - Assert.Equal(expected, host.Services.GetService().EnvironmentName); - } - } - - [Fact] - public void BuildAndDispose() - { - using (var host = new HostBuilder() - .Build()) { } - } - - [Fact] - public void UseBasePathConfiguresBasePath() - { - var vals = new Dictionary - { - { "ENV", "Dev" }, - }; - var builder = new ConfigurationBuilder() - .AddInMemoryCollection(vals); - var config = builder.Build(); - - using (var host = new HostBuilder() - .ConfigureHostConfiguration(configBuilder => configBuilder.AddConfiguration(config)) - .UseContentRoot("/") - .Build()) - { - Assert.Equal("/", host.Services.GetService().ContentRootPath); - } - } - - [Fact] - public void HostConfigParametersReadCorrectly() - { - var parameters = new Dictionary() - { - { "applicationName", "MyProjectReference"}, - { "environment", EnvironmentName.Development}, - { "contentRoot", Path.GetFullPath(".") } - }; - - var host = new HostBuilder() - .ConfigureHostConfiguration(config => - { - config.AddInMemoryCollection(parameters); - }).Build(); - - var env = host.Services.GetRequiredService(); - - Assert.Equal("MyProjectReference", env.ApplicationName); - Assert.Equal(EnvironmentName.Development, env.EnvironmentName); - Assert.Equal(Path.GetFullPath("."), env.ContentRootPath); - } - - [Fact] - public void RelativeContentRootIsResolved() - { - using (var host = new HostBuilder() - .UseContentRoot("testroot") - .Build()) - { - var basePath = host.Services.GetRequiredService().ContentRootPath; - Assert.True(Path.IsPathRooted(basePath)); - Assert.EndsWith(Path.DirectorySeparatorChar + "testroot", basePath); - } - } - - [Fact] - public void DefaultContentRootIsApplicationBasePath() - { - using (var host = new HostBuilder() - .Build()) - { - var appBase = AppContext.BaseDirectory; - Assert.Equal(appBase, host.Services.GetService().ContentRootPath); - } - } - - [Fact] - public void DefaultServicesAreAvailable() - { - using (var host = new HostBuilder() - .Build()) - { - Assert.NotNull(host.Services.GetRequiredService()); - Assert.NotNull(host.Services.GetRequiredService()); - Assert.NotNull(host.Services.GetRequiredService()); - Assert.NotNull(host.Services.GetRequiredService()); - Assert.NotNull(host.Services.GetRequiredService()); - Assert.NotNull(host.Services.GetRequiredService>()); - } - } - - [Fact] - public void DefaultCreatesLoggerFactory() - { - var hostBuilder = new HostBuilder(); - - using (var host = hostBuilder.Build()) - { - Assert.NotNull(host.Services.GetService()); - } - } - - [Fact] - public void MultipleConfigureLoggingInvokedInOrder() - { - var callCount = 0; //Verify ordering - var hostBuilder = new HostBuilder() - .ConfigureLogging((hostContext, loggerFactory) => - { - Assert.Equal(0, callCount++); - }) - .ConfigureLogging((hostContext, loggerFactory) => - { - Assert.Equal(1, callCount++); - }); - - using (hostBuilder.Build()) - { - Assert.Equal(2, callCount); - } - } - - [Fact] - public void HostingContextContainsAppConfigurationDuringConfigureServices() - { - var hostBuilder = new HostBuilder() - .ConfigureAppConfiguration((configBuilder) => - configBuilder.AddInMemoryCollection( - new KeyValuePair[] - { - new KeyValuePair("key1", "value1") - })) - .ConfigureServices((context, factory) => - { - Assert.Equal("value1", context.Configuration["key1"]); - }); - - using (hostBuilder.Build()) { } - } - - [Fact] - public void ConfigureDefaultServiceProvider() - { - var hostBuilder = new HostBuilder() - .ConfigureServices((s) => - { - s.AddTransient(); - s.AddScoped(); - }) - .UseServiceProviderFactory(new DefaultServiceProviderFactory(new ServiceProviderOptions() - { - ValidateScopes = true, - })); - var host = hostBuilder.Build(); - - Assert.Throws(() => { host.Services.GetRequiredService(); }); - } - - [Fact] - public void ConfigureCustomServiceProvider() - { - var hostBuilder = new HostBuilder() - .ConfigureServices((hostContext, s) => - { - s.AddTransient(); - s.AddScoped(); - }) - .UseServiceProviderFactory(new FakeServiceProviderFactory()) - .ConfigureContainer((container) => - { - Assert.Null(container.State); - container.State = "1"; - }) - .ConfigureContainer((container) => - { - Assert.Equal("1", container.State); - container.State = "2"; - }); - var host = hostBuilder.Build(); - var fakeServices = host.Services.GetRequiredService(); - Assert.Equal("2", fakeServices.State); - } - - [Fact] - public void CustomContainerTypeMismatchThrows() - { - var hostBuilder = new HostBuilder() - .ConfigureServices((s) => - { - s.AddTransient(); - s.AddScoped(); - }) - .UseServiceProviderFactory(new FakeServiceProviderFactory()) - .ConfigureContainer((container) => - { - }); - Assert.Throws(() => hostBuilder.Build()); - } - - [Fact] - public void HostingContextContainsAppConfigurationDuringConfigureLogging() - { - var hostBuilder = new HostBuilder() - .ConfigureAppConfiguration((configBuilder) => - configBuilder.AddInMemoryCollection( - new KeyValuePair[] - { - new KeyValuePair("key1", "value1") - })) - .ConfigureLogging((context, factory) => - { - Assert.Equal("value1", context.Configuration["key1"]); - }); - - using (hostBuilder.Build()) { } - } - - [Fact] - public void ConfigureServices_CanBeCalledMultipleTimes() - { - var callCount = 0; // Verify ordering - var hostBuilder = new HostBuilder() - .ConfigureServices((services) => - { - Assert.Equal(0, callCount++); - services.AddTransient(); - }) - .ConfigureServices((services) => - { - Assert.Equal(1, callCount++); - services.AddTransient(); - }); - - using (var host = hostBuilder.Build()) - { - Assert.Equal(2, callCount); - - Assert.NotNull(host.Services.GetRequiredService()); - Assert.NotNull(host.Services.GetRequiredService()); - } - } - - [Fact] - public void Build_DoesNotAllowBuildingMuiltipleTimes() - { - var builder = new HostBuilder(); - using (builder.Build()) - { - var ex = Assert.Throws(() => builder.Build()); - Assert.Equal("Build can only be called once.", ex.Message); - } - } - - [Fact] - public void SetsFullPathToContentRoot() - { - var host = new HostBuilder() - .ConfigureHostConfiguration(config => - { - config.AddInMemoryCollection(new[] - { - new KeyValuePair(HostDefaults.ContentRootKey, Path.GetFullPath(".")) - }); - }) - .Build(); - var env = host.Services.GetRequiredService(); - - Assert.Equal(Path.GetFullPath("."), env.ContentRootPath); - Assert.IsAssignableFrom(env.ContentRootFileProvider); - } - - [Fact] - public void BuilderPropertiesAreAvailableInBuilderAndContext() - { - var hostBuilder = new HostBuilder() - .ConfigureServices((hostContext, services) => - { - Assert.Equal("value", hostContext.Properties["key"]); - }); - - hostBuilder.Properties.Add("key", "value"); - - Assert.Equal("value", hostBuilder.Properties["key"]); - - using (hostBuilder.Build()) { } - } - - private class ServiceC - { - public ServiceC(ServiceD serviceD) { } - } - - internal class ServiceD { } - - internal class ServiceA { } - - internal class ServiceB { } - } -} diff --git a/test/Microsoft.Extensions.Hosting.Tests/HostTests.cs b/test/Microsoft.Extensions.Hosting.Tests/HostTests.cs deleted file mode 100644 index eaca45f5e8..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/HostTests.cs +++ /dev/null @@ -1,965 +0,0 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting.Fakes; -using Microsoft.Extensions.Hosting.Tests.Fakes; -using Microsoft.Extensions.Logging; -using Moq; -using Xunit; - -namespace Microsoft.Extensions.Hosting -{ - public class HostTests - { - [Fact] - public async Task HostInjectsHostingEnvironment() - { - using (var host = CreateBuilder() - .UseEnvironment("WithHostingEnvironment") - .Build()) - { - await host.StartAsync(); - var env = host.Services.GetService(); - Assert.Equal("WithHostingEnvironment", env.EnvironmentName); - } - } - - [Fact] - public void CanCreateApplicationServicesWithAddedServices() - { - using (var host = CreateBuilder().ConfigureServices((hostContext, services) => services.AddSingleton()).Build()) - { - Assert.NotNull(host.Services.GetRequiredService()); - } - } - - [Fact] - public void EnvDefaultsToProductionIfNoConfig() - { - using (var host = CreateBuilder().Build()) - { - var env = host.Services.GetService(); - Assert.Equal(EnvironmentName.Production, env.EnvironmentName); - } - } - - [Fact] - public void EnvDefaultsToConfigValueIfSpecified() - { - var vals = new Dictionary - { - { "Environment", EnvironmentName.Staging } - }; - - var builder = new ConfigurationBuilder() - .AddInMemoryCollection(vals); - var config = builder.Build(); - - using (var host = CreateBuilder(config).Build()) - { - var env = host.Services.GetService(); - Assert.Equal(EnvironmentName.Staging, env.EnvironmentName); - } - } - - [Fact] - public async Task IsEnvironment_Extension_Is_Case_Insensitive() - { - using (var host = CreateBuilder().Build()) - { - await host.StartAsync(); - var env = host.Services.GetRequiredService(); - Assert.True(env.IsEnvironment(EnvironmentName.Production)); - Assert.True(env.IsEnvironment("producTion")); - } - } - - [Fact] - public void HostCanBeStarted() - { - FakeHostedService service; - using (var host = CreateBuilder() - .ConfigureServices((hostContext, services) => - { - services.AddSingleton(); - }) - .Start()) - { - service = (FakeHostedService)host.Services.GetRequiredService(); - Assert.NotNull(host); - Assert.Equal(1, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(0, service.DisposeCount); - } - - Assert.Equal(1, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(1, service.DisposeCount); - } - - [Fact] - public void HostedServiceCanAcceptSingletonDependencies() - { - using (var host = CreateBuilder() - .ConfigureServices((hostContext, services) => - { - services.AddSingleton(); - services.AddHostedService(); - }) - .Start()) - { - } - } - - private class FakeHostedServiceWithDependency : IHostedService - { - public FakeHostedServiceWithDependency(IFakeService fakeService) - { - Assert.NotNull(fakeService); - } - - public Task StartAsync(CancellationToken cancellationToken) - { - return Task.CompletedTask; - } - - public Task StopAsync(CancellationToken cancellationToken) - { - return Task.CompletedTask; - } - } - - [Fact] - public async Task HostedServiceStartNotCalledIfHostNotStarted() - { - using (var host = CreateBuilder() - .ConfigureServices((hostContext, services) => - { - services.AddHostedService(); - }) - .Build()) - { - var lifetime = host.Services.GetRequiredService(); - lifetime.StopApplication(); - - var svc = (TestHostedService)host.Services.GetRequiredService(); - Assert.False(svc.StartCalled); - await host.StopAsync(); - Assert.False(svc.StopCalled); - host.Dispose(); - Assert.False(svc.StopCalled); - Assert.True(svc.DisposeCalled); - } - } - - [Fact] - public async Task HostCanBeStoppedWhenNotStarted() - { - using (var host = CreateBuilder() - .ConfigureServices((hostContext, services) => - { - services.AddHostedService(); - }) - .Build()) - { - var svc = (TestHostedService)host.Services.GetRequiredService(); - Assert.False(svc.StartCalled); - await host.StopAsync(); - Assert.False(svc.StopCalled); - host.Dispose(); - Assert.False(svc.StopCalled); - Assert.True(svc.DisposeCalled); - } - } - - [Fact] - public async Task AppCrashesOnStartWhenFirstHostedServiceThrows() - { - bool[] events1 = null; - bool[] events2 = null; - - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - events1 = RegisterCallbacksThatThrow(services); - events2 = RegisterCallbacksThatThrow(services); - }) - .Build()) - { - await Assert.ThrowsAsync(() => host.StartAsync()); - Assert.True(events1[0]); - Assert.False(events2[0]); - host.Dispose(); - // Stopping - Assert.False(events1[1]); - Assert.False(events2[1]); - } - } - - [Fact] - public async Task StartCanBeCancelled() - { - var serviceStarting = new ManualResetEvent(false); - var startCancelled = new ManualResetEvent(false); - FakeHostedService service; - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - services.AddSingleton(_ => new FakeHostedService() - { - StartAction = ct => - { - Assert.False(ct.IsCancellationRequested); - serviceStarting.Set(); - Assert.True(startCancelled.WaitOne(TimeSpan.FromSeconds(5))); - ct.ThrowIfCancellationRequested(); - } - }); - }) - .Build()) - { - var cts = new CancellationTokenSource(); - - var startTask = Task.Run(() => host.StartAsync(cts.Token)); - Assert.True(serviceStarting.WaitOne(TimeSpan.FromSeconds(5))); - cts.Cancel(); - startCancelled.Set(); - await Assert.ThrowsAsync(() => startTask); - - Assert.NotNull(host); - service = (FakeHostedService)host.Services.GetRequiredService(); - Assert.Equal(1, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(0, service.DisposeCount); - } - - Assert.Equal(1, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(1, service.DisposeCount); - } - - [Fact] - public async Task HostLifetimeOnStartedDelaysStart() - { - var serviceStarting = new ManualResetEvent(false); - var lifetimeStart = new ManualResetEvent(false); - var lifetimeContinue = new ManualResetEvent(false); - FakeHostedService service; - FakeHostLifetime lifetime; - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - services.AddSingleton(_ => new FakeHostedService() - { - StartAction = ct => - { - serviceStarting.Set(); - } - }); - services.AddSingleton(_ => new FakeHostLifetime() - { - StartAction = ct => - { - lifetimeStart.Set(); - Assert.True(lifetimeContinue.WaitOne(TimeSpan.FromSeconds(5))); - } - }); - }) - .Build()) - { - var startTask = Task.Run(() => host.StartAsync()); - Assert.True(lifetimeStart.WaitOne(TimeSpan.FromSeconds(5))); - Assert.False(serviceStarting.WaitOne(0)); - - lifetimeContinue.Set(); - Assert.True(serviceStarting.WaitOne(TimeSpan.FromSeconds(5))); - - await startTask; - - service = (FakeHostedService)host.Services.GetRequiredService(); - Assert.Equal(1, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(0, service.DisposeCount); - - lifetime = (FakeHostLifetime)host.Services.GetRequiredService(); - Assert.Equal(1, lifetime.StartCount); - Assert.Equal(0, lifetime.StopCount); - } - - Assert.Equal(1, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(1, service.DisposeCount); - - Assert.Equal(1, lifetime.StartCount); - Assert.Equal(0, lifetime.StopCount); - } - - [Fact] - public async Task HostLifetimeOnStartedCanBeCancelled() - { - var serviceStarting = new ManualResetEvent(false); - var lifetimeStart = new ManualResetEvent(false); - var lifetimeContinue = new ManualResetEvent(false); - FakeHostedService service; - FakeHostLifetime lifetime; - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - services.AddSingleton(_ => new FakeHostedService() - { - StartAction = ct => - { - serviceStarting.Set(); - } - }); - services.AddSingleton(_ => new FakeHostLifetime() - { - StartAction = ct => - { - lifetimeStart.Set(); - WaitHandle.WaitAny(new[] { lifetimeContinue, ct.WaitHandle }); - } - }); - }) - .Build()) - { - var cts = new CancellationTokenSource(); - - var startTask = Task.Run(() => host.StartAsync(cts.Token)); - - Assert.True(lifetimeStart.WaitOne(TimeSpan.FromSeconds(5))); - Assert.False(serviceStarting.WaitOne(0)); - - cts.Cancel(); - await Assert.ThrowsAsync(() => startTask); - Assert.False(serviceStarting.WaitOne(0)); - - lifetimeContinue.Set(); - Assert.False(serviceStarting.WaitOne(0)); - - Assert.NotNull(host); - service = (FakeHostedService)host.Services.GetRequiredService(); - Assert.Equal(0, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(0, service.DisposeCount); - - lifetime = (FakeHostLifetime)host.Services.GetRequiredService(); - Assert.Equal(1, lifetime.StartCount); - Assert.Equal(0, lifetime.StopCount); - } - - Assert.Equal(0, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(1, service.DisposeCount); - - Assert.Equal(1, lifetime.StartCount); - Assert.Equal(0, lifetime.StopCount); - } - - [Fact] - public async Task HostStopAsyncCallsHostLifetimeStopAsync() - { - FakeHostedService service; - FakeHostLifetime lifetime; - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - services.AddSingleton(); - services.AddSingleton(); - }) - .Build()) - { - await host.StartAsync(); - - service = (FakeHostedService)host.Services.GetRequiredService(); - Assert.Equal(1, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(0, service.DisposeCount); - - lifetime = (FakeHostLifetime)host.Services.GetRequiredService(); - Assert.Equal(1, lifetime.StartCount); - Assert.Equal(0, lifetime.StopCount); - - await host.StopAsync(); - - Assert.Equal(1, service.StartCount); - Assert.Equal(1, service.StopCount); - Assert.Equal(0, service.DisposeCount); - - Assert.Equal(1, lifetime.StartCount); - Assert.Equal(1, lifetime.StopCount); - } - - Assert.Equal(1, service.StartCount); - Assert.Equal(1, service.StopCount); - Assert.Equal(1, service.DisposeCount); - - Assert.Equal(1, lifetime.StartCount); - Assert.Equal(1, lifetime.StopCount); - } - - [Fact] - public async Task HostShutsDownWhenTokenTriggers() - { - FakeHostedService service; - using (var host = CreateBuilder() - .ConfigureServices((services) => services.AddSingleton()) - .Build()) - { - var lifetime = host.Services.GetRequiredService(); - service = (FakeHostedService)host.Services.GetRequiredService(); - - var cts = new CancellationTokenSource(); - - var runInBackground = host.RunAsync(cts.Token); - - // Wait on the host to be started - lifetime.ApplicationStarted.WaitHandle.WaitOne(); - - Assert.Equal(1, service.StartCount); - Assert.Equal(0, service.StopCount); - Assert.Equal(0, service.DisposeCount); - - cts.Cancel(); - - // Wait on the host to shutdown - lifetime.ApplicationStopped.WaitHandle.WaitOne(); - - // Wait for RunAsync to finish to guarantee Disposal of Host - await runInBackground; - - Assert.Equal(1, service.StopCount); - Assert.Equal(1, service.DisposeCount); - } - Assert.Equal(1, service.DisposeCount); - } - - [Fact] - public async Task HostStopAsyncCanBeCancelledEarly() - { - var service = new Mock(); - service.Setup(s => s.StopAsync(It.IsAny())) - .Returns(token => - { - return Task.Run(() => - { - token.WaitHandle.WaitOne(); - }); - }); - - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - services.AddSingleton(service.Object); - }) - .Build()) - { - await host.StartAsync(); - - var cts = new CancellationTokenSource(); - - var task = host.StopAsync(cts.Token); - cts.Cancel(); - - Assert.Equal(task, await Task.WhenAny(task, Task.Delay(TimeSpan.FromSeconds(5)))); - } - } - - [Fact] - public async Task HostStopAsyncUsesDefaultTimeoutIfGivenTokenDoesNotFire() - { - var service = new Mock(); - service.Setup(s => s.StopAsync(It.IsAny())) - .Returns(token => - { - return Task.Run(() => - { - token.WaitHandle.WaitOne(); - }); - }); - - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - services.Configure(options => options.ShutdownTimeout = TimeSpan.FromSeconds(0.5)); - services.AddSingleton(service.Object); - }) - .Build()) - { - await host.StartAsync(); - - var cts = new CancellationTokenSource(); - - // Purposefully don't trigger cts - var task = host.StopAsync(cts.Token); - - Assert.Equal(task, await Task.WhenAny(task, Task.Delay(TimeSpan.FromSeconds(10)))); - } - } - - [Fact] - public async Task WebHostStopAsyncUsesDefaultTimeoutIfNoTokenProvided() - { - var service = new Mock(); - service.Setup(s => s.StopAsync(It.IsAny())) - .Returns(token => - { - return Task.Run(() => - { - token.WaitHandle.WaitOne(); - }); - }); - - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - services.Configure(options => options.ShutdownTimeout = TimeSpan.FromSeconds(0.5)); - services.AddSingleton(service.Object); - }) - .Build()) - { - await host.StartAsync(); - - var task = host.StopAsync(); - - Assert.Equal(task, await Task.WhenAny(task, Task.Delay(TimeSpan.FromSeconds(10)))); - } - } - - [Fact] - public void HostApplicationLifetimeEventsOrderedCorrectlyDuringShutdown() - { - using (var host = CreateBuilder() - .Build()) - { - var lifetime = host.Services.GetRequiredService(); - var applicationStartedEvent = new ManualResetEventSlim(false); - var applicationStoppingEvent = new ManualResetEventSlim(false); - var applicationStoppedEvent = new ManualResetEventSlim(false); - var applicationStartedCompletedBeforeApplicationStopping = false; - var applicationStoppingCompletedBeforeApplicationStopped = false; - var applicationStoppedCompletedBeforeRunCompleted = false; - - lifetime.ApplicationStarted.Register(() => - { - applicationStartedEvent.Set(); - }); - - lifetime.ApplicationStopping.Register(() => - { - // Check whether the applicationStartedEvent has been set - applicationStartedCompletedBeforeApplicationStopping = applicationStartedEvent.IsSet; - - // Simulate work. - Thread.Sleep(1000); - - applicationStoppingEvent.Set(); - }); - - lifetime.ApplicationStopped.Register(() => - { - // Check whether the applicationStoppingEvent has been set - applicationStoppingCompletedBeforeApplicationStopped = applicationStoppingEvent.IsSet; - applicationStoppedEvent.Set(); - }); - - var runHostAndVerifyApplicationStopped = Task.Run(async () => - { - await host.RunAsync(); - // Check whether the applicationStoppingEvent has been set - applicationStoppedCompletedBeforeRunCompleted = applicationStoppedEvent.IsSet; - }); - - // Wait until application has started to shut down the host - Assert.True(applicationStartedEvent.Wait(5000)); - - // Trigger host shutdown on a separate thread - Task.Run(() => lifetime.StopApplication()); - - // Wait for all events and host.Run() to complete - Assert.True(runHostAndVerifyApplicationStopped.Wait(5000)); - - // Verify Ordering - Assert.True(applicationStartedCompletedBeforeApplicationStopping); - Assert.True(applicationStoppingCompletedBeforeApplicationStopped); - Assert.True(applicationStoppedCompletedBeforeRunCompleted); - } - } - - [Fact] - public async Task HostDisposesServiceProvider() - { - using (var host = CreateBuilder() - .ConfigureServices((s) => - { - s.AddTransient(); - s.AddSingleton(); - }) - .Build()) - { - await host.StartAsync(); - - var singleton = (FakeService)host.Services.GetService(); - var transient = (FakeService)host.Services.GetService(); - - Assert.False(singleton.Disposed); - Assert.False(transient.Disposed); - - await host.StopAsync(); - - Assert.False(singleton.Disposed); - Assert.False(transient.Disposed); - - host.Dispose(); - - Assert.True(singleton.Disposed); - Assert.True(transient.Disposed); - } - } - - [Fact] - public async Task HostNotifiesApplicationStarted() - { - using (var host = CreateBuilder() - .Build()) - { - var applicationLifetime = host.Services.GetService(); - - Assert.False(applicationLifetime.ApplicationStarted.IsCancellationRequested); - - await host.StartAsync(); - Assert.True(applicationLifetime.ApplicationStarted.IsCancellationRequested); - } - } - - [Fact] - public async Task HostNotifiesAllIApplicationLifetimeCallbacksEvenIfTheyThrow() - { - using (var host = CreateBuilder() - .Build()) - { - var applicationLifetime = host.Services.GetService(); - - var started = RegisterCallbacksThatThrow(applicationLifetime.ApplicationStarted); - var stopping = RegisterCallbacksThatThrow(applicationLifetime.ApplicationStopping); - var stopped = RegisterCallbacksThatThrow(applicationLifetime.ApplicationStopped); - - await host.StartAsync(); - Assert.True(applicationLifetime.ApplicationStarted.IsCancellationRequested); - Assert.True(started.All(s => s)); - await host.StopAsync(); - Assert.True(stopping.All(s => s)); - host.Dispose(); - Assert.True(stopped.All(s => s)); - } - } - - [Fact] - public async Task HostStopApplicationDoesNotFireStopOnHostedService() - { - var stoppingCalls = 0; - var disposingCalls = 0; - - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - Action started = () => - { - }; - - Action stopping = () => - { - stoppingCalls++; - }; - - Action disposing = () => - { - disposingCalls++; - }; - - services.AddSingleton(_ => new DelegateHostedService(started, stopping, disposing)); - }) - .Build()) - { - var lifetime = host.Services.GetRequiredService(); - lifetime.StopApplication(); - - await host.StartAsync(); - - Assert.Equal(0, stoppingCalls); - Assert.Equal(0, disposingCalls); - } - Assert.Equal(0, stoppingCalls); - Assert.Equal(1, disposingCalls); - } - - [Fact] - public async Task HostedServiceCanInjectApplicationLifetime() - { - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - services.AddSingleton(); - }) - .Build()) - { - var lifetime = host.Services.GetRequiredService(); - lifetime.StopApplication(); - - await host.StartAsync(); - var svc = (TestHostedService)host.Services.GetRequiredService(); - Assert.True(svc.StartCalled); - - await host.StopAsync(); - Assert.True(svc.StopCalled); - } - } - - [Fact] - public async Task HostStopApplicationFiresStopOnHostedService() - { - var stoppingCalls = 0; - var startedCalls = 0; - var disposingCalls = 0; - - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - Action started = () => - { - startedCalls++; - }; - - Action stopping = () => - { - stoppingCalls++; - }; - - Action disposing = () => - { - disposingCalls++; - }; - - services.AddSingleton(_ => new DelegateHostedService(started, stopping, disposing)); - }) - .Build()) - { - var lifetime = host.Services.GetRequiredService(); - - Assert.Equal(0, startedCalls); - - await host.StartAsync(); - Assert.Equal(1, startedCalls); - Assert.Equal(0, stoppingCalls); - Assert.Equal(0, disposingCalls); - - await host.StopAsync(); - - Assert.Equal(1, startedCalls); - Assert.Equal(1, stoppingCalls); - Assert.Equal(0, disposingCalls); - - host.Dispose(); - - Assert.Equal(1, startedCalls); - Assert.Equal(1, stoppingCalls); - Assert.Equal(1, disposingCalls); - } - } - - [Fact] - public async Task HostDisposeApplicationDoesNotFireStopOnHostedService() - { - var stoppingCalls = 0; - var startedCalls = 0; - var disposingCalls = 0; - - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - Action started = () => - { - startedCalls++; - }; - - Action stopping = () => - { - stoppingCalls++; - }; - - Action disposing = () => - { - disposingCalls++; - }; - - services.AddSingleton(_ => new DelegateHostedService(started, stopping, disposing)); - }) - .Build()) - { - var lifetime = host.Services.GetRequiredService(); - - Assert.Equal(0, startedCalls); - await host.StartAsync(); - Assert.Equal(1, startedCalls); - Assert.Equal(0, stoppingCalls); - Assert.Equal(0, disposingCalls); - host.Dispose(); - - Assert.Equal(0, stoppingCalls); - Assert.Equal(1, disposingCalls); - } - } - - [Fact] - public async Task HostDoesNotNotifyIApplicationLifetimeCallbacksIfIHostedServicesThrow() - { - bool[] events1 = null; - bool[] events2 = null; - - using (var host = CreateBuilder() - .ConfigureServices((services) => - { - events1 = RegisterCallbacksThatThrow(services); - events2 = RegisterCallbacksThatThrow(services); - }) - .Build()) - { - var applicationLifetime = host.Services.GetService(); - - var started = RegisterCallbacksThatThrow(applicationLifetime.ApplicationStarted); - var stopping = RegisterCallbacksThatThrow(applicationLifetime.ApplicationStopping); - - await Assert.ThrowsAsync(() => host.StartAsync()); - Assert.True(events1[0]); - Assert.False(events2[0]); - Assert.False(started.All(s => s)); - host.Dispose(); - Assert.False(events1[1]); - Assert.False(events2[1]); - Assert.False(stopping.All(s => s)); - } - } - - [Fact] - public async Task Host_InvokesConfigureServicesMethodsOnlyOnce() - { - int configureServicesCount = 0; - using (var host = CreateBuilder() - .ConfigureServices((services) => configureServicesCount++) - .Build()) - { - Assert.Equal(1, configureServicesCount); - await host.StartAsync(); - var services = host.Services; - var services2 = host.Services; - Assert.Equal(1, configureServicesCount); - } - } - - private IHostBuilder CreateBuilder(IConfiguration config = null) - { - return new HostBuilder().ConfigureHostConfiguration(builder => builder.AddConfiguration(config ?? new ConfigurationBuilder().Build())); - } - - private static bool[] RegisterCallbacksThatThrow(IServiceCollection services) - { - bool[] events = new bool[2]; - - Action started = () => - { - events[0] = true; - throw new InvalidOperationException(); - }; - - Action stopping = () => - { - events[1] = true; - throw new InvalidOperationException(); - }; - - services.AddSingleton(new DelegateHostedService(started, stopping, () => { })); - - return events; - } - - private static bool[] RegisterCallbacksThatThrow(CancellationToken token) - { - var signals = new bool[3]; - for (int i = 0; i < signals.Length; i++) - { - token.Register(state => - { - signals[(int)state] = true; - throw new InvalidOperationException(); - }, i); - } - - return signals; - } - - private class TestHostedService : IHostedService, IDisposable - { - private readonly IApplicationLifetime _lifetime; - - public TestHostedService(IApplicationLifetime lifetime) - { - _lifetime = lifetime; - } - - public bool StartCalled { get; set; } - public bool StopCalled { get; set; } - public bool DisposeCalled { get; set; } - - public Task StartAsync(CancellationToken token) - { - StartCalled = true; - return Task.CompletedTask; - } - - public Task StopAsync(CancellationToken token) - { - StopCalled = true; - return Task.CompletedTask; - } - - public void Dispose() - { - DisposeCalled = true; - } - } - - private class DelegateHostedService : IHostedService, IDisposable - { - private readonly Action _started; - private readonly Action _stopping; - private readonly Action _disposing; - - public DelegateHostedService(Action started, Action stopping, Action disposing) - { - _started = started; - _stopping = stopping; - _disposing = disposing; - } - - public Task StartAsync(CancellationToken token) - { - _started(); - return Task.CompletedTask; - } - public Task StopAsync(CancellationToken token) - { - _stopping(); - return Task.CompletedTask; - } - - public void Dispose() => _disposing(); - } - } -} \ No newline at end of file diff --git a/test/Microsoft.Extensions.Hosting.Tests/Microsoft.Extensions.Hosting.Tests.csproj b/test/Microsoft.Extensions.Hosting.Tests/Microsoft.Extensions.Hosting.Tests.csproj deleted file mode 100644 index 0b5702c1fd..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/Microsoft.Extensions.Hosting.Tests.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - $(StandardTestTfms) - - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.Extensions.Hosting.Tests/testroot/readme.txt b/test/Microsoft.Extensions.Hosting.Tests/testroot/readme.txt deleted file mode 100644 index f8e5f07a30..0000000000 --- a/test/Microsoft.Extensions.Hosting.Tests/testroot/readme.txt +++ /dev/null @@ -1 +0,0 @@ -This file exists to preserve the parent directory in the GIT repo. Git does not preserve empty directories. \ No newline at end of file diff --git a/test/TestAssets/BuildWebHostInvalidSignature/BuildWebHostInvalidSignature.csproj b/test/TestAssets/BuildWebHostInvalidSignature/BuildWebHostInvalidSignature.csproj deleted file mode 100644 index 25a648a366..0000000000 --- a/test/TestAssets/BuildWebHostInvalidSignature/BuildWebHostInvalidSignature.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(StandardTestAssetTfms) - Exe - - - - - - - - - - - - diff --git a/test/TestAssets/BuildWebHostPatternTestSite/BuildWebHostPatternTestSite.csproj b/test/TestAssets/BuildWebHostPatternTestSite/BuildWebHostPatternTestSite.csproj deleted file mode 100644 index 25a648a366..0000000000 --- a/test/TestAssets/BuildWebHostPatternTestSite/BuildWebHostPatternTestSite.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(StandardTestAssetTfms) - Exe - - - - - - - - - - - - diff --git a/test/TestAssets/CreateWebHostBuilderInvalidSignature/CreateWebHostBuilderInvalidSignature.csproj b/test/TestAssets/CreateWebHostBuilderInvalidSignature/CreateWebHostBuilderInvalidSignature.csproj deleted file mode 100644 index 25a648a366..0000000000 --- a/test/TestAssets/CreateWebHostBuilderInvalidSignature/CreateWebHostBuilderInvalidSignature.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(StandardTestAssetTfms) - Exe - - - - - - - - - - - - diff --git a/test/TestAssets/Directory.Build.props b/test/TestAssets/Directory.Build.props deleted file mode 100644 index 754b616d8b..0000000000 --- a/test/TestAssets/Directory.Build.props +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - netcoreapp2.1 - $(DeveloperBuildTestAssetTfms) - $(StandardTestAssetTfms);netcoreapp2.0 - $(StandardTestAssetTfms);net461 - - diff --git a/test/TestAssets/IStartupInjectionAssemblyName/IStartupInjectionAssemblyName.csproj b/test/TestAssets/IStartupInjectionAssemblyName/IStartupInjectionAssemblyName.csproj deleted file mode 100644 index 25a648a366..0000000000 --- a/test/TestAssets/IStartupInjectionAssemblyName/IStartupInjectionAssemblyName.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - $(StandardTestAssetTfms) - Exe - - - - - - - - - - - - diff --git a/test/TestAssets/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj b/test/TestAssets/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj deleted file mode 100644 index bc16ee652f..0000000000 --- a/test/TestAssets/Microsoft.AspNetCore.Hosting.TestSites/Microsoft.AspNetCore.Hosting.TestSites.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - $(StandardTestAssetTfms) - Exe - - - - - - - - - - - - - - diff --git a/version.props b/version.props deleted file mode 100644 index 2eb5f9cb11..0000000000 --- a/version.props +++ /dev/null @@ -1,18 +0,0 @@ - - - 2.1.1 - rtm - $(VersionPrefix) - $(VersionPrefix)-$(VersionSuffix)-final - t000 - a- - $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) - $(VersionSuffix)-$(BuildNumber) - - 0.5.1 - rtm - $(ExperimentalVersionPrefix) - $(ExperimentalVersionPrefix)-$(ExperimentalVersionSuffix)-final - $(ExperimentalVersionSuffix)-$(BuildNumber) - -