diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index d45bd5a1f8..0000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,17 +0,0 @@ -init: -- git config --global core.autocrlf true -branches: - only: - - master - - /^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 d4ee1cb7f3..0000000000 --- a/.gitattributes +++ /dev/null @@ -1,52 +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 cac0c595e6..0000000000 --- a/.gitignore +++ /dev/null @@ -1,38 +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 -node_modules -*.sln.ide -project.lock.json -.vs/ -.vscode/ -launchSettings.json -.build/ -.testPublish/ -global.json - -# Rider and friends -.idea/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index ab3980055c..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: - - master - - /^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/.vsts-pipelines/builds/ci-internal.yml b/.vsts-pipelines/builds/ci-internal.yml deleted file mode 100644 index c2c5336fd0..0000000000 --- a/.vsts-pipelines/builds/ci-internal.yml +++ /dev/null @@ -1,13 +0,0 @@ -trigger: -- master -- release/* - -resources: - repositories: - - repository: buildtools - type: git - name: aspnet-BuildTools - ref: refs/heads/master - -phases: -- template: .vsts-pipelines/templates/project-ci.yml@buildtools diff --git a/.vsts-pipelines/builds/ci-public.yml b/.vsts-pipelines/builds/ci-public.yml deleted file mode 100644 index 4a7bb79066..0000000000 --- a/.vsts-pipelines/builds/ci-public.yml +++ /dev/null @@ -1,28 +0,0 @@ -trigger: -- master -- release/* - -# See https://github.com/aspnet/BuildTools -resources: - repositories: - - repository: buildtools - type: github - endpoint: DotNet-Bot GitHub Connection - name: aspnet/BuildTools - ref: refs/heads/master - -phases: -- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools - parameters: - agentOs: Windows - beforeBuild: - - script: sqllocaldb start - displayName: Start LocalDB - -- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools - parameters: - agentOs: macOS - -- template: .vsts-pipelines/templates/phases/default-build.yml@buildtools - parameters: - agentOs: Linux diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md deleted file mode 100644 index ac2d28d2f0..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/AspNetCore/blob/master/CONTRIBUTING.md) in the AspNetCore repo. diff --git a/DiagnosticsPages.sln b/DiagnosticsPages.sln deleted file mode 100644 index 28e6a87e8a..0000000000 --- a/DiagnosticsPages.sln +++ /dev/null @@ -1,410 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26923.0 -MinimumVisualStudioVersion = 15.0.26730.03 -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{509A6F36-AD80-4A18-B5B1-717D38DFF29D}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{ACAA0157-A8C4-4152-93DE-90CCDF304087}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WelcomePageSample", "samples\WelcomePageSample\WelcomePageSample.csproj", "{C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Diagnostics", "src\Microsoft.AspNetCore.Diagnostics\Microsoft.AspNetCore.Diagnostics.csproj", "{68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeveloperExceptionPageSample", "samples\DeveloperExceptionPageSample\DeveloperExceptionPageSample.csproj", "{589AC17F-9455-4764-8F82-FCD2AE58DA14}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{2AF90579-B118-4583-AE88-672EFACB5BC4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Diagnostics.Tests", "test\Microsoft.AspNetCore.Diagnostics.Tests\Microsoft.AspNetCore.Diagnostics.Tests.csproj", "{994351B4-7B2A-4139-8B72-72C5BB5CC618}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ExceptionHandlerSample", "samples\ExceptionHandlerSample\ExceptionHandlerSample.csproj", "{427CDB36-78B0-4583-9EBC-7F283DE60355}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore", "src\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj", "{4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests", "test\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests\Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj", "{5486117B-A742-49E0-94FC-12B76F061803}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Diagnostics.Elm", "src\Microsoft.AspNetCore.Diagnostics.Elm\Microsoft.AspNetCore.Diagnostics.Elm.csproj", "{624B0019-956A-4157-B008-270C5B229553}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StatusCodePagesSample", "samples\StatusCodePagesSample\StatusCodePagesSample.csproj", "{CC1F5841-FE10-4DDB-8477-C4DE92BA759F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Diagnostics.Abstractions", "src\Microsoft.AspNetCore.Diagnostics.Abstractions\Microsoft.AspNetCore.Diagnostics.Abstractions.csproj", "{83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmPageSample", "samples\ElmPageSample\ElmPageSample.csproj", "{FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DatabaseErrorPageSample", "samples\DatabaseErrorPageSample\DatabaseErrorPageSample.csproj", "{FF7F11A1-14E7-4948-A853-2487D99DE0C6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.MiddlewareAnalysis", "src\Microsoft.AspNetCore.MiddlewareAnalysis\Microsoft.AspNetCore.MiddlewareAnalysis.csproj", "{C2DEDD37-D1EB-4819-9A9C-475E37A52358}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MiddlewareAnalysisSample", "samples\MiddlewareAnalysisSample\MiddlewareAnalysisSample.csproj", "{95981429-F212-44E1-83AA-32DA9E2A517C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.MiddlewareAnalysis.Tests", "test\Microsoft.AspNetCore.MiddlewareAnalysis.Tests\Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj", "{B0166AED-738F-42EE-AF4D-C487C8B21521}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassLibraryWithPortablePdbs", "test\ClassLibraryWithPortablePdbs\ClassLibraryWithPortablePdbs.csproj", "{AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Diagnostics.EFCore.FunctionalTests", "test\Diagnostics.EFCore.FunctionalTests\Diagnostics.EFCore.FunctionalTests.csproj", "{043C5272-D7F7-4DB1-830F-5DC93CC0878E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Diagnostics.FunctionalTests", "test\Diagnostics.FunctionalTests\Diagnostics.FunctionalTests.csproj", "{C142A666-D932-4E0D-8D18-5B08944C1077}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions", "src\Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions\Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.csproj", "{0D103C24-B9E8-468A-B113-509FCFEF7B45}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Diagnostics.HealthChecks", "src\Microsoft.Extensions.Diagnostics.HealthChecks\Microsoft.Extensions.Diagnostics.HealthChecks.csproj", "{F285F000-9342-4A01-9706-BAB2B97B4F97}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Diagnostics.HealthChecks", "src\Microsoft.AspNetCore.Diagnostics.HealthChecks\Microsoft.AspNetCore.Diagnostics.HealthChecks.csproj", "{1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HealthChecksSample", "samples\HealthChecksSample\HealthChecksSample.csproj", "{3B4E60F6-E42D-496E-B96F-71A11DABAEE7}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests", "test\Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests\Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests.csproj", "{E718CE19-23CC-427F-B06E-B866E9A35924}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Extensions.Diagnostics.HealthChecks.Tests", "test\Microsoft.Extensions.Diagnostics.HealthChecks.Tests\Microsoft.Extensions.Diagnostics.HealthChecks.Tests.csproj", "{3783E8E4-2E96-4987-A83A-0CCCAF4891C1}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore", "src\Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore\Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj", "{61F8B71C-4BDA-431C-9485-743D619ACF9A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests", "test\Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests\Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj", "{4416D921-0E43-496D-9156-D7EAA9CB8DD3}" -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 - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Debug|x86.ActiveCfg = Debug|Any CPU - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Release|Any CPU.Build.0 = Release|Any CPU - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416}.Release|x86.ActiveCfg = Release|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Debug|x86.ActiveCfg = Debug|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Release|Any CPU.Build.0 = Release|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE}.Release|x86.ActiveCfg = Release|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Debug|Any CPU.Build.0 = Debug|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Debug|x86.ActiveCfg = Debug|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Release|Any CPU.ActiveCfg = Release|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Release|Any CPU.Build.0 = Release|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {589AC17F-9455-4764-8F82-FCD2AE58DA14}.Release|x86.ActiveCfg = Release|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Debug|Any CPU.Build.0 = Debug|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Debug|x86.ActiveCfg = Debug|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Release|Any CPU.ActiveCfg = Release|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Release|Any CPU.Build.0 = Release|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {994351B4-7B2A-4139-8B72-72C5BB5CC618}.Release|x86.ActiveCfg = Release|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Debug|Any CPU.Build.0 = Debug|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Debug|x86.ActiveCfg = Debug|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Release|Any CPU.ActiveCfg = Release|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Release|Any CPU.Build.0 = Release|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {427CDB36-78B0-4583-9EBC-7F283DE60355}.Release|x86.ActiveCfg = Release|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Debug|x86.ActiveCfg = Debug|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Debug|x86.Build.0 = Debug|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Release|Any CPU.Build.0 = Release|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Release|x86.ActiveCfg = Release|Any CPU - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE}.Release|x86.Build.0 = Release|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Debug|x86.ActiveCfg = Debug|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Debug|x86.Build.0 = Debug|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Release|Any CPU.Build.0 = Release|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Release|x86.ActiveCfg = Release|Any CPU - {5486117B-A742-49E0-94FC-12B76F061803}.Release|x86.Build.0 = Release|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Debug|Any CPU.Build.0 = Debug|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Debug|x86.ActiveCfg = Debug|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Debug|x86.Build.0 = Debug|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Release|Any CPU.ActiveCfg = Release|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Release|Any CPU.Build.0 = Release|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Release|x86.ActiveCfg = Release|Any CPU - {624B0019-956A-4157-B008-270C5B229553}.Release|x86.Build.0 = Release|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Debug|x86.ActiveCfg = Debug|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Debug|x86.Build.0 = Debug|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Release|Any CPU.Build.0 = Release|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Release|x86.ActiveCfg = Release|Any CPU - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F}.Release|x86.Build.0 = Release|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Debug|x86.ActiveCfg = Debug|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Debug|x86.Build.0 = Debug|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Release|Any CPU.Build.0 = Release|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Release|x86.ActiveCfg = Release|Any CPU - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3}.Release|x86.Build.0 = Release|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Debug|x86.ActiveCfg = Debug|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Debug|x86.Build.0 = Debug|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Release|Any CPU.Build.0 = Release|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Release|x86.ActiveCfg = Release|Any CPU - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129}.Release|x86.Build.0 = Release|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Debug|x86.ActiveCfg = Debug|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Debug|x86.Build.0 = Debug|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Release|Any CPU.Build.0 = Release|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Release|x86.ActiveCfg = Release|Any CPU - {FF7F11A1-14E7-4948-A853-2487D99DE0C6}.Release|x86.Build.0 = Release|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Debug|x86.ActiveCfg = Debug|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Debug|x86.Build.0 = Debug|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Release|Any CPU.Build.0 = Release|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Release|x86.ActiveCfg = Release|Any CPU - {C2DEDD37-D1EB-4819-9A9C-475E37A52358}.Release|x86.Build.0 = Release|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Debug|x86.ActiveCfg = Debug|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Debug|x86.Build.0 = Debug|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Release|Any CPU.Build.0 = Release|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Release|x86.ActiveCfg = Release|Any CPU - {95981429-F212-44E1-83AA-32DA9E2A517C}.Release|x86.Build.0 = Release|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Debug|x86.ActiveCfg = Debug|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Debug|x86.Build.0 = Debug|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Release|Any CPU.Build.0 = Release|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Release|x86.ActiveCfg = Release|Any CPU - {B0166AED-738F-42EE-AF4D-C487C8B21521}.Release|x86.Build.0 = Release|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Debug|x86.ActiveCfg = Debug|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Debug|x86.Build.0 = Debug|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Release|Any CPU.Build.0 = Release|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Release|x86.ActiveCfg = Release|Any CPU - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0}.Release|x86.Build.0 = Release|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Debug|x86.ActiveCfg = Debug|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Debug|x86.Build.0 = Debug|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Release|Any CPU.Build.0 = Release|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Release|x86.ActiveCfg = Release|Any CPU - {043C5272-D7F7-4DB1-830F-5DC93CC0878E}.Release|x86.Build.0 = Release|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Debug|x86.ActiveCfg = Debug|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Debug|x86.Build.0 = Debug|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Release|Any CPU.Build.0 = Release|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Release|x86.ActiveCfg = Release|Any CPU - {C142A666-D932-4E0D-8D18-5B08944C1077}.Release|x86.Build.0 = Release|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Debug|x86.ActiveCfg = Debug|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Debug|x86.Build.0 = Debug|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Release|Any CPU.Build.0 = Release|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Release|x86.ActiveCfg = Release|Any CPU - {0D103C24-B9E8-468A-B113-509FCFEF7B45}.Release|x86.Build.0 = Release|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Debug|x86.ActiveCfg = Debug|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Debug|x86.Build.0 = Debug|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Release|Any CPU.Build.0 = Release|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Release|x86.ActiveCfg = Release|Any CPU - {F285F000-9342-4A01-9706-BAB2B97B4F97}.Release|x86.Build.0 = Release|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Debug|x86.ActiveCfg = Debug|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Debug|x86.Build.0 = Debug|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Release|Any CPU.Build.0 = Release|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Release|x86.ActiveCfg = Release|Any CPU - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C}.Release|x86.Build.0 = Release|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Debug|x86.ActiveCfg = Debug|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Debug|x86.Build.0 = Debug|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Release|Any CPU.Build.0 = Release|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Release|x86.ActiveCfg = Release|Any CPU - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7}.Release|x86.Build.0 = Release|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Debug|x86.ActiveCfg = Debug|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Debug|x86.Build.0 = Debug|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Release|Any CPU.Build.0 = Release|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Release|x86.ActiveCfg = Release|Any CPU - {E718CE19-23CC-427F-B06E-B866E9A35924}.Release|x86.Build.0 = Release|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Debug|x86.ActiveCfg = Debug|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Debug|x86.Build.0 = Debug|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Release|Any CPU.Build.0 = Release|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Release|x86.ActiveCfg = Release|Any CPU - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1}.Release|x86.Build.0 = Release|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Debug|x86.ActiveCfg = Debug|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Debug|x86.Build.0 = Debug|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Release|Any CPU.Build.0 = Release|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Release|x86.ActiveCfg = Release|Any CPU - {61F8B71C-4BDA-431C-9485-743D619ACF9A}.Release|x86.Build.0 = Release|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Debug|x86.ActiveCfg = Debug|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Debug|x86.Build.0 = Debug|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Release|Any CPU.Build.0 = Release|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Release|x86.ActiveCfg = Release|Any CPU - {4416D921-0E43-496D-9156-D7EAA9CB8DD3}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(NestedProjects) = preSolution - {C5F59CBA-DF2D-4983-8CBB-11B6AF21B416} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} - {68A1F0E1-ECCE-46D1-B20F-C43EE5B097DE} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {589AC17F-9455-4764-8F82-FCD2AE58DA14} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} - {994351B4-7B2A-4139-8B72-72C5BB5CC618} = {2AF90579-B118-4583-AE88-672EFACB5BC4} - {427CDB36-78B0-4583-9EBC-7F283DE60355} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} - {4F5A6A72-FFE4-49C4-B4C6-58132CFCB9FE} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {5486117B-A742-49E0-94FC-12B76F061803} = {2AF90579-B118-4583-AE88-672EFACB5BC4} - {624B0019-956A-4157-B008-270C5B229553} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {CC1F5841-FE10-4DDB-8477-C4DE92BA759F} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} - {83FFB65A-97B1-45AA-BCB8-3F43966BC8A3} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {FFD28DCF-C24F-4C59-9B6B-F3B74CE13129} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} - {FF7F11A1-14E7-4948-A853-2487D99DE0C6} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} - {C2DEDD37-D1EB-4819-9A9C-475E37A52358} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {95981429-F212-44E1-83AA-32DA9E2A517C} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} - {B0166AED-738F-42EE-AF4D-C487C8B21521} = {2AF90579-B118-4583-AE88-672EFACB5BC4} - {AA3661A1-CE8D-4597-ADFD-A5A30834E5D0} = {2AF90579-B118-4583-AE88-672EFACB5BC4} - {043C5272-D7F7-4DB1-830F-5DC93CC0878E} = {2AF90579-B118-4583-AE88-672EFACB5BC4} - {C142A666-D932-4E0D-8D18-5B08944C1077} = {2AF90579-B118-4583-AE88-672EFACB5BC4} - {0D103C24-B9E8-468A-B113-509FCFEF7B45} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {F285F000-9342-4A01-9706-BAB2B97B4F97} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {1B2B1EF4-9066-4F38-ADCF-D05C6423E21C} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {3B4E60F6-E42D-496E-B96F-71A11DABAEE7} = {ACAA0157-A8C4-4152-93DE-90CCDF304087} - {E718CE19-23CC-427F-B06E-B866E9A35924} = {2AF90579-B118-4583-AE88-672EFACB5BC4} - {3783E8E4-2E96-4987-A83A-0CCCAF4891C1} = {2AF90579-B118-4583-AE88-672EFACB5BC4} - {61F8B71C-4BDA-431C-9485-743D619ACF9A} = {509A6F36-AD80-4A18-B5B1-717D38DFF29D} - {4416D921-0E43-496D-9156-D7EAA9CB8DD3} = {2AF90579-B118-4583-AE88-672EFACB5BC4} - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D915AA7B-4ADE-4BAC-AF65-1E800D3F3580} - EndGlobalSection -EndGlobal diff --git a/Directory.Build.props b/Directory.Build.props deleted file mode 100644 index d79e6a446b..0000000000 --- a/Directory.Build.props +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - Microsoft ASP.NET Core - https://github.com/aspnet/Diagnostics - git - $(MSBuildThisFileDirectory) - $(MSBuildThisFileDirectory)build\Key.snk - true - true - - - diff --git a/Directory.Build.targets b/Directory.Build.targets deleted file mode 100644 index 7e3f8df92e..0000000000 --- a/Directory.Build.targets +++ /dev/null @@ -1,6 +0,0 @@ - - - $(MicrosoftNETCoreAppPackageVersion) - $(NETStandardLibrary20PackageVersion) - - diff --git a/LICENSE.txt b/LICENSE.txt deleted file mode 100644 index b3b180cd51..0000000000 --- a/LICENSE.txt +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright (c) .NET Foundation and Contributors - - 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 b153ab1515..0000000000 --- a/NuGetPackageVerifier.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "Default": { - "rules": [ - "DefaultCompositeRule" - ] - } -} \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 63e17d05d3..0000000000 --- a/README.md +++ /dev/null @@ -1,11 +0,0 @@ -ASP.NET Core Diagnostics -================ - -AppVeyor: [![AppVeyor](https://ci.appveyor.com/api/projects/status/5224cefq6y78aq21/branch/dev?svg=true)](https://ci.appveyor.com/project/aspnetci/Diagnostics/branch/dev) - -Travis: [![Travis](https://travis-ci.org/aspnet/Diagnostics.svg?branch=dev)](https://travis-ci.org/aspnet/Diagnostics) - -Diagnostics middleware for reporting info and handling exceptions and errors in ASP.NET Core, and diagnosing Entity Framework Core migrations errors. - - -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 7d4f59f9e7..0000000000 --- a/build/dependencies.props +++ /dev/null @@ -1,51 +0,0 @@ - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - 3.0.0-build-20181116.1 - 3.0.0-alpha1-10742 - 3.0.0-alpha1-10742 - 3.0.0-alpha1-10742 - 3.0.0-alpha1-10742 - 3.0.0-alpha1-10742 - 3.0.0-alpha1-10742 - 3.0.0-alpha1-10742 - 3.0.0-preview-181113-11 - 3.0.0-alpha1-10742 - 3.0.0-preview-181109-02 - 3.0.0-preview-181109-02 - 3.0.0-preview-181109-02 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-alpha1-10742 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview-181113-11 - 3.0.0-preview1-26907-05 - 3.0.0-alpha1-10742 - 15.6.1 - 4.10.0 - 2.0.3 - 11.0.2 - 4.6.0-preview1-26907-04 - 4.6.0-preview1-26907-04 - 1.7.0-preview1-26907-04 - 2.3.1 - 2.4.0 - - - - diff --git a/build/repo.props b/build/repo.props deleted file mode 100644 index 4402da1d0d..0000000000 --- a/build/repo.props +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - Internal.AspNetCore.Universe.Lineup - 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 7c88df468b..0000000000 --- a/korebuild-lock.txt +++ /dev/null @@ -1,2 +0,0 @@ -version:3.0.0-build-20181116.1 -commithash:9be7d79a8f7e0668f66e584aca1e962f45975511 diff --git a/korebuild.json b/korebuild.json deleted file mode 100644 index 8a276a7f35..0000000000 --- a/korebuild.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/master/tools/korebuild.schema.json", - "channel": "master" -} 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 34604c7175..0000000000 --- a/run.ps1 +++ /dev/null @@ -1,209 +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 Reinstall -Re-installs KoreBuild - -.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 CI -Sets up CI specific settings and variables. - -.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/master/tools/korebuild.schema.json", - "channel": "master", - "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, - [switch]$Reinstall, - [string]$ToolsSourceSuffix, - [string]$ConfigFile = $null, - [switch]$CI, - [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 ($Reinstall -and (Test-Path $korebuildPath)) { - Remove-Item -Force -Recurse $korebuildPath - } - - 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 'Microsoft.PowerShell.Archive\Expand-Archive' -ErrorAction Ignore) { - # Use built-in commands where possible as they are cross-plat compatible - Microsoft.PowerShell.Archive\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-Host -ForegroundColor Red $Error[0] - Write-Error "$ConfigFile contains invalid JSON." - exit 1 - } -} - -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 = 'master' } -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 -CI:$CI - Invoke-KoreBuildCommand $Command @Arguments -} -finally { - Remove-Module 'KoreBuild' -ErrorAction Ignore -} diff --git a/run.sh b/run.sh deleted file mode 100755 index 4c1fed5646..0000000000 --- a/run.sh +++ /dev/null @@ -1,256 +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 -reinstall=false -repo_path="$DIR" -channel='' -tools_source='' -tools_source_suffix='' -ci=false - -# -# 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 " --reinstall Reinstall KoreBuild." - echo " --ci Apply CI specific settings and environment variables." - 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 [ "$reinstall" = true ] && [ -d "$korebuild_path" ]; then - rm -rf "$korebuild_path" - fi - - { - 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 - ;; - --reinstall|-[Rr]einstall) - reinstall=true - ;; - --ci|-[Cc][Ii]) - ci=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 - __error "$config_file contains invalid JSON." - exit 1 - 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 - __error "$config_file contains invalid JSON." - exit 1 - fi - elif __machine_has python3 ; then - if python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then - config_channel="$(python3 -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="$(python3 -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")" - else - __error "$config_file contains invalid JSON." - exit 1 - fi - else - __error 'Missing required command: jq or python. Could not parse the JSON file.' - exit 1 - fi - - [ ! -z "${config_channel:-}" ] && channel="$config_channel" - [ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source" -fi - -[ -z "$channel" ] && channel='master' -[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools' - -get_korebuild -set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file" "$ci" -invoke_korebuild_command "$command" "$@" diff --git a/samples/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj b/samples/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj deleted file mode 100644 index 600cf4c332..0000000000 --- a/samples/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - - - diff --git a/samples/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj b/samples/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj deleted file mode 100644 index ae1a667b7e..0000000000 --- a/samples/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - diff --git a/samples/ElmPageSample/ElmPageSample.csproj b/samples/ElmPageSample/ElmPageSample.csproj deleted file mode 100644 index 7a4af2c0c6..0000000000 --- a/samples/ElmPageSample/ElmPageSample.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - diff --git a/samples/ElmPageSample/HelloWorldMiddleware.cs b/samples/ElmPageSample/HelloWorldMiddleware.cs deleted file mode 100644 index 70efb8914a..0000000000 --- a/samples/ElmPageSample/HelloWorldMiddleware.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.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Logging; - -namespace ElmPageSample -{ - public class HelloWorldMiddleware - { - private readonly ILogger _logger; - private readonly RequestDelegate _next; - - public HelloWorldMiddleware(RequestDelegate next, ILoggerFactory loggerFactory) - { - _next = next; - _logger = loggerFactory.CreateLogger(); - } - - public async Task Invoke(HttpContext httpContext) - { - using (_logger.BeginScope("Scope1")) - { - _logger.LogDebug("Getting message"); - - httpContext.Response.ContentType = "text/html; charset=utf-8"; - await httpContext.Response.WriteAsync( - "

Hello World!

Elm Logs"); - } - } - } -} \ No newline at end of file diff --git a/samples/ElmPageSample/Startup.cs b/samples/ElmPageSample/Startup.cs deleted file mode 100644 index 7fa96ac08c..0000000000 --- a/samples/ElmPageSample/Startup.cs +++ /dev/null @@ -1,42 +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.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace ElmPageSample -{ - public class Startup - { - public void ConfigureServices(IServiceCollection services) - { - services.AddElm(elmOptions => - { - elmOptions.Filter = (loggerName, loglevel) => loglevel == LogLevel.Debug; - }); - } - - public void Configure(IApplicationBuilder app) - { - app.UseElmPage(); - - app.UseElmCapture(); - - app.UseMiddleware(); - } - - public static void Main(string[] args) - { - var host = new WebHostBuilder() - .UseKestrel() - .UseIISIntegration() - .UseStartup() - .Build(); - - host.Run(); - } - } -} - diff --git a/samples/ExceptionHandlerSample/ExceptionHandlerSample.csproj b/samples/ExceptionHandlerSample/ExceptionHandlerSample.csproj deleted file mode 100644 index f57e886343..0000000000 --- a/samples/ExceptionHandlerSample/ExceptionHandlerSample.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - - diff --git a/samples/ExceptionHandlerSample/wwwroot/error.html b/samples/ExceptionHandlerSample/wwwroot/error.html deleted file mode 100644 index b9989e017f..0000000000 --- a/samples/ExceptionHandlerSample/wwwroot/error.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - You've reached the static error page.

- Home
- - \ No newline at end of file diff --git a/samples/HealthChecksSample/HealthChecksSample.csproj b/samples/HealthChecksSample/HealthChecksSample.csproj deleted file mode 100644 index 2568f03bb0..0000000000 --- a/samples/HealthChecksSample/HealthChecksSample.csproj +++ /dev/null @@ -1,24 +0,0 @@ - - - - - netcoreapp3.0 - - - - - - - - - - - - - - - - - - - diff --git a/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj b/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj deleted file mode 100644 index 1f9b63a540..0000000000 --- a/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - - - - diff --git a/samples/StatusCodePagesSample/StatusCodePagesSample.csproj b/samples/StatusCodePagesSample/StatusCodePagesSample.csproj deleted file mode 100644 index ae1a667b7e..0000000000 --- a/samples/StatusCodePagesSample/StatusCodePagesSample.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - diff --git a/samples/WelcomePageSample/WelcomePageSample.csproj b/samples/WelcomePageSample/WelcomePageSample.csproj deleted file mode 100644 index ae1a667b7e..0000000000 --- a/samples/WelcomePageSample/WelcomePageSample.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - 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.Diagnostics.Elm/ActivityContext.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ActivityContext.cs deleted file mode 100644 index abfb78caa5..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ActivityContext.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - public class ActivityContext - { - public Guid Id { get; set; } - - public HttpInfo HttpInfo { get; set; } - - public ScopeNode Root { get; set; } - - public DateTimeOffset Time { get; set; } - - public bool IsCollapsed { get; set; } - - public bool RepresentsScope { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmCaptureMiddleware.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmCaptureMiddleware.cs deleted file mode 100644 index e71d21dcfa..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmCaptureMiddleware.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.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Features; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - /// - /// Enables the Elm logging service. - /// - public class ElmCaptureMiddleware - { - private readonly RequestDelegate _next; - private readonly ElmOptions _options; - private readonly ILogger _logger; - - public ElmCaptureMiddleware(RequestDelegate next, ILoggerFactory factory, IOptions options) - { - _next = next; - _options = options.Value; - _logger = factory.CreateLogger(); - } - - public async Task Invoke(HttpContext context) - { - using (RequestIdentifier.Ensure(context)) - { - var requestId = context.Features.Get().TraceIdentifier; - using (_logger.BeginScope("Request: {RequestId}", requestId)) - { - try - { - ElmScope.Current.Context.HttpInfo = GetHttpInfo(context); - await _next(context); - } - finally - { - ElmScope.Current.Context.HttpInfo.StatusCode = context.Response.StatusCode; - } - } - } - } - - /// - /// Takes the info from the given HttpContext and copies it to an HttpInfo object - /// - /// The HttpInfo for the current elm context - private static HttpInfo GetHttpInfo(HttpContext context) - { - return new HttpInfo() - { - RequestID = context.Features.Get().TraceIdentifier, - Host = context.Request.Host, - ContentType = context.Request.ContentType, - Path = context.Request.Path, - Scheme = context.Request.Scheme, - StatusCode = context.Response.StatusCode, - User = context.User, - Method = context.Request.Method, - Protocol = context.Request.Protocol, - Headers = context.Request.Headers, - Query = context.Request.QueryString, - Cookies = context.Request.Cookies - }; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmExtensions.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmExtensions.cs deleted file mode 100644 index aca56d5bbe..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmExtensions.cs +++ /dev/null @@ -1,47 +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.AspNetCore.Diagnostics.Elm; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace Microsoft.AspNetCore.Builder -{ - public static class ElmExtensions - { - /// - /// Enables the Elm logging service, which can be accessed via the . - /// - public static IApplicationBuilder UseElmCapture(this IApplicationBuilder app) - { - if (app == null) - { - throw new ArgumentNullException(nameof(app)); - } - - // add the elm provider to the factory here so the logger can start capturing logs immediately - var factory = app.ApplicationServices.GetRequiredService() as LoggerFactory; - if (factory != null) - { - var provider = app.ApplicationServices.GetRequiredService(); - factory.AddProvider(provider); - } - - return app.UseMiddleware(); - } - - /// - /// Enables viewing logs captured by the . - /// - public static IApplicationBuilder UseElmPage(this IApplicationBuilder app) - { - if (app == null) - { - throw new ArgumentNullException(nameof(app)); - } - - return app.UseMiddleware(); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmLogger.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmLogger.cs deleted file mode 100644 index 51eeb60eeb..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmLogger.cs +++ /dev/null @@ -1,82 +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.Logging; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - public class ElmLogger : ILogger - { - private readonly string _name; - private readonly ElmOptions _options; - private readonly ElmStore _store; - - public ElmLogger(string name, ElmOptions options, ElmStore store) - { - _name = name; - _options = options; - _store = store; - } - - public void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, - Func formatter) - { - if (!IsEnabled(logLevel) || (state == null && exception == null)) - { - return; - } - LogInfo info = new LogInfo() - { - ActivityContext = GetCurrentActivityContext(), - Name = _name, - EventID = eventId.Id, - Severity = logLevel, - Exception = exception, - State = state, - Message = formatter == null ? state.ToString() : formatter(state, exception), - Time = DateTimeOffset.UtcNow - }; - if (ElmScope.Current != null) - { - ElmScope.Current.Node.Messages.Add(info); - } - // The log does not belong to any scope - create a new context for it - else - { - var context = GetNewActivityContext(); - context.RepresentsScope = false; // mark as a non-scope log - context.Root = new ScopeNode(); - context.Root.Messages.Add(info); - _store.AddActivity(context); - } - } - - public bool IsEnabled(LogLevel logLevel) - { - return _options.Filter(_name, logLevel); - } - - public IDisposable BeginScope(TState state) - { - var scope = new ElmScope(_name, state); - scope.Context = ElmScope.Current?.Context ?? GetNewActivityContext(); - return ElmScope.Push(scope, _store); - } - - private ActivityContext GetNewActivityContext() - { - return new ActivityContext() - { - Id = Guid.NewGuid(), - Time = DateTimeOffset.UtcNow, - RepresentsScope = true - }; - } - - private ActivityContext GetCurrentActivityContext() - { - return ElmScope.Current?.Context ?? GetNewActivityContext(); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmLoggerProvider.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmLoggerProvider.cs deleted file mode 100644 index 678ddac55c..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmLoggerProvider.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 Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - public class ElmLoggerProvider : ILoggerProvider - { - private readonly ElmStore _store; - private readonly ElmOptions _options; - - public ElmLoggerProvider(ElmStore store, IOptions options) - { - if (store == null) - { - throw new ArgumentNullException(nameof(store)); - } - - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - _store = store; - _options = options.Value; - } - - public ILogger CreateLogger(string name) - { - return new ElmLogger(name, _options, _store); - } - - public void Dispose() - { - } - } -} diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmOptions.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmOptions.cs deleted file mode 100644 index 3a9038cc4e..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmOptions.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; -using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Logging; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - /// - /// Options for ElmMiddleware - /// - public class ElmOptions - { - /// - /// Specifies the path to view the logs. - /// - public PathString Path { get; set; } = new PathString("/Elm"); - - /// - /// Determines whether log statements should be logged based on the name of the logger - /// and the of the message. - /// - public Func Filter { get; set; } = (name, level) => true; - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmPageMiddleware.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmPageMiddleware.cs deleted file mode 100644 index 63dffd492f..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmPageMiddleware.cs +++ /dev/null @@ -1,127 +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.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Diagnostics.Elm.RazorViews; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using System.Linq; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - /// - /// Enables viewing logs captured by the . - /// - public class ElmPageMiddleware - { - private readonly RequestDelegate _next; - private readonly ElmOptions _options; - private readonly ElmStore _store; - - public ElmPageMiddleware(RequestDelegate next, IOptions options, ElmStore store) - { - _next = next; - _options = options.Value; - _store = store; - } - - public async Task Invoke(HttpContext context) - { - if (!context.Request.Path.StartsWithSegments(_options.Path)) - { - await _next(context); - return; - } - - var t = await ParseParams(context); - var options = t.Item1; - var redirect = t.Item2; - if (redirect) - { - return; - } - if (context.Request.Path == _options.Path) - { - RenderMainLogPage(options, context); - } - else - { - RenderDetailsPage(options, context); - } - } - - private async void RenderMainLogPage(ViewOptions options, HttpContext context) - { - var model = new LogPageModel() - { - Activities = _store.GetActivities(), - Options = options, - Path = _options.Path - }; - var logPage = new LogPage(model); - - await logPage.ExecuteAsync(context); - } - - private async void RenderDetailsPage(ViewOptions options, HttpContext context) - { - var parts = context.Request.Path.Value.Split('/'); - var id = Guid.Empty; - if (!Guid.TryParse(parts[parts.Length - 1], out id)) - { - context.Response.StatusCode = 400; - await context.Response.WriteAsync("Invalid Id"); - return; - } - var model = new DetailsPageModel() - { - Activity = _store.GetActivities().Where(a => a.Id == id).FirstOrDefault(), - Options = options - }; - var detailsPage = new DetailsPage(model); - await detailsPage.ExecuteAsync(context); - } - - private async Task> ParseParams(HttpContext context) - { - var options = new ViewOptions() - { - MinLevel = LogLevel.Debug, - NamePrefix = string.Empty - }; - var isRedirect = false; - - IFormCollection form = null; - if (context.Request.HasFormContentType) - { - form = await context.Request.ReadFormAsync(); - } - - if (form != null && form.ContainsKey("clear")) - { - _store.Clear(); - context.Response.Redirect(context.Request.PathBase.Add(_options.Path).ToString()); - isRedirect = true; - } - else - { - if (context.Request.Query.ContainsKey("level")) - { - var minLevel = options.MinLevel; - if (Enum.TryParse(context.Request.Query["level"], out minLevel)) - { - options.MinLevel = minLevel; - } - } - if (context.Request.Query.ContainsKey("name")) - { - var namePrefix = context.Request.Query["name"]; - options.NamePrefix = namePrefix; - } - } - return Tuple.Create(options, isRedirect); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmScope.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmScope.cs deleted file mode 100644 index f64ae23e69..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmScope.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Threading; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - public class ElmScope - { - private readonly string _name; - private readonly object _state; - - public ElmScope(string name, object state) - { - _name = name; - _state = state; - } - - public ActivityContext Context { get; set; } - - public ElmScope Parent { get; set; } - - public ScopeNode Node { get; set; } - - private static AsyncLocal _value = new AsyncLocal(); - public static ElmScope Current - { - set - { - _value.Value = value; - } - get - { - return _value.Value; - } - } - - public static IDisposable Push(ElmScope scope, ElmStore store) - { - if (scope == null) - { - throw new ArgumentNullException(nameof(scope)); - } - - if (store == null) - { - throw new ArgumentNullException(nameof(store)); - } - - var temp = Current; - Current = scope; - Current.Parent = temp; - - Current.Node = new ScopeNode() - { - StartTime = DateTimeOffset.UtcNow, - State = Current._state, - Name = Current._name - }; - - if (Current.Parent != null) - { - Current.Node.Parent = Current.Parent.Node; - Current.Parent.Node.Children.Add(Current.Node); - } - else - { - Current.Context.Root = Current.Node; - store.AddActivity(Current.Context); - } - - return new DisposableAction(() => - { - Current.Node.EndTime = DateTimeOffset.UtcNow; - Current = Current.Parent; - }); - } - - private class DisposableAction : IDisposable - { - private Action _action; - - public DisposableAction(Action action) - { - _action = action; - } - - public void Dispose() - { - if (_action != null) - { - _action.Invoke(); - _action = null; - } - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmServiceCollectionExtensions.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmServiceCollectionExtensions.cs deleted file mode 100644 index 2d2da2d176..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmServiceCollectionExtensions.cs +++ /dev/null @@ -1,58 +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.AspNetCore.Diagnostics.Elm; -using Microsoft.Extensions.DependencyInjection.Extensions; - -namespace Microsoft.Extensions.DependencyInjection -{ - /// - /// Extension methods for setting up Elm services in an . - /// - public static class ElmServiceCollectionExtensions - { - /// - /// Adds error logging middleware services to the specified . - /// - /// The to add services to. - /// The so that additional calls can be chained. - public static IServiceCollection AddElm(this IServiceCollection services) - { - if (services == null) - { - throw new ArgumentNullException(nameof(services)); - } - - services.AddOptions(); - services.TryAddSingleton(); - services.TryAddSingleton(); - - return services; - } - - /// - /// Adds error logging middleware services to the specified . - /// - /// The to add services to. - /// An to configure the provided . - /// The so that additional calls can be chained. - public static IServiceCollection AddElm(this IServiceCollection services, Action setupAction) - { - if (services == null) - { - throw new ArgumentNullException(nameof(services)); - } - - if (setupAction == null) - { - throw new ArgumentNullException(nameof(setupAction)); - } - - services.AddElm(); - services.Configure(setupAction); - - return services; - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmStore.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmStore.cs deleted file mode 100644 index c71dedec09..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ElmStore.cs +++ /dev/null @@ -1,119 +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; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - public class ElmStore - { - private const int Capacity = 200; - - private LinkedList Activities { get; set; } = new LinkedList(); - - /// - /// Returns an IEnumerable of the contexts of the logs. - /// - /// An IEnumerable of objects where each context stores - /// information about a top level scope. - public IEnumerable GetActivities() - { - for (var context = Activities.First; context != null; context = context.Next) - { - if (!context.Value.IsCollapsed && CollapseActivityContext(context.Value)) - { - Activities.Remove(context); - } - } - return Activities; - } - - /// - /// Adds a new to the store. - /// - /// The to be added to the store. - public void AddActivity(ActivityContext activity) - { - if (activity == null) - { - throw new ArgumentNullException(nameof(activity)); - } - - lock (Activities) - { - Activities.AddLast(activity); - while (Count() > Capacity) - { - Activities.RemoveFirst(); - } - } - } - - /// - /// Removes all activity contexts that have been stored. - /// - public void Clear() - { - Activities.Clear(); - } - - /// - /// Returns the total number of logs in all activities in the store - /// - /// The total log count - public int Count() - { - return Activities.Sum(a => Count(a.Root)); - } - - private int Count(ScopeNode node) - { - if (node == null) - { - return 0; - } - var sum = node.Messages.Count; - foreach (var child in node.Children) - { - sum += Count(child); - } - return sum; - } - - /// - /// Removes any nodes on the context's scope tree that doesn't have any logs - /// This may occur as a result of the filters turned on - /// - /// The context who's node should be condensed - /// true if the node has been condensed to null, false otherwise - private bool CollapseActivityContext(ActivityContext context) - { - context.Root = CollapseHelper(context.Root); - context.IsCollapsed = true; - return context.Root == null; - } - - private ScopeNode CollapseHelper(ScopeNode node) - { - if (node == null) - { - return node; - } - for (int i = 0; i < node.Children.Count; i++) - { - node.Children[i] = CollapseHelper(node.Children[i]); - } - node.Children.RemoveAll(c => c == null); - if (node.Children.Count == 0 && node.Messages.Count == 0) - { - return null; - } - else - { - return node; - } - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/HttpInfo.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/HttpInfo.cs deleted file mode 100644 index 70281945b4..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/HttpInfo.cs +++ /dev/null @@ -1,36 +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.Security.Claims; -using Microsoft.AspNetCore.Http; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - public class HttpInfo - { - public string RequestID { get; set; } - - public HostString Host { get; set; } - - public PathString Path { get; set; } - - public string ContentType { get; set; } - - public string Scheme { get; set; } - - public int StatusCode { get; set; } - - public ClaimsPrincipal User { get; set; } - - public string Method { get; set; } - - public string Protocol { get; set; } - - public IHeaderDictionary Headers { get; set; } - - public QueryString Query { get; set; } - - public IRequestCookieCollection Cookies { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/HttpRequestIdentifierFeature.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/HttpRequestIdentifierFeature.cs deleted file mode 100644 index 16a6da4064..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/HttpRequestIdentifierFeature.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. - -using Microsoft.AspNetCore.Http.Features; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - internal class HttpRequestIdentifierFeature : IHttpRequestIdentifierFeature - { - public string TraceIdentifier { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/LogInfo.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/LogInfo.cs deleted file mode 100644 index e1484fd242..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/LogInfo.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. - -using System; -using Microsoft.Extensions.Logging; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - public class LogInfo - { - public ActivityContext ActivityContext { get; set; } - - public string Name { get; set; } - - public object State { get; set; } - - public Exception Exception { get; set; } - - public string Message { get; set; } - - public LogLevel Severity { get; set; } - - public int EventID { get; set; } - - public DateTimeOffset Time { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Microsoft.AspNetCore.Diagnostics.Elm.csproj b/src/Microsoft.AspNetCore.Diagnostics.Elm/Microsoft.AspNetCore.Diagnostics.Elm.csproj deleted file mode 100644 index d432fe55b7..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Microsoft.AspNetCore.Diagnostics.Elm.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - - ASP.NET Core Error Logging Middleware (ELM) to capture and display request logs. - $(ExperimentalVersionPrefix) - $(ExperimentalVersionSuffix) - false - $(ExperimentalPackageVersion) - netcoreapp3.0 - $(NoWarn);CS1591 - true - aspnetcore;diagnostics - - - - - - - - - - - - - - diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/RequestIdentifier.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/RequestIdentifier.cs deleted file mode 100644 index e004ffc5ae..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/RequestIdentifier.cs +++ /dev/null @@ -1,57 +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.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Features; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - internal class RequestIdentifier : IDisposable - { - private readonly bool _addedFeature; - private readonly bool _updatedIdentifier; - private readonly string _originalIdentifierValue; - private readonly HttpContext _context; - private readonly IHttpRequestIdentifierFeature _feature; - - private RequestIdentifier(HttpContext context) - { - _context = context; - _feature = context.Features.Get(); - - if (_feature == null) - { - _feature = new HttpRequestIdentifierFeature() - { - TraceIdentifier = Guid.NewGuid().ToString() - }; - context.Features.Set(_feature); - _addedFeature = true; - } - else if (string.IsNullOrEmpty(_feature.TraceIdentifier)) - { - _originalIdentifierValue = _feature.TraceIdentifier; - _feature.TraceIdentifier = Guid.NewGuid().ToString(); - _updatedIdentifier = true; - } - } - - public static IDisposable Ensure(HttpContext context) - { - return new RequestIdentifier(context); - } - - public void Dispose() - { - if (_addedFeature) - { - _context.Features.Set(null); - } - else if (_updatedIdentifier) - { - _feature.TraceIdentifier = _originalIdentifierValue; - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ScopeNode.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ScopeNode.cs deleted file mode 100644 index 101dad091f..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ScopeNode.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - public class ScopeNode - { - public ScopeNode Parent { get; set; } - - public List Children { get; private set; } = new List(); - - public List Messages { get; private set; } = new List(); - - public DateTimeOffset StartTime { get; set; } - - public DateTimeOffset EndTime { get; set; } - - public object State { get; set; } - - public string Name { get; set; } - - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/ViewOptions.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/ViewOptions.cs deleted file mode 100644 index db0a8c8304..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/ViewOptions.cs +++ /dev/null @@ -1,23 +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.Logging; - -namespace Microsoft.AspNetCore.Diagnostics.Elm -{ - /// - /// Options for viewing elm logs. - /// - public class ViewOptions - { - /// - /// The minimum of logs shown on the elm page. - /// - public LogLevel MinLevel { get; set; } - - /// - /// The prefix for the logger names of logs shown on the elm page. - /// - public string NamePrefix { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPage.Designer.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPage.Designer.cs deleted file mode 100644 index d1f50f01b0..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPage.Designer.cs +++ /dev/null @@ -1,541 +0,0 @@ -// -#pragma warning disable 1591 -namespace Microsoft.AspNetCore.Diagnostics.Elm.RazorViews -{ - #line hidden -#line 1 "DetailsPage.cshtml" -using System; - -#line default -#line hidden - using System.Threading.Tasks; -#line 2 "DetailsPage.cshtml" -using System.Globalization; - -#line default -#line hidden -#line 3 "DetailsPage.cshtml" -using System.Linq; - -#line default -#line hidden -#line 4 "DetailsPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Elm; - -#line default -#line hidden -#line 5 "DetailsPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Elm.RazorViews; - -#line default -#line hidden -#line 6 "DetailsPage.cshtml" -using Microsoft.Extensions.RazorViews; - -#line default -#line hidden -#line 7 "DetailsPage.cshtml" -using Microsoft.Extensions.Logging; - -#line default -#line hidden - internal class DetailsPage : Microsoft.Extensions.RazorViews.BaseView - { - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - WriteLiteral("\r\n"); -#line 86 "DetailsPage.cshtml" - - Response.ContentType = "text/html; charset=utf-8"; - -#line default -#line hidden - WriteLiteral(@" - - - - ASP.NET Core Logs - - - - -

ASP.NET Core Logs

-"); -#line 194 "DetailsPage.cshtml" - - var context = Model.Activity?.HttpInfo; - - -#line default -#line hidden - WriteLiteral(" "); -#line 197 "DetailsPage.cshtml" - if (context != null) - { - -#line default -#line hidden - WriteLiteral("

Request Details

\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n - - - - \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Path"); -#line 205 "DetailsPage.cshtml" - Write(context.Path); - -#line default -#line hidden - WriteLiteral("
Host"); -#line 209 "DetailsPage.cshtml" - Write(context.Host); - -#line default -#line hidden - WriteLiteral("
Content Type"); -#line 213 "DetailsPage.cshtml" - Write(context.ContentType); - -#line default -#line hidden - WriteLiteral("
Method"); -#line 217 "DetailsPage.cshtml" - Write(context.Method); - -#line default -#line hidden - WriteLiteral("
Protocol"); -#line 221 "DetailsPage.cshtml" - Write(context.Protocol); - -#line default -#line hidden - WriteLiteral(@"
Headers - - - - - - - - -"); -#line 234 "DetailsPage.cshtml" - foreach (var header in context.Headers) - { - -#line default -#line hidden - WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 240 "DetailsPage.cshtml" - } - -#line default -#line hidden - WriteLiteral(" \r\n
VariableValue
"); -#line 237 "DetailsPage.cshtml" - Write(header.Key); - -#line default -#line hidden - WriteLiteral(""); -#line 238 "DetailsPage.cshtml" - Write(string.Join(";", header.Value)); - -#line default -#line hidden - WriteLiteral("
\r\n
Status Code"); -#line 247 "DetailsPage.cshtml" - Write(context.StatusCode); - -#line default -#line hidden - WriteLiteral("
User"); -#line 251 "DetailsPage.cshtml" - Write(context.User.Identity.Name); - -#line default -#line hidden - WriteLiteral("
Claims\r\n"); -#line 256 "DetailsPage.cshtml" - if (context.User.Claims.Any()) - { - -#line default -#line hidden - WriteLiteral(@" - - - - - - - -"); -#line 266 "DetailsPage.cshtml" - foreach (var claim in context.User.Claims) - { - -#line default -#line hidden - WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 272 "DetailsPage.cshtml" - } - -#line default -#line hidden - WriteLiteral(" \r\n
IssuerValue
"); -#line 269 "DetailsPage.cshtml" - Write(claim.Issuer); - -#line default -#line hidden - WriteLiteral(""); -#line 270 "DetailsPage.cshtml" - Write(claim.Value); - -#line default -#line hidden - WriteLiteral("
\r\n"); -#line 275 "DetailsPage.cshtml" - } - -#line default -#line hidden - WriteLiteral("
Scheme"); -#line 280 "DetailsPage.cshtml" - Write(context.Scheme); - -#line default -#line hidden - WriteLiteral("
Query"); -#line 284 "DetailsPage.cshtml" - Write(context.Query.Value); - -#line default -#line hidden - WriteLiteral("
Cookies\r\n"); -#line 289 "DetailsPage.cshtml" - if (context.Cookies.Any()) - { - -#line default -#line hidden - WriteLiteral(@" - - - - - - - -"); -#line 299 "DetailsPage.cshtml" - foreach (var cookie in context.Cookies) - { - -#line default -#line hidden - WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 305 "DetailsPage.cshtml" - } - -#line default -#line hidden - WriteLiteral(" \r\n
VariableValue
"); -#line 302 "DetailsPage.cshtml" - Write(cookie.Key); - -#line default -#line hidden - WriteLiteral(""); -#line 303 "DetailsPage.cshtml" - Write(string.Join(";", cookie.Value)); - -#line default -#line hidden - WriteLiteral("
\r\n"); -#line 308 "DetailsPage.cshtml" - } - -#line default -#line hidden - WriteLiteral("
\r\n"); -#line 312 "DetailsPage.cshtml" - } - -#line default -#line hidden - WriteLiteral("

Logs

\r\n
\r\n \r\n - -
- - - - - - - - - - - - "); -#line 343 "DetailsPage.cshtml" - Write(Traverse(Model.Activity.Root)); - -#line default -#line hidden - WriteLiteral(@" -
DateTimeSeverityNameStateError
- - -"); - } - #pragma warning restore 1998 -#line 10 "DetailsPage.cshtml" - - public DetailsPage(DetailsPageModel model) - { - Model = model; - } - - public DetailsPageModel Model { get; set; } - - public HelperResult LogRow(LogInfo log) - { - return new HelperResult((writer) => - { - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - PushWriter(writer); - WriteLiteral(" \r\n "); - Write(string.Format("{0:MM/dd/yy}", log.Time)); - WriteLiteral("\r\n "); - Write(string.Format("{0:H:mm:ss}", log.Time)); - var severity = log.Severity.ToString().ToLowerInvariant(); - WriteLiteral($"\r\n "); - Write(log.Severity); - - WriteLiteral($"\r\n "); - Write(log.Name); - - WriteLiteral($"\r\n "); - Write(log.Message); - - WriteLiteral($"\r\n "); - Write(log.Exception); - - WriteLiteral("\r\n \r\n"); - PopWriter(); - } - }); - } - - public HelperResult Traverse(ScopeNode node) - { - return new HelperResult((writer) => - { - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - LogRow(node.Messages[messageIndex]); - messageIndex++; - } - else - { - Traverse(node.Children[childIndex]); - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - LogRow(node.Messages[i]); - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - Traverse(node.Children[i]); - } - } - }); - } - -#line default -#line hidden - } -} -#pragma warning restore 1591 diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPage.cshtml b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPage.cshtml deleted file mode 100644 index 76180ed102..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPage.cshtml +++ /dev/null @@ -1,260 +0,0 @@ -@using System -@using System.Globalization -@using System.Linq -@using Microsoft.AspNetCore.Diagnostics.Elm -@using Microsoft.AspNetCore.Diagnostics.Elm.RazorViews -@using Microsoft.Extensions.RazorViews -@using Microsoft.Extensions.Logging - -@functions -{ - public DetailsPage(DetailsPageModel model) - { - Model = model; - } - - public DetailsPageModel Model { get; set; } - - public HelperResult LogRow(LogInfo log) - { - return new HelperResult((writer) => - { - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - PushWriter(writer); - WriteLiteral(" \r\n "); - Write(string.Format("{0:MM/dd/yy}", log.Time)); - WriteLiteral("\r\n "); - Write(string.Format("{0:H:mm:ss}", log.Time)); - var severity = log.Severity.ToString().ToLowerInvariant(); - WriteLiteral($"\r\n "); - Write(log.Severity); - - WriteLiteral($"\r\n "); - Write(log.Name); - - WriteLiteral($"\r\n "); - Write(log.Message); - - WriteLiteral($"\r\n "); - Write(log.Exception); - - WriteLiteral("\r\n \r\n"); - PopWriter(); - } - }); - } - - public HelperResult Traverse(ScopeNode node) - { - return new HelperResult((writer) => - { - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - LogRow(node.Messages[messageIndex]); - messageIndex++; - } - else - { - Traverse(node.Children[childIndex]); - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - LogRow(node.Messages[i]); - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - Traverse(node.Children[i]); - } - } - }); - } -} -@{ - Response.ContentType = "text/html; charset=utf-8"; -} - - - - - ASP.NET Core Logs - - - - -

ASP.NET Core Logs

- @{ - var context = Model.Activity?.HttpInfo; - } - @if (context != null) - { -

Request Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path@context.Path
Host@context.Host
Content Type@context.ContentType
Method@context.Method
Protocol@context.Protocol
Headers - - - - - - - - - @foreach (var header in context.Headers) - { - - - - - } - -
VariableValue
@header.Key@string.Join(";", header.Value)
-
Status Code@context.StatusCode
User@context.User.Identity.Name
Claims - @if (context.User.Claims.Any()) - { - - - - - - - - - @foreach (var claim in context.User.Claims) - { - - - - - } - -
IssuerValue
@claim.Issuer@claim.Value
- } -
Scheme@context.Scheme
Query@context.Query.Value
Cookies - @if (context.Cookies.Any()) - { - - - - - - - - - @foreach (var cookie in context.Cookies) - { - - - - - } - -
VariableValue
@cookie.Key@string.Join(";", cookie.Value)
- } -
- } -

Logs

-
- - - -
- - - - - - - - - - - - @Traverse(Model.Activity.Root) -
DateTimeSeverityNameStateError
- - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPage.css b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPage.css deleted file mode 100644 index d0803ebf3f..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPage.css +++ /dev/null @@ -1,56 +0,0 @@ -body { - font-size: 0.9em; - width: 90%; - margin: 0px auto; -} - -h1 { - padding-bottom: 10px; -} - -h2 { - font-weight: normal; -} - -table { - border-spacing: 0px; - width: 100%; - border-collapse: collapse; - border: 1px solid black; - white-space: pre-wrap; -} - -th { - font-family: Arial; -} - -td, th { - padding: 8px; -} - -#headerTable, #cookieTable { - border: none; - height: 100%; -} - -#headerTd { - white-space: normal; -} - -#label { - width: 20%; - border-right: 1px solid black; -} - -#logs{ - margin-top: 10px; - margin-bottom: 20px; -} - -#logs>tbody>tr>td { - border-right: 1px dashed lightgray; -} - -#logs>thead>tr>th { - border: 1px solid black; -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPageModel.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPageModel.cs deleted file mode 100644 index 1b9c2a64b0..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/DetailsPageModel.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace Microsoft.AspNetCore.Diagnostics.Elm.RazorViews -{ - public class DetailsPageModel - { - public ActivityContext Activity { get; set; } - - public ViewOptions Options { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPage.Designer.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPage.Designer.cs deleted file mode 100644 index 1889ca3139..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPage.Designer.cs +++ /dev/null @@ -1,651 +0,0 @@ -// -#pragma warning disable 1591 -namespace Microsoft.AspNetCore.Diagnostics.Elm.RazorViews -{ - #line hidden -#line 1 "LogPage.cshtml" -using System; - -#line default -#line hidden - using System.Threading.Tasks; -#line 2 "LogPage.cshtml" -using System.Collections.Generic; - -#line default -#line hidden -#line 3 "LogPage.cshtml" -using System.Globalization; - -#line default -#line hidden -#line 4 "LogPage.cshtml" -using System.Linq; - -#line default -#line hidden -#line 5 "LogPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Elm; - -#line default -#line hidden -#line 6 "LogPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Elm.RazorViews; - -#line default -#line hidden -#line 7 "LogPage.cshtml" -using Microsoft.Extensions.RazorViews; - -#line default -#line hidden -#line 8 "LogPage.cshtml" -using Microsoft.Extensions.Logging; - -#line default -#line hidden - internal class LogPage : Microsoft.Extensions.RazorViews.BaseView - { - #pragma warning disable 1998 - public async override global::System.Threading.Tasks.Task ExecuteAsync() - { - WriteLiteral("\r\n"); -#line 118 "LogPage.cshtml" - - Response.ContentType = "text/html; charset=utf-8"; - -#line default -#line hidden - WriteLiteral(@" - - - - - ASP.NET Core Logs - - \r\n\r\n\r\n

ASP.NET Core Logs

\r\n
\r\n \r\n - -
-
- -
- - - - - - - - - - - - - - - - - - -"); -#line 321 "LogPage.cshtml" - foreach (var activity in Model.Activities.Reverse()) - { - -#line default -#line hidden - WriteLiteral(" \r\n \r\n"); -#line 325 "LogPage.cshtml" - - var activityPath = Model.Path.Value + "/" + activity.Id; - if (activity.HttpInfo != null) - { - -#line default -#line hidden - WriteLiteral(" \t\r\n \r\n \r\n \r\n"); -#line 333 "LogPage.cshtml" - } - else if (activity.RepresentsScope) - { - -#line default -#line hidden - WriteLiteral(" \r\n"); -#line 337 "LogPage.cshtml" - } - else - { - -#line default -#line hidden - WriteLiteral(" \r\n"); -#line 341 "LogPage.cshtml" - } - - -#line default -#line hidden - WriteLiteral(@" \r\n \r\n \r\n"); -#line 395 "LogPage.cshtml" - } - -#line default -#line hidden - WriteLiteral(@"
PathMethodHostStatus CodeLogs
"); -#line 330 "LogPage.cshtml" - Write(activity.HttpInfo.Method); - -#line default -#line hidden - WriteLiteral(""); -#line 331 "LogPage.cshtml" - Write(activity.HttpInfo.Host); - -#line default -#line hidden - WriteLiteral(""); -#line 332 "LogPage.cshtml" - Write(activity.HttpInfo.StatusCode); - -#line default -#line hidden - WriteLiteral(" - - - - - - - - - - - -"); -#line 355 "LogPage.cshtml" - - var counts = new Dictionary(); - counts["Critical"] = 0; - counts["Error"] = 0; - counts["Warning"] = 0; - counts["Information"] = 0; - counts["Debug"] = 0; - - -#line default -#line hidden - WriteLiteral(" \r\n"); -#line 364 "LogPage.cshtml" - if (!activity.RepresentsScope) - { - // message not within a scope - var logInfo = activity.Root.Messages.FirstOrDefault(); - - -#line default -#line hidden -#line 368 "LogPage.cshtml" - Write(LogRow(logInfo, 0)); - -#line default -#line hidden -#line 368 "LogPage.cshtml" - - counts[logInfo.Severity.ToString()] = 1; - } - else - { - - -#line default -#line hidden -#line 373 "LogPage.cshtml" - Write(Traverse(activity.Root, 0, counts)); - -#line default -#line hidden -#line 373 "LogPage.cshtml" - - } - -#line default -#line hidden - WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 379 "LogPage.cshtml" - foreach (var kvp in counts) - { - if (string.Equals("Debug", kvp.Key)) { - -#line default -#line hidden - WriteLiteral(" \r\n"); -#line 383 "LogPage.cshtml" - } - else - { - -#line default -#line hidden - WriteLiteral(" \r\n"); -#line 387 "LogPage.cshtml" - } - } - -#line default -#line hidden - WriteLiteral(" \r\n \r\n
DateTimeNameSeverityStateError^
"); -#line 378 "LogPage.cshtml" - Write(activity.Time.ToString("MM-dd-yyyy HH:mm:ss")); - -#line default -#line hidden - WriteLiteral(""); -#line 382 "LogPage.cshtml" - Write(kvp.Value); - -#line default -#line hidden - WriteLiteral(" "); -#line 382 "LogPage.cshtml" - Write(kvp.Key); - -#line default -#line hidden - WriteLiteral("v"); -#line 386 "LogPage.cshtml" - Write(kvp.Value); - -#line default -#line hidden - WriteLiteral(" "); -#line 386 "LogPage.cshtml" - Write(kvp.Key); - -#line default -#line hidden - WriteLiteral("
\r\n
- - -"); - } - #pragma warning restore 1998 -#line 11 "LogPage.cshtml" - - public LogPage(LogPageModel model) - { - Model = model; - } - - public LogPageModel Model { get; set; } - - public HelperResult LogRow(LogInfo log, int level) - { - return new HelperResult((writer) => - { - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - PushWriter(writer); - WriteLiteral(" \r\n "); - Write(string.Format("{0:MM/dd/yy}", log.Time)); - - WriteLiteral("\r\n "); - Write(string.Format("{0:H:mm:ss}", log.Time)); - - WriteLiteral($"\r\n "); - Write(log.Name); - var severity = log.Severity.ToString().ToLowerInvariant(); - WriteLiteral($"\r\n "); - Write(log.Severity); - - WriteLiteral($"\r\n \r\n"); - - for (var i = 0; i < level; i++) - { - WriteLiteral(" \r\n"); - } - - WriteLiteral(" "); - Write(log.Message); - - WriteLiteral($"\r\n \r\n "); - - Write(log.Exception); - - WriteLiteral("\r\n \r\n"); - PopWriter(); - } - }); - } - - public HelperResult Traverse(ScopeNode node, int level, Dictionary counts) - { - return new HelperResult((writer) => { - PushWriter(writer); - - // print start of scope - Write(LogRow(new LogInfo() - { - Name = node.Name, - Time = node.StartTime, - Severity = LogLevel.Debug, - Message = "Beginning " + node.State, - }, level)); - - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - Write(LogRow(node.Messages[messageIndex], level)); - - counts[node.Messages[messageIndex].Severity.ToString()]++; - messageIndex++; - } - else - { - Write(Traverse(node.Children[childIndex], level + 1, counts)); - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - Write(LogRow(node.Messages[i], level)); - counts[node.Messages[i].Severity.ToString()]++; - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - Write(Traverse(node.Children[i], level + 1, counts)); - } - } - // print end of scope - Write(LogRow(new LogInfo() - { - Name = node.Name, - Time = node.EndTime, - Severity = LogLevel.Debug, - Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime) - }, level)); - - PopWriter(); - }); - } - -#line default -#line hidden - } -} -#pragma warning restore 1591 diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPage.cshtml b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPage.cshtml deleted file mode 100644 index 4209d6a100..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPage.cshtml +++ /dev/null @@ -1,267 +0,0 @@ -@using System -@using System.Collections.Generic -@using System.Globalization -@using System.Linq -@using Microsoft.AspNetCore.Diagnostics.Elm -@using Microsoft.AspNetCore.Diagnostics.Elm.RazorViews -@using Microsoft.Extensions.RazorViews -@using Microsoft.Extensions.Logging - -@functions -{ - public LogPage(LogPageModel model) - { - Model = model; - } - - public LogPageModel Model { get; set; } - - public HelperResult LogRow(LogInfo log, int level) - { - return new HelperResult((writer) => - { - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - PushWriter(writer); - WriteLiteral(" \r\n "); - Write(string.Format("{0:MM/dd/yy}", log.Time)); - - WriteLiteral("\r\n "); - Write(string.Format("{0:H:mm:ss}", log.Time)); - - WriteLiteral($"\r\n "); - Write(log.Name); - var severity = log.Severity.ToString().ToLowerInvariant(); - WriteLiteral($"\r\n "); - Write(log.Severity); - - WriteLiteral($"\r\n \r\n"); - - for (var i = 0; i < level; i++) - { - WriteLiteral(" \r\n"); - } - - WriteLiteral(" "); - Write(log.Message); - - WriteLiteral($"\r\n \r\n "); - - Write(log.Exception); - - WriteLiteral("\r\n \r\n"); - PopWriter(); - } - }); - } - - public HelperResult Traverse(ScopeNode node, int level, Dictionary counts) - { - return new HelperResult((writer) => { - PushWriter(writer); - - // print start of scope - Write(LogRow(new LogInfo() - { - Name = node.Name, - Time = node.StartTime, - Severity = LogLevel.Debug, - Message = "Beginning " + node.State, - }, level)); - - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - Write(LogRow(node.Messages[messageIndex], level)); - - counts[node.Messages[messageIndex].Severity.ToString()]++; - messageIndex++; - } - else - { - Write(Traverse(node.Children[childIndex], level + 1, counts)); - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - Write(LogRow(node.Messages[i], level)); - counts[node.Messages[i].Severity.ToString()]++; - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - Write(Traverse(node.Children[i], level + 1, counts)); - } - } - // print end of scope - Write(LogRow(new LogInfo() - { - Name = node.Name, - Time = node.EndTime, - Severity = LogLevel.Debug, - Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime) - }, level)); - - PopWriter(); - }); - } -} -@{ - Response.ContentType = "text/html; charset=utf-8"; -} - - - - - - ASP.NET Core Logs - - - - -

ASP.NET Core Logs

-
- - - -
-
- -
- - - - - - - - - - - - - - - - - - - @foreach (var activity in Model.Activities.Reverse()) - { - - - @{ - var activityPath = Model.Path.Value + "/" + activity.Id; - if (activity.HttpInfo != null) - { - - - - - } - else if (activity.RepresentsScope) - { - - } - else - { - - } - } - - - - } -
PathMethodHostStatus CodeLogs
@activity.HttpInfo.Path@activity.HttpInfo.Method@activity.HttpInfo.Host@activity.HttpInfo.StatusCode@activity.Root.StateNon-scope Log - - - - - - - - - - - - @{ - var counts = new Dictionary(); - counts["Critical"] = 0; - counts["Error"] = 0; - counts["Warning"] = 0; - counts["Information"] = 0; - counts["Debug"] = 0; - } - - @if (!activity.RepresentsScope) - { - // message not within a scope - var logInfo = activity.Root.Messages.FirstOrDefault(); - @LogRow(logInfo, 0) - counts[logInfo.Severity.ToString()] = 1; - } - else - { - @Traverse(activity.Root, 0, counts) - } - - - - - @foreach (var kvp in counts) - { - if (string.Equals("Debug", kvp.Key)) { - - } - else - { - - } - } - - -
DateTimeNameSeverityStateError^
@activity.Time.ToString("MM-dd-yyyy HH:mm:ss")@kvp.Value @kvp.Keyv@kvp.Value @kvp.Key
-
- - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPage.css b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPage.css deleted file mode 100644 index 420cc18121..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPage.css +++ /dev/null @@ -1,110 +0,0 @@ -body { - font-size: .813em; - white-space: nowrap; - margin: 20px; -} - -col:nth-child(2n) { - background-color: #FAFAFA; -} - -form { - display: inline-block; -} - -h1 { - margin-left: 25px; -} - -table { - margin: 0px auto; - border-collapse: collapse; - border-spacing: 0px; - table-layout: fixed; - width: 100%; -} - -td, th { - padding: 4px; -} - -thead { - font-size: 1em; - font-family: Arial; -} - -tr { - height: 23px; -} - -#requestHeader { - border-bottom: solid 1px gray; - border-top: solid 1px gray; - margin-bottom: 2px; - font-size: 1em; - line-height: 2em; -} - -.collapse { - color: black; - float: right; - font-weight: normal; - width: 1em; -} - -.date, .time { - width: 70px; -} - -.logHeader { - border-bottom: 1px solid lightgray; - color: gray; - text-align: left; -} - -.logState { - text-overflow: ellipsis; - overflow: hidden; -} - -.logTd { - border-left: 1px solid gray; - padding: 0px; -} - -.logs { - width: 80%; -} - -.logRow:hover { - background-color: #D6F5FF; -} - -.requestRow>td { - border-bottom: solid 1px gray; -} - -.severity { - width: 80px; -} - -.summary { - color: black; - line-height: 1.8em; -} - -.summary>th { - font-weight: normal; -} - -.tab { - margin-left: 30px; -} - -#viewOptions { - margin: 20px; -} - -#viewOptions > * { - margin: 5px; -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPageModel.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPageModel.cs deleted file mode 100644 index 46c20d9689..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/LogPageModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; -using Microsoft.AspNetCore.Http; - -namespace Microsoft.AspNetCore.Diagnostics.Elm.RazorViews -{ - public class LogPageModel - { - public IEnumerable Activities { get; set; } - - public ViewOptions Options { get; set; } - - public PathString Path { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPage.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPage.cs deleted file mode 100644 index df09b8eca9..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPage.cs +++ /dev/null @@ -1,512 +0,0 @@ -namespace Microsoft.AspNetCore.Diagnostics.Elm.Views -{ -#line 1 "DetailsPage.cshtml" -using System - -#line default -#line hidden - ; -#line 2 "DetailsPage.cshtml" -using System.Globalization - -#line default -#line hidden - ; -#line 3 "DetailsPage.cshtml" -using System.Linq - -#line default -#line hidden - ; -#line 4 "DetailsPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Elm - -#line default -#line hidden - ; -#line 5 "DetailsPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Elm.Views - -#line default -#line hidden - ; -#line 6 "DetailsPage.cshtml" -using Microsoft.AspNetCore.DiagnosticsViewPage.Views - -#line default -#line hidden - ; -#line 7 "DetailsPage.cshtml" -using Microsoft.Extensions.Logging - -#line default -#line hidden - ; - using System.Threading.Tasks; - [Obsolete("This type is for internal use only and will be removed in a future version.")] - public class DetailsPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView - { -#line 10 "DetailsPage.cshtml" - - public DetailsPage(DetailsPageModel model) - { - Model = model; - } - - public DetailsPageModel Model { get; set; } - - public HelperResult LogRow(LogInfo log) - { - return new HelperResult((writer) => - { - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - WriteLiteralTo(writer, " \r\n "); - WriteTo(writer, string.Format("{0:MM/dd/yy}", log.Time)); - WriteLiteralTo(writer, "\r\n "); - WriteTo(writer, string.Format("{0:H:mm:ss}", log.Time)); - var severity = log.Severity.ToString().ToLowerInvariant(); - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Severity); - - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Name); - - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Message); - - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Exception); - - WriteLiteralTo(writer, "\r\n \r\n"); - } - }); - } - - public HelperResult Traverse(ScopeNode node) - { - return new HelperResult((writer) => - { - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - LogRow(node.Messages[messageIndex]); - messageIndex++; - } - else - { - Traverse(node.Children[childIndex]); - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - LogRow(node.Messages[i]); - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - Traverse(node.Children[i]); - } - } - }); - } - -#line default -#line hidden - #line hidden - public DetailsPage() - { - } - - #pragma warning disable 1998 - public override async Task ExecuteAsync() - { - WriteLiteral("\r\n"); -#line 84 "DetailsPage.cshtml" - - Response.ContentType = "text/html"; - -#line default -#line hidden - - WriteLiteral(@" - - - - ASP.NET Core Logs - - - - -

ASP.NET Core Logs

-"); -#line 99 "DetailsPage.cshtml" - - -#line default -#line hidden - -#line 99 "DetailsPage.cshtml" - - var context = Model.Activity?.HttpInfo; - - -#line default -#line hidden - - WriteLiteral(" "); -#line 102 "DetailsPage.cshtml" - if (context != null) - { - -#line default -#line hidden - - WriteLiteral("

Request Details

\r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n - - - - \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Path"); -#line 110 "DetailsPage.cshtml" - Write(context.Path); - -#line default -#line hidden - WriteLiteral("
Host"); -#line 114 "DetailsPage.cshtml" - Write(context.Host); - -#line default -#line hidden - WriteLiteral("
Content Type"); -#line 118 "DetailsPage.cshtml" - Write(context.ContentType); - -#line default -#line hidden - WriteLiteral("
Method"); -#line 122 "DetailsPage.cshtml" - Write(context.Method); - -#line default -#line hidden - WriteLiteral("
Protocol"); -#line 126 "DetailsPage.cshtml" - Write(context.Protocol); - -#line default -#line hidden - WriteLiteral(@"
Headers - - - - - - - - -"); -#line 139 "DetailsPage.cshtml" - - -#line default -#line hidden - -#line 139 "DetailsPage.cshtml" - foreach (var header in context.Headers) - { - -#line default -#line hidden - - WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 145 "DetailsPage.cshtml" - } - -#line default -#line hidden - - WriteLiteral(" \r\n
VariableValue
"); -#line 142 "DetailsPage.cshtml" - Write(header.Key); - -#line default -#line hidden - WriteLiteral(""); -#line 143 "DetailsPage.cshtml" - Write(string.Join(";", header.Value)); - -#line default -#line hidden - WriteLiteral("
\r\n
Status Code"); -#line 152 "DetailsPage.cshtml" - Write(context.StatusCode); - -#line default -#line hidden - WriteLiteral("
User"); -#line 156 "DetailsPage.cshtml" - Write(context.User.Identity.Name); - -#line default -#line hidden - WriteLiteral("
Claims\r\n"); -#line 161 "DetailsPage.cshtml" - - -#line default -#line hidden - -#line 161 "DetailsPage.cshtml" - if (context.User.Claims.Any()) - { - -#line default -#line hidden - - WriteLiteral(@" - - - - - - - -"); -#line 171 "DetailsPage.cshtml" - - -#line default -#line hidden - -#line 171 "DetailsPage.cshtml" - foreach (var claim in context.User.Claims) - { - -#line default -#line hidden - - WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 177 "DetailsPage.cshtml" - } - -#line default -#line hidden - - WriteLiteral(" \r\n
IssuerValue
"); -#line 174 "DetailsPage.cshtml" - Write(claim.Issuer); - -#line default -#line hidden - WriteLiteral(""); -#line 175 "DetailsPage.cshtml" - Write(claim.Value); - -#line default -#line hidden - WriteLiteral("
\r\n"); -#line 180 "DetailsPage.cshtml" - } - -#line default -#line hidden - - WriteLiteral("
Scheme"); -#line 185 "DetailsPage.cshtml" - Write(context.Scheme); - -#line default -#line hidden - WriteLiteral("
Query"); -#line 189 "DetailsPage.cshtml" - Write(context.Query.Value); - -#line default -#line hidden - WriteLiteral("
Cookies\r\n"); -#line 194 "DetailsPage.cshtml" - - -#line default -#line hidden - -#line 194 "DetailsPage.cshtml" - if (context.Cookies.Any()) - { - -#line default -#line hidden - - WriteLiteral(@" - - - - - - - -"); -#line 204 "DetailsPage.cshtml" - - -#line default -#line hidden - -#line 204 "DetailsPage.cshtml" - foreach (var cookie in context.Cookies) - { - -#line default -#line hidden - - WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 210 "DetailsPage.cshtml" - } - -#line default -#line hidden - - WriteLiteral(" \r\n
VariableValue
"); -#line 207 "DetailsPage.cshtml" - Write(cookie.Key); - -#line default -#line hidden - WriteLiteral(""); -#line 208 "DetailsPage.cshtml" - Write(string.Join(";", cookie.Value)); - -#line default -#line hidden - WriteLiteral("
\r\n"); -#line 213 "DetailsPage.cshtml" - } - -#line default -#line hidden - - WriteLiteral("
\r\n"); -#line 217 "DetailsPage.cshtml" - } - -#line default -#line hidden - - WriteLiteral("

Logs

\r\n
\r\n \r\n - -
- - - - - - - - - - - - "); -#line 248 "DetailsPage.cshtml" - Write(Traverse(Model.Activity.Root)); - -#line default -#line hidden - WriteLiteral(@" -
DateTimeSeverityNameStateError
- - -"); - } - #pragma warning restore 1998 - } -} diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPage.cshtml b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPage.cshtml deleted file mode 100644 index db56b731e1..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPage.cshtml +++ /dev/null @@ -1,258 +0,0 @@ -@using System -@using System.Globalization -@using System.Linq -@using Microsoft.AspNetCore.Diagnostics.Elm -@using Microsoft.AspNetCore.Diagnostics.Elm.Views -@using Microsoft.AspNetCore.DiagnosticsViewPage.Views -@using Microsoft.Extensions.Logging - -@functions -{ - public DetailsPage(DetailsPageModel model) - { - Model = model; - } - - public DetailsPageModel Model { get; set; } - - public HelperResult LogRow(LogInfo log) - { - return new HelperResult((writer) => - { - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - WriteLiteralTo(writer, " \r\n "); - WriteTo(writer, string.Format("{0:MM/dd/yy}", log.Time)); - WriteLiteralTo(writer, "\r\n "); - WriteTo(writer, string.Format("{0:H:mm:ss}", log.Time)); - var severity = log.Severity.ToString().ToLowerInvariant(); - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Severity); - - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Name); - - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Message); - - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Exception); - - WriteLiteralTo(writer, "\r\n \r\n"); - } - }); - } - - public HelperResult Traverse(ScopeNode node) - { - return new HelperResult((writer) => - { - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - LogRow(node.Messages[messageIndex]); - messageIndex++; - } - else - { - Traverse(node.Children[childIndex]); - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - LogRow(node.Messages[i]); - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - Traverse(node.Children[i]); - } - } - }); - } -} -@{ - Response.ContentType = "text/html"; -} - - - - - ASP.NET Core Logs - - - - -

ASP.NET Core Logs

- @{ - var context = Model.Activity?.HttpInfo; - } - @if (context != null) - { -

Request Details

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Path@context.Path
Host@context.Host
Content Type@context.ContentType
Method@context.Method
Protocol@context.Protocol
Headers - - - - - - - - - @foreach (var header in context.Headers) - { - - - - - } - -
VariableValue
@header.Key@string.Join(";", header.Value)
-
Status Code@context.StatusCode
User@context.User.Identity.Name
Claims - @if (context.User.Claims.Any()) - { - - - - - - - - - @foreach (var claim in context.User.Claims) - { - - - - - } - -
IssuerValue
@claim.Issuer@claim.Value
- } -
Scheme@context.Scheme
Query@context.Query.Value
Cookies - @if (context.Cookies.Any()) - { - - - - - - - - - @foreach (var cookie in context.Cookies) - { - - - - - } - -
VariableValue
@cookie.Key@string.Join(";", cookie.Value)
- } -
- } -

Logs

-
- - - -
- - - - - - - - - - - - @Traverse(Model.Activity.Root) -
DateTimeSeverityNameStateError
- - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPage.css b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPage.css deleted file mode 100644 index d0803ebf3f..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPage.css +++ /dev/null @@ -1,56 +0,0 @@ -body { - font-size: 0.9em; - width: 90%; - margin: 0px auto; -} - -h1 { - padding-bottom: 10px; -} - -h2 { - font-weight: normal; -} - -table { - border-spacing: 0px; - width: 100%; - border-collapse: collapse; - border: 1px solid black; - white-space: pre-wrap; -} - -th { - font-family: Arial; -} - -td, th { - padding: 8px; -} - -#headerTable, #cookieTable { - border: none; - height: 100%; -} - -#headerTd { - white-space: normal; -} - -#label { - width: 20%; - border-right: 1px solid black; -} - -#logs{ - margin-top: 10px; - margin-bottom: 20px; -} - -#logs>tbody>tr>td { - border-right: 1px dashed lightgray; -} - -#logs>thead>tr>th { - border: 1px solid black; -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPageModel.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPageModel.cs deleted file mode 100644 index 5ae8e15579..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/DetailsPageModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace Microsoft.AspNetCore.Diagnostics.Elm.Views -{ - [Obsolete("This type is for internal use only and will be removed in a future version.")] - public class DetailsPageModel - { - public ActivityContext Activity { get; set; } - - public ViewOptions Options { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPage.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPage.cs deleted file mode 100644 index 4108ebe4db..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPage.cs +++ /dev/null @@ -1,579 +0,0 @@ -namespace Microsoft.AspNetCore.Diagnostics.Elm.Views -{ -#line 1 "LogPage.cshtml" -using System - -#line default -#line hidden - ; -#line 2 "LogPage.cshtml" -using System.Collections.Generic - -#line default -#line hidden - ; -#line 3 "LogPage.cshtml" -using System.Globalization - -#line default -#line hidden - ; -#line 4 "LogPage.cshtml" -using System.Linq - -#line default -#line hidden - ; -#line 5 "LogPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Elm - -#line default -#line hidden - ; -#line 6 "LogPage.cshtml" -using Microsoft.AspNetCore.Diagnostics.Elm.Views - -#line default -#line hidden - ; -#line 7 "LogPage.cshtml" -using Microsoft.AspNetCore.DiagnosticsViewPage.Views - -#line default -#line hidden - ; -#line 8 "LogPage.cshtml" -using Microsoft.Extensions.Logging - -#line default -#line hidden - ; - using System.Threading.Tasks; - [Obsolete("This type is for internal use only and will be removed in a future version.")] - public class LogPage : Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView - { -#line 11 "LogPage.cshtml" - - public LogPage(LogPageModel model) - { - Model = model; - } - - public LogPageModel Model { get; set; } - - public HelperResult LogRow(LogInfo log, int level) - { - return new HelperResult((writer) => - { - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - - WriteLiteralTo(writer, " \r\n "); - WriteTo(writer, string.Format("{0:MM/dd/yy}", log.Time)); - - WriteLiteralTo(writer, "\r\n "); - WriteTo(writer, string.Format("{0:H:mm:ss}", log.Time)); - - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Name); - var severity = log.Severity.ToString().ToLowerInvariant(); - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Severity); - - WriteLiteralTo(writer, $"\r\n \r\n"); - - for (var i = 0; i < level; i++) - { - WriteLiteralTo(writer, " \r\n"); - } - - WriteLiteralTo(writer, " "); - WriteTo(writer, log.Message); - - WriteLiteralTo(writer, $"\r\n \r\n "); - - WriteTo(writer, log.Exception); - - WriteLiteralTo(writer, "\r\n \r\n"); - - } - }); - } - - public HelperResult Traverse(ScopeNode node, int level, Dictionary counts) - { - return new HelperResult((writer) => { - // print start of scope - WriteTo(writer, LogRow(new LogInfo() - { - Name = node.Name, - Time = node.StartTime, - Severity = LogLevel.Debug, - Message = "Beginning " + node.State, - }, level)); - - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - WriteTo(writer, LogRow(node.Messages[messageIndex], level)); - - counts[node.Messages[messageIndex].Severity.ToString()]++; - messageIndex++; - } - else - { - WriteTo(writer, Traverse(node.Children[childIndex], level + 1, counts)); - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - WriteTo(writer, LogRow(node.Messages[i], level)); - counts[node.Messages[i].Severity.ToString()]++; - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - WriteTo(writer, Traverse(node.Children[i], level + 1, counts)); - } - } - // print end of scope - WriteTo(writer, LogRow(new LogInfo() - { - Name = node.Name, - Time = node.EndTime, - Severity = LogLevel.Debug, - Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime) - }, level)); - }); - } - -#line default -#line hidden - #line hidden - public LogPage() - { - } - - #pragma warning disable 1998 - public override async Task ExecuteAsync() - { - WriteLiteral("\r\n"); -#line 114 "LogPage.cshtml" - - Response.ContentType = "text/html"; - -#line default -#line hidden - - WriteLiteral(@" - - - - - ASP.NET Core Logs - - - - -

ASP.NET Core Logs

-
- \r\n - -
-
- -
- - - - - - - - - - - - - - - - - - -"); -#line 170 "LogPage.cshtml" - - -#line default -#line hidden - -#line 170 "LogPage.cshtml" - foreach (var activity in Model.Activities.Reverse()) - { - -#line default -#line hidden - - WriteLiteral(" \r\n \r\n"); -#line 174 "LogPage.cshtml" - - -#line default -#line hidden - -#line 174 "LogPage.cshtml" - - var activityPath = Model.Path.Value + "/" + activity.Id; - if (activity.HttpInfo != null) - { - -#line default -#line hidden - - WriteLiteral(" \t\r\n \r\n \r\n \r\n"); -#line 182 "LogPage.cshtml" - } - else if (activity.RepresentsScope) - { - -#line default -#line hidden - - WriteLiteral(" \r\n"); -#line 186 "LogPage.cshtml" - } - else - { - -#line default -#line hidden - - WriteLiteral(" \r\n"); -#line 190 "LogPage.cshtml" - } - - -#line default -#line hidden - - WriteLiteral(@" \r\n \r\n \r\n"); -#line 244 "LogPage.cshtml" - } - -#line default -#line hidden - - WriteLiteral(@"
PathMethodHostStatus CodeLogs
"); -#line 179 "LogPage.cshtml" - Write(activity.HttpInfo.Method); - -#line default -#line hidden - WriteLiteral(""); -#line 180 "LogPage.cshtml" - Write(activity.HttpInfo.Host); - -#line default -#line hidden - WriteLiteral(""); -#line 181 "LogPage.cshtml" - Write(activity.HttpInfo.StatusCode); - -#line default -#line hidden - WriteLiteral(" - - - - - - - - - - - -"); -#line 204 "LogPage.cshtml" - - -#line default -#line hidden - -#line 204 "LogPage.cshtml" - - var counts = new Dictionary(); - counts["Critical"] = 0; - counts["Error"] = 0; - counts["Warning"] = 0; - counts["Information"] = 0; - counts["Debug"] = 0; - - -#line default -#line hidden - - WriteLiteral(" \r\n"); -#line 213 "LogPage.cshtml" - - -#line default -#line hidden - -#line 213 "LogPage.cshtml" - if (!activity.RepresentsScope) - { - // message not within a scope - var logInfo = activity.Root.Messages.FirstOrDefault(); - - -#line default -#line hidden - -#line 217 "LogPage.cshtml" - Write(LogRow(logInfo, 0)); - -#line default -#line hidden -#line 217 "LogPage.cshtml" - - counts[logInfo.Severity.ToString()] = 1; - } - else - { - - -#line default -#line hidden - -#line 222 "LogPage.cshtml" - Write(Traverse(activity.Root, 0, counts)); - -#line default -#line hidden -#line 222 "LogPage.cshtml" - - } - -#line default -#line hidden - - WriteLiteral(" \r\n \r\n \r\n \r\n"); -#line 228 "LogPage.cshtml" - - -#line default -#line hidden - -#line 228 "LogPage.cshtml" - foreach (var kvp in counts) - { - if (string.Equals("Debug", kvp.Key)) { - -#line default -#line hidden - - WriteLiteral(" \r\n"); -#line 232 "LogPage.cshtml" - } - else - { - -#line default -#line hidden - - WriteLiteral(" \r\n"); -#line 236 "LogPage.cshtml" - } - } - -#line default -#line hidden - - WriteLiteral(" \r\n \r\n
DateTimeNameSeverityStateError^
"); -#line 227 "LogPage.cshtml" - Write(activity.Time.ToString("MM-dd-yyyy HH:mm:ss")); - -#line default -#line hidden - WriteLiteral(""); -#line 231 "LogPage.cshtml" - Write(kvp.Value); - -#line default -#line hidden - WriteLiteral(" "); -#line 231 "LogPage.cshtml" - Write(kvp.Key); - -#line default -#line hidden - WriteLiteral("v"); -#line 235 "LogPage.cshtml" - Write(kvp.Value); - -#line default -#line hidden - WriteLiteral(" "); -#line 235 "LogPage.cshtml" - Write(kvp.Key); - -#line default -#line hidden - WriteLiteral("
\r\n
- - -"); - } - #pragma warning restore 1998 - } -} diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPage.cshtml b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPage.cshtml deleted file mode 100644 index b8e356df46..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPage.cshtml +++ /dev/null @@ -1,263 +0,0 @@ -@using System -@using System.Collections.Generic -@using System.Globalization -@using System.Linq -@using Microsoft.AspNetCore.Diagnostics.Elm -@using Microsoft.AspNetCore.Diagnostics.Elm.Views -@using Microsoft.AspNetCore.DiagnosticsViewPage.Views -@using Microsoft.Extensions.Logging - -@functions -{ - public LogPage(LogPageModel model) - { - Model = model; - } - - public LogPageModel Model { get; set; } - - public HelperResult LogRow(LogInfo log, int level) - { - return new HelperResult((writer) => - { - if (log.Severity >= Model.Options.MinLevel && - (string.IsNullOrEmpty(Model.Options.NamePrefix) || log.Name.StartsWith(Model.Options.NamePrefix, StringComparison.Ordinal))) - { - - WriteLiteralTo(writer, " \r\n "); - WriteTo(writer, string.Format("{0:MM/dd/yy}", log.Time)); - - WriteLiteralTo(writer, "\r\n "); - WriteTo(writer, string.Format("{0:H:mm:ss}", log.Time)); - - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Name); - var severity = log.Severity.ToString().ToLowerInvariant(); - WriteLiteralTo(writer, $"\r\n "); - WriteTo(writer, log.Severity); - - WriteLiteralTo(writer, $"\r\n \r\n"); - - for (var i = 0; i < level; i++) - { - WriteLiteralTo(writer, " \r\n"); - } - - WriteLiteralTo(writer, " "); - WriteTo(writer, log.Message); - - WriteLiteralTo(writer, $"\r\n \r\n "); - - WriteTo(writer, log.Exception); - - WriteLiteralTo(writer, "\r\n \r\n"); - - } - }); - } - - public HelperResult Traverse(ScopeNode node, int level, Dictionary counts) - { - return new HelperResult((writer) => { - // print start of scope - WriteTo(writer, LogRow(new LogInfo() - { - Name = node.Name, - Time = node.StartTime, - Severity = LogLevel.Debug, - Message = "Beginning " + node.State, - }, level)); - - var messageIndex = 0; - var childIndex = 0; - while (messageIndex < node.Messages.Count && childIndex < node.Children.Count) - { - if (node.Messages[messageIndex].Time < node.Children[childIndex].StartTime) - { - WriteTo(writer, LogRow(node.Messages[messageIndex], level)); - - counts[node.Messages[messageIndex].Severity.ToString()]++; - messageIndex++; - } - else - { - WriteTo(writer, Traverse(node.Children[childIndex], level + 1, counts)); - childIndex++; - } - } - if (messageIndex < node.Messages.Count) - { - for (var i = messageIndex; i < node.Messages.Count; i++) - { - WriteTo(writer, LogRow(node.Messages[i], level)); - counts[node.Messages[i].Severity.ToString()]++; - } - } - else - { - for (var i = childIndex; i < node.Children.Count; i++) - { - WriteTo(writer, Traverse(node.Children[i], level + 1, counts)); - } - } - // print end of scope - WriteTo(writer, LogRow(new LogInfo() - { - Name = node.Name, - Time = node.EndTime, - Severity = LogLevel.Debug, - Message = string.Format("Completed {0} in {1}ms", node.State, node.EndTime - node.StartTime) - }, level)); - }); - } -} -@{ - Response.ContentType = "text/html"; -} - - - - - - ASP.NET Core Logs - - - - -

ASP.NET Core Logs

-
- - - -
-
- -
- - - - - - - - - - - - - - - - - - - @foreach (var activity in Model.Activities.Reverse()) - { - - - @{ - var activityPath = Model.Path.Value + "/" + activity.Id; - if (activity.HttpInfo != null) - { - - - - - } - else if (activity.RepresentsScope) - { - - } - else - { - - } - } - - - - } -
PathMethodHostStatus CodeLogs
@activity.HttpInfo.Path@activity.HttpInfo.Method@activity.HttpInfo.Host@activity.HttpInfo.StatusCode@activity.Root.StateNon-scope Log - - - - - - - - - - - - @{ - var counts = new Dictionary(); - counts["Critical"] = 0; - counts["Error"] = 0; - counts["Warning"] = 0; - counts["Information"] = 0; - counts["Debug"] = 0; - } - - @if (!activity.RepresentsScope) - { - // message not within a scope - var logInfo = activity.Root.Messages.FirstOrDefault(); - @LogRow(logInfo, 0) - counts[logInfo.Severity.ToString()] = 1; - } - else - { - @Traverse(activity.Root, 0, counts) - } - - - - - @foreach (var kvp in counts) - { - if (string.Equals("Debug", kvp.Key)) { - - } - else - { - - } - } - - -
DateTimeNameSeverityStateError^
@activity.Time.ToString("MM-dd-yyyy HH:mm:ss")@kvp.Value @kvp.Keyv@kvp.Value @kvp.Key
-
- - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPage.css b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPage.css deleted file mode 100644 index 420cc18121..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPage.css +++ /dev/null @@ -1,110 +0,0 @@ -body { - font-size: .813em; - white-space: nowrap; - margin: 20px; -} - -col:nth-child(2n) { - background-color: #FAFAFA; -} - -form { - display: inline-block; -} - -h1 { - margin-left: 25px; -} - -table { - margin: 0px auto; - border-collapse: collapse; - border-spacing: 0px; - table-layout: fixed; - width: 100%; -} - -td, th { - padding: 4px; -} - -thead { - font-size: 1em; - font-family: Arial; -} - -tr { - height: 23px; -} - -#requestHeader { - border-bottom: solid 1px gray; - border-top: solid 1px gray; - margin-bottom: 2px; - font-size: 1em; - line-height: 2em; -} - -.collapse { - color: black; - float: right; - font-weight: normal; - width: 1em; -} - -.date, .time { - width: 70px; -} - -.logHeader { - border-bottom: 1px solid lightgray; - color: gray; - text-align: left; -} - -.logState { - text-overflow: ellipsis; - overflow: hidden; -} - -.logTd { - border-left: 1px solid gray; - padding: 0px; -} - -.logs { - width: 80%; -} - -.logRow:hover { - background-color: #D6F5FF; -} - -.requestRow>td { - border-bottom: solid 1px gray; -} - -.severity { - width: 80px; -} - -.summary { - color: black; - line-height: 1.8em; -} - -.summary>th { - font-weight: normal; -} - -.tab { - margin-left: 30px; -} - -#viewOptions { - margin: 20px; -} - -#viewOptions > * { - margin: 5px; -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPageModel.cs b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPageModel.cs deleted file mode 100644 index 8041b21233..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/LogPageModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.AspNetCore.Http; - -namespace Microsoft.AspNetCore.Diagnostics.Elm.Views -{ - [Obsolete("This type is for internal use only and will be removed in a future version.")] - public class LogPageModel - { - public IEnumerable Activities { get; set; } - - public ViewOptions Options { get; set; } - - public PathString Path { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/Shared.css b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/Shared.css deleted file mode 100644 index 18c14c10d1..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Obsolete/Shared.css +++ /dev/null @@ -1,39 +0,0 @@ -body { - font-family: 'Segoe UI', Tahoma, Arial, Helvtica, sans-serif; - line-height: 1.4em; -} - -h1 { - font-family: 'Segoe UI', Helvetica, sans-serif; - font-size: 2.5em; -} - -td { - text-overflow: ellipsis; - overflow: hidden; -} - -tr:nth-child(2n) { - background-color: #F6F6F6; -} - -.critical { - background-color: red; - color: white; -} - -.error { - color: red; -} - -.information { - color: blue; -} - -.debug { - color: black; -} - -.warning { - color: orange; -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Shared.css b/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Shared.css deleted file mode 100644 index 18c14c10d1..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/Views/Shared.css +++ /dev/null @@ -1,39 +0,0 @@ -body { - font-family: 'Segoe UI', Tahoma, Arial, Helvtica, sans-serif; - line-height: 1.4em; -} - -h1 { - font-family: 'Segoe UI', Helvetica, sans-serif; - font-size: 2.5em; -} - -td { - text-overflow: ellipsis; - overflow: hidden; -} - -tr:nth-child(2n) { - background-color: #F6F6F6; -} - -.critical { - background-color: red; - color: white; -} - -.error { - color: red; -} - -.information { - color: blue; -} - -.debug { - color: black; -} - -.warning { - color: orange; -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Elm/baseline.netcore.json b/src/Microsoft.AspNetCore.Diagnostics.Elm/baseline.netcore.json deleted file mode 100644 index 40dd1cfb96..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics.Elm/baseline.netcore.json +++ /dev/null @@ -1,2347 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.AspNetCore.Diagnostics.Elm, Version=0.4.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - { - "Name": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.AttributeValue", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Prefix", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Value", - "Parameters": [], - "ReturnType": "System.Object", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Literal", - "Parameters": [], - "ReturnType": "System.Boolean", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "FromTuple", - "Parameters": [ - { - "Name": "value", - "Type": "System.Tuple" - } - ], - "ReturnType": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.AttributeValue", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "FromTuple", - "Parameters": [ - { - "Name": "value", - "Type": "System.Tuple" - } - ], - "ReturnType": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.AttributeValue", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "op_Implicit", - "Parameters": [ - { - "Name": "value", - "Type": "System.Tuple" - } - ], - "ReturnType": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.AttributeValue", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "prefix", - "Type": "System.String" - }, - { - "Name": "value", - "Type": "System.Object" - }, - { - "Name": "literal", - "Type": "System.Boolean" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Context", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.HttpContext", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Request", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.HttpRequest", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Response", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.HttpResponse", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Output", - "Parameters": [], - "ReturnType": "System.IO.StreamWriter", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_HtmlEncoder", - "Parameters": [], - "ReturnType": "System.Text.Encodings.Web.HtmlEncoder", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_HtmlEncoder", - "Parameters": [ - { - "Name": "value", - "Type": "System.Text.Encodings.Web.HtmlEncoder" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_UrlEncoder", - "Parameters": [], - "ReturnType": "System.Text.Encodings.Web.UrlEncoder", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_UrlEncoder", - "Parameters": [ - { - "Name": "value", - "Type": "System.Text.Encodings.Web.UrlEncoder" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_JavaScriptEncoder", - "Parameters": [], - "ReturnType": "System.Text.Encodings.Web.JavaScriptEncoder", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_JavaScriptEncoder", - "Parameters": [ - { - "Name": "value", - "Type": "System.Text.Encodings.Web.JavaScriptEncoder" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ExecuteAsync", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ExecuteAsync", - "Parameters": [], - "ReturnType": "System.Threading.Tasks.Task", - "Virtual": true, - "Abstract": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteLiteral", - "Parameters": [ - { - "Name": "value", - "Type": "System.Object" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteAttributeValue", - "Parameters": [ - { - "Name": "thingy", - "Type": "System.String" - }, - { - "Name": "startPostion", - "Type": "System.Int32" - }, - { - "Name": "value", - "Type": "System.Object" - }, - { - "Name": "endValue", - "Type": "System.Int32" - }, - { - "Name": "dealyo", - "Type": "System.Int32" - }, - { - "Name": "yesno", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "BeginWriteAttribute", - "Parameters": [ - { - "Name": "name", - "Type": "System.String" - }, - { - "Name": "begining", - "Type": "System.String" - }, - { - "Name": "startPosition", - "Type": "System.Int32" - }, - { - "Name": "ending", - "Type": "System.String" - }, - { - "Name": "endPosition", - "Type": "System.Int32" - }, - { - "Name": "thingy", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "EndWriteAttribute", - "Parameters": [], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteAttributeTo", - "Parameters": [ - { - "Name": "writer", - "Type": "System.IO.TextWriter" - }, - { - "Name": "name", - "Type": "System.String" - }, - { - "Name": "leader", - "Type": "System.String" - }, - { - "Name": "trailer", - "Type": "System.String" - }, - { - "Name": "values", - "Type": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.AttributeValue[]", - "IsParams": true - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Write", - "Parameters": [ - { - "Name": "value", - "Type": "System.Object" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Write", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Write", - "Parameters": [ - { - "Name": "result", - "Type": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.HelperResult" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteTo", - "Parameters": [ - { - "Name": "writer", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.Object" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteTo", - "Parameters": [ - { - "Name": "writer", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteLiteralTo", - "Parameters": [ - { - "Name": "writer", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.Object" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteLiteralTo", - "Parameters": [ - { - "Name": "writer", - "Type": "System.IO.TextWriter" - }, - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "HtmlEncodeAndReplaceLineBreaks", - "Parameters": [ - { - "Name": "input", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Protected", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.HelperResult", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_WriteAction", - "Parameters": [], - "ReturnType": "System.Action", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteTo", - "Parameters": [ - { - "Name": "writer", - "Type": "System.IO.TextWriter" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "action", - "Type": "System.Action" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.ElmExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "UseElmCapture", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UseElmPage", - "Parameters": [ - { - "Name": "app", - "Type": "Microsoft.AspNetCore.Builder.IApplicationBuilder" - } - ], - "ReturnType": "Microsoft.AspNetCore.Builder.IApplicationBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Id", - "Parameters": [], - "ReturnType": "System.Guid", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Id", - "Parameters": [ - { - "Name": "value", - "Type": "System.Guid" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_HttpInfo", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.HttpInfo", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_HttpInfo", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.HttpInfo" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Root", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ScopeNode", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Root", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ScopeNode" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Time", - "Parameters": [], - "ReturnType": "System.DateTimeOffset", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Time", - "Parameters": [ - { - "Name": "value", - "Type": "System.DateTimeOffset" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IsCollapsed", - "Parameters": [], - "ReturnType": "System.Boolean", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_IsCollapsed", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_RepresentsScope", - "Parameters": [], - "ReturnType": "System.Boolean", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_RepresentsScope", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ElmCaptureMiddleware", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Invoke", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "next", - "Type": "Microsoft.AspNetCore.Http.RequestDelegate" - }, - { - "Name": "factory", - "Type": "Microsoft.Extensions.Logging.ILoggerFactory" - }, - { - "Name": "options", - "Type": "Microsoft.Extensions.Options.IOptions" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ElmLogger", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.Extensions.Logging.ILogger" - ], - "Members": [ - { - "Kind": "Method", - "Name": "Log", - "Parameters": [ - { - "Name": "logLevel", - "Type": "Microsoft.Extensions.Logging.LogLevel" - }, - { - "Name": "eventId", - "Type": "Microsoft.Extensions.Logging.EventId" - }, - { - "Name": "state", - "Type": "T0" - }, - { - "Name": "exception", - "Type": "System.Exception" - }, - { - "Name": "formatter", - "Type": "System.Func" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.Extensions.Logging.ILogger", - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "TState", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "IsEnabled", - "Parameters": [ - { - "Name": "logLevel", - "Type": "Microsoft.Extensions.Logging.LogLevel" - } - ], - "ReturnType": "System.Boolean", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.Extensions.Logging.ILogger", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "BeginScope", - "Parameters": [ - { - "Name": "state", - "Type": "T0" - } - ], - "ReturnType": "System.IDisposable", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.Extensions.Logging.ILogger", - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "TState", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "name", - "Type": "System.String" - }, - { - "Name": "options", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ElmOptions" - }, - { - "Name": "store", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ElmStore" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ElmLoggerProvider", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.Extensions.Logging.ILoggerProvider" - ], - "Members": [ - { - "Kind": "Method", - "Name": "Dispose", - "Parameters": [], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "System.IDisposable", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateLogger", - "Parameters": [ - { - "Name": "name", - "Type": "System.String" - } - ], - "ReturnType": "Microsoft.Extensions.Logging.ILogger", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.Extensions.Logging.ILoggerProvider", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "store", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ElmStore" - }, - { - "Name": "options", - "Type": "Microsoft.Extensions.Options.IOptions" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ElmOptions", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Path", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.PathString", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Path", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.PathString" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Filter", - "Parameters": [], - "ReturnType": "System.Func", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Filter", - "Parameters": [ - { - "Name": "value", - "Type": "System.Func" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ElmPageMiddleware", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Invoke", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "next", - "Type": "Microsoft.AspNetCore.Http.RequestDelegate" - }, - { - "Name": "options", - "Type": "Microsoft.Extensions.Options.IOptions" - }, - { - "Name": "store", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ElmStore" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ElmScope", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Context", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Context", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Parent", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ElmScope", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Parent", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ElmScope" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Node", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ScopeNode", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Node", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ScopeNode" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Current", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ElmScope" - } - ], - "ReturnType": "System.Void", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Current", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ElmScope", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Push", - "Parameters": [ - { - "Name": "scope", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ElmScope" - }, - { - "Name": "store", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ElmStore" - } - ], - "ReturnType": "System.IDisposable", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "name", - "Type": "System.String" - }, - { - "Name": "state", - "Type": "System.Object" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ElmStore", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetActivities", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "AddActivity", - "Parameters": [ - { - "Name": "activity", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Clear", - "Parameters": [], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Count", - "Parameters": [], - "ReturnType": "System.Int32", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.HttpInfo", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_RequestID", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_RequestID", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Host", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.HostString", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Host", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.HostString" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Path", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.PathString", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Path", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.PathString" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ContentType", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ContentType", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Scheme", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Scheme", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_StatusCode", - "Parameters": [], - "ReturnType": "System.Int32", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_StatusCode", - "Parameters": [ - { - "Name": "value", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_User", - "Parameters": [], - "ReturnType": "System.Security.Claims.ClaimsPrincipal", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_User", - "Parameters": [ - { - "Name": "value", - "Type": "System.Security.Claims.ClaimsPrincipal" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Method", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Method", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Protocol", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Protocol", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Headers", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.IHeaderDictionary", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Headers", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.IHeaderDictionary" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Query", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.QueryString", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Query", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.QueryString" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Cookies", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.IRequestCookieCollection", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Cookies", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.IRequestCookieCollection" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.LogInfo", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_ActivityContext", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ActivityContext", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Name", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Name", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_State", - "Parameters": [], - "ReturnType": "System.Object", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_State", - "Parameters": [ - { - "Name": "value", - "Type": "System.Object" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Exception", - "Parameters": [], - "ReturnType": "System.Exception", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Exception", - "Parameters": [ - { - "Name": "value", - "Type": "System.Exception" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Message", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Message", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Severity", - "Parameters": [], - "ReturnType": "Microsoft.Extensions.Logging.LogLevel", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Severity", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.Extensions.Logging.LogLevel" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_EventID", - "Parameters": [], - "ReturnType": "System.Int32", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_EventID", - "Parameters": [ - { - "Name": "value", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Time", - "Parameters": [], - "ReturnType": "System.DateTimeOffset", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Time", - "Parameters": [ - { - "Name": "value", - "Type": "System.DateTimeOffset" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ScopeNode", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Parent", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ScopeNode", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Parent", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ScopeNode" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Children", - "Parameters": [], - "ReturnType": "System.Collections.Generic.List", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Messages", - "Parameters": [], - "ReturnType": "System.Collections.Generic.List", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_StartTime", - "Parameters": [], - "ReturnType": "System.DateTimeOffset", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_StartTime", - "Parameters": [ - { - "Name": "value", - "Type": "System.DateTimeOffset" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_EndTime", - "Parameters": [], - "ReturnType": "System.DateTimeOffset", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_EndTime", - "Parameters": [ - { - "Name": "value", - "Type": "System.DateTimeOffset" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_State", - "Parameters": [], - "ReturnType": "System.Object", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_State", - "Parameters": [ - { - "Name": "value", - "Type": "System.Object" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Name", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Name", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.ViewOptions", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_MinLevel", - "Parameters": [], - "ReturnType": "Microsoft.Extensions.Logging.LogLevel", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_MinLevel", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.Extensions.Logging.LogLevel" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_NamePrefix", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_NamePrefix", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.Views.DetailsPage", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Model", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.Views.DetailsPageModel", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Model", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.Views.DetailsPageModel" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "LogRow", - "Parameters": [ - { - "Name": "log", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.LogInfo" - } - ], - "ReturnType": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.HelperResult", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Traverse", - "Parameters": [ - { - "Name": "node", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ScopeNode" - } - ], - "ReturnType": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.HelperResult", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ExecuteAsync", - "Parameters": [], - "ReturnType": "System.Threading.Tasks.Task", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "model", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.Views.DetailsPageModel" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.Views.DetailsPageModel", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Activity", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Activity", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Options", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ViewOptions", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Options", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ViewOptions" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.Views.LogPage", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.BaseView", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Model", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.Views.LogPageModel", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Model", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.Views.LogPageModel" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "LogRow", - "Parameters": [ - { - "Name": "log", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.LogInfo" - }, - { - "Name": "level", - "Type": "System.Int32" - } - ], - "ReturnType": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.HelperResult", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Traverse", - "Parameters": [ - { - "Name": "node", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ScopeNode" - }, - { - "Name": "level", - "Type": "System.Int32" - }, - { - "Name": "counts", - "Type": "System.Collections.Generic.Dictionary" - } - ], - "ReturnType": "Microsoft.AspNetCore.DiagnosticsViewPage.Views.HelperResult", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ExecuteAsync", - "Parameters": [], - "ReturnType": "System.Threading.Tasks.Task", - "Virtual": true, - "Override": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "model", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.Views.LogPageModel" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.Views.LogPageModel", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Activities", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Activities", - "Parameters": [ - { - "Name": "value", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Options", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ViewOptions", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Options", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ViewOptions" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Path", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.PathString", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Path", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.PathString" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.RazorViews.DetailsPageModel", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Activity", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Activity", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ActivityContext" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Options", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ViewOptions", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Options", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ViewOptions" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Diagnostics.Elm.RazorViews.LogPageModel", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Activities", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Activities", - "Parameters": [ - { - "Name": "value", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Options", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Diagnostics.Elm.ViewOptions", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Options", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Diagnostics.Elm.ViewOptions" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Path", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.PathString", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Path", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Http.PathString" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.Extensions.DependencyInjection.ElmServiceCollectionExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "AddElm", - "Parameters": [ - { - "Name": "services", - "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection" - } - ], - "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "AddElm", - "Parameters": [ - { - "Name": "services", - "Type": "Microsoft.Extensions.DependencyInjection.IServiceCollection" - }, - { - "Name": "setupAction", - "Type": "System.Action" - } - ], - "ReturnType": "Microsoft.Extensions.DependencyInjection.IServiceCollection", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - } - ] -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics/Microsoft.AspNetCore.Diagnostics.csproj b/src/Microsoft.AspNetCore.Diagnostics/Microsoft.AspNetCore.Diagnostics.csproj deleted file mode 100644 index 373fd413f8..0000000000 --- a/src/Microsoft.AspNetCore.Diagnostics/Microsoft.AspNetCore.Diagnostics.csproj +++ /dev/null @@ -1,33 +0,0 @@ - - - - ASP.NET Core middleware for exception handling, exception display pages, and diagnostics information. Includes developer exception page middleware, exception handler middleware, runtime info middleware, status code page middleware, and welcome page middleware - netcoreapp3.0 - $(NoWarn);CS1591 - true - aspnetcore;diagnostics - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthCheckContext.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthCheckContext.cs deleted file mode 100644 index 027451c0d2..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthCheckContext.cs +++ /dev/null @@ -1,13 +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.Diagnostics.HealthChecks -{ - public sealed class HealthCheckContext - { - /// - /// Gets or sets the of the currently executing . - /// - public HealthCheckRegistration Registration { get; set; } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthCheckRegistration.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthCheckRegistration.cs deleted file mode 100644 index 9291c38846..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthCheckRegistration.cs +++ /dev/null @@ -1,132 +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; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - /// - /// Represent the registration information associated with an implementation. - /// - /// - /// - /// The health check registration is provided as a separate object so that application developers can customize - /// how health check implementations are configured. - /// - /// - /// The registration is provided to an implementation during execution through - /// . This allows a health check implementation to access named - /// options or perform other operations based on the registered name. - /// - /// - public sealed class HealthCheckRegistration - { - private Func _factory; - private string _name; - - /// - /// Creates a new for an existing instance. - /// - /// The health check name. - /// The instance. - /// - /// The that should be reported upon failure of the health check. If the provided value - /// is null, then will be reported. - /// - /// A list of tags that can be used for filtering health checks. - public HealthCheckRegistration(string name, IHealthCheck instance, HealthStatus? failureStatus, IEnumerable tags) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - Name = name; - FailureStatus = failureStatus ?? HealthStatus.Unhealthy; - Tags = new HashSet(tags ?? Array.Empty(), StringComparer.OrdinalIgnoreCase); - Factory = (_) => instance; - } - - /// - /// Creates a new for an existing instance. - /// - /// The health check name. - /// A delegate used to create the instance. - /// - /// The that should be reported when the health check reports a failure. If the provided value - /// is null, then will be reported. - /// - /// A list of tags that can be used for filtering health checks. - public HealthCheckRegistration( - string name, - Func factory, - HealthStatus? failureStatus, - IEnumerable tags) - { - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (factory == null) - { - throw new ArgumentNullException(nameof(factory)); - } - - Name = name; - FailureStatus = failureStatus ?? HealthStatus.Unhealthy; - Tags = new HashSet(tags ?? Array.Empty(), StringComparer.OrdinalIgnoreCase); - Factory = factory; - } - - /// - /// Gets or sets a delegate used to create the instance. - /// - public Func Factory - { - get => _factory; - set - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - _factory = value; - } - } - - /// - /// Gets or sets the that should be reported upon failure of the health check. - /// - public HealthStatus FailureStatus { get; set; } - - /// - /// Gets or sets the health check name. - /// - public string Name - { - get => _name; - set - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - _name = value; - } - } - - /// - /// Gets a list of tags that can be used for filtering health checks. - /// - public ISet Tags { get; } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthCheckResult.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthCheckResult.cs deleted file mode 100644 index e01cb5aceb..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthCheckResult.cs +++ /dev/null @@ -1,88 +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; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - /// - /// Represents the result of a health check. - /// - public struct HealthCheckResult - { - private static readonly IReadOnlyDictionary _emptyReadOnlyDictionary = new Dictionary(); - - /// - /// Creates a new with the specified values for , - /// , , and . - /// - /// A value indicating the status of the component that was checked. - /// A human-readable description of the status of the component that was checked. - /// An representing the exception that was thrown when checking for status (if any). - /// Additional key-value pairs describing the health of the component. - public HealthCheckResult(HealthStatus status, string description = null, Exception exception = null, IReadOnlyDictionary data = null) - { - Status = status; - Description = description; - Exception = exception; - Data = data ?? _emptyReadOnlyDictionary; - } - - /// - /// Gets additional key-value pairs describing the health of the component. - /// - public IReadOnlyDictionary Data { get; } - - /// - /// Gets a human-readable description of the status of the component that was checked. - /// - public string Description { get; } - - /// - /// Gets an representing the exception that was thrown when checking for status (if any). - /// - public Exception Exception { get; } - - /// - /// Gets a value indicating the status of the component that was checked. - /// - public HealthStatus Status { get; } - - /// - /// Creates a representing a healthy component. - /// - /// A human-readable description of the status of the component that was checked. Optional. - /// Additional key-value pairs describing the health of the component. Optional. - /// A representing a healthy component. - public static HealthCheckResult Healthy(string description = null, IReadOnlyDictionary data = null) - { - return new HealthCheckResult(status: HealthStatus.Healthy, description, exception: null, data); - } - - - /// - /// Creates a representing a degraded component. - /// - /// A human-readable description of the status of the component that was checked. Optional. - /// An representing the exception that was thrown when checking for status. Optional. - /// Additional key-value pairs describing the health of the component. Optional. - /// A representing a degraged component. - public static HealthCheckResult Degraded(string description = null, Exception exception = null, IReadOnlyDictionary data = null) - { - return new HealthCheckResult(status: HealthStatus.Degraded, description, exception: null, data); - } - - /// - /// Creates a representing an unhealthy component. - /// - /// A human-readable description of the status of the component that was checked. Optional. - /// An representing the exception that was thrown when checking for status. Optional. - /// Additional key-value pairs describing the health of the component. Optional. - /// A representing an unhealthy component. - public static HealthCheckResult Unhealthy(string description = null, Exception exception = null, IReadOnlyDictionary data = null) - { - return new HealthCheckResult(status: HealthStatus.Unhealthy, description, exception, data); - } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthReport.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthReport.cs deleted file mode 100644 index 91ed798811..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthReport.cs +++ /dev/null @@ -1,68 +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; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - /// - /// Represents the result of executing a group of instances. - /// - public sealed class HealthReport - { - /// - /// Create a new from the specified results. - /// - /// A containing the results from each health check. - /// A value indicating the time the health check service took to execute. - public HealthReport(IReadOnlyDictionary entries, TimeSpan totalDuration) - { - Entries = entries; - Status = CalculateAggregateStatus(entries.Values); - TotalDuration = totalDuration; - } - - /// - /// A containing the results from each health check. - /// - /// - /// The keys in this dictionary map the name of each executed health check to a for the - /// result data retruned from the corresponding health check. - /// - public IReadOnlyDictionary Entries { get; } - - /// - /// Gets a representing the aggregate status of all the health checks. The value of - /// will be the most servere status reported by a health check. If no checks were executed, the value is always . - /// - public HealthStatus Status { get; } - - /// - /// Gets the time the health check service took to execute. - /// - public TimeSpan TotalDuration { get; } - - private HealthStatus CalculateAggregateStatus(IEnumerable entries) - { - // This is basically a Min() check, but we know the possible range, so we don't need to walk the whole list - var currentValue = HealthStatus.Healthy; - foreach (var entry in entries) - { - if (currentValue > entry.Status) - { - currentValue = entry.Status; - } - - if (currentValue == HealthStatus.Unhealthy) - { - // Game over, man! Game over! - // (We hit the worst possible status, so there's no need to keep iterating) - return currentValue; - } - } - - return currentValue; - } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthReportEntry.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthReportEntry.cs deleted file mode 100644 index 6e7d6c6b8e..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthReportEntry.cs +++ /dev/null @@ -1,59 +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; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - /// - /// Represents an entry in a . Corresponds to the result of a single . - /// - public struct HealthReportEntry - { - private static readonly IReadOnlyDictionary _emptyReadOnlyDictionary = new Dictionary(); - - /// - /// Creates a new with the specified values for , , - /// , and . - /// - /// A value indicating the health status of the component that was checked. - /// A human-readable description of the status of the component that was checked. - /// A value indicating the health execution duration. - /// An representing the exception that was thrown when checking for status (if any). - /// Additional key-value pairs describing the health of the component. - public HealthReportEntry(HealthStatus status, string description, TimeSpan duration, Exception exception, IReadOnlyDictionary data) - { - Status = status; - Description = description; - Duration = duration; - Exception = exception; - Data = data ?? _emptyReadOnlyDictionary; - } - - /// - /// Gets additional key-value pairs describing the health of the component. - /// - public IReadOnlyDictionary Data { get; } - - /// - /// Gets a human-readable description of the status of the component that was checked. - /// - public string Description { get; } - - /// - /// Gets the health check execution duration. - /// - public TimeSpan Duration { get; } - - /// - /// Gets an representing the exception that was thrown when checking for status (if any). - /// - public Exception Exception { get; } - - /// - /// Gets the health status of the component that was checked. - /// - public HealthStatus Status { get; } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthStatus.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthStatus.cs deleted file mode 100644 index 61b76d54fa..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/HealthStatus.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. - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - /// - /// Represents the reported status of a health check result. - /// - /// - /// - /// A status of should be considered the default value for a failing health check. Application - /// developers may configure a health check to report a different status as desired. - /// - /// - /// The values of this enum or ordered from least healthy to most healthy. So is - /// greater than but less than . - /// - /// - public enum HealthStatus - { - /// - /// Indicates that the health check determined that the component was unhealthy, or an unhandled - /// exception was thrown while executing the health check. - /// - Unhealthy = 0, - - /// - /// Indicates that the health check determined that the component was in a degraded state. - /// - Degraded = 1, - - /// - /// Indicates that the health check determined that the component was healthy. - /// - Healthy = 2, - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/IHealthCheck.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/IHealthCheck.cs deleted file mode 100644 index 1b69953b67..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/IHealthCheck.cs +++ /dev/null @@ -1,23 +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.Diagnostics.HealthChecks -{ - /// - /// Represents a health check, which can be used to check the status of a component in the application, such as a backend service, database or some internal - /// state. - /// - public interface IHealthCheck - { - /// - /// Runs the health check, returning the status of the component being checked. - /// - /// A context object associated with the current execution. - /// A that can be used to cancel the health check. - /// A that completes when the health check has finished, yielding the status of the component being checked. - Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default); - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/IHealthCheckPublisher.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/IHealthCheckPublisher.cs deleted file mode 100644 index f1809c4bb8..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/IHealthCheckPublisher.cs +++ /dev/null @@ -1,39 +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.Diagnostics.HealthChecks -{ - /// - /// Represents a publisher of information. - /// - /// - /// - /// The default health checks implementation provided an IHostedService implementation that can - /// be used to execute health checks at regular intervals and provide the resulting - /// data to all registered instances. - /// - /// - /// To provide an implementation, register an instance or type as a singleton - /// service in the dependency injection container. - /// - /// - /// instances are provided with a after executing - /// health checks in a background thread. The use of depend on hosting in - /// an application using IWebHost or generic host (IHost). Execution of - /// instance is not related to execution of health checks via a middleware. - /// - /// - public interface IHealthCheckPublisher - { - /// - /// Publishes the provided . - /// - /// The . The result of executing a set of health checks. - /// The . - /// A which will complete when publishing is complete. - Task PublishAsync(HealthReport report, CancellationToken cancellationToken); - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.csproj b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.csproj deleted file mode 100644 index bcbc46c8ca..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - Abstractions for defining health checks in .NET applications - -Commonly Used Types -Microsoft.Extensions.Diagnostics.HealthChecks.IHealthCheck - - Microsoft.Extensions.Diagnostics.HealthChecks - netstandard2.0 - $(NoWarn);CS1591 - true - diagnostics;healthchecks - - - diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/baseline.netcore.json b/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/baseline.netcore.json deleted file mode 100644 index 871db4c089..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions/baseline.netcore.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - ] -} \ No newline at end of file diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DefaultHealthCheckService.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/DefaultHealthCheckService.cs deleted file mode 100644 index d5d71d9cb4..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DefaultHealthCheckService.cs +++ /dev/null @@ -1,304 +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.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Internal; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - internal class DefaultHealthCheckService : HealthCheckService - { - private readonly IServiceScopeFactory _scopeFactory; - private readonly IOptions _options; - private readonly ILogger _logger; - - public DefaultHealthCheckService( - IServiceScopeFactory scopeFactory, - IOptions options, - ILogger logger) - { - _scopeFactory = scopeFactory ?? throw new ArgumentNullException(nameof(scopeFactory)); - _options = options ?? throw new ArgumentNullException(nameof(options)); - _logger = logger ?? throw new ArgumentNullException(nameof(logger)); - - // We're specifically going out of our way to do this at startup time. We want to make sure you - // get any kind of health-check related error as early as possible. Waiting until someone - // actually tries to **run** health checks would be real baaaaad. - ValidateRegistrations(_options.Value.Registrations); - } - public override async Task CheckHealthAsync( - Func predicate, - CancellationToken cancellationToken = default) - { - var registrations = _options.Value.Registrations; - - using (var scope = _scopeFactory.CreateScope()) - { - var context = new HealthCheckContext(); - var entries = new Dictionary(StringComparer.OrdinalIgnoreCase); - - var totalTime = ValueStopwatch.StartNew(); - Log.HealthCheckProcessingBegin(_logger); - - foreach (var registration in registrations) - { - if (predicate != null && !predicate(registration)) - { - continue; - } - - cancellationToken.ThrowIfCancellationRequested(); - - var healthCheck = registration.Factory(scope.ServiceProvider); - - // If the health check does things like make Database queries using EF or backend HTTP calls, - // it may be valuable to know that logs it generates are part of a health check. So we start a scope. - using (_logger.BeginScope(new HealthCheckLogScope(registration.Name))) - { - var stopwatch = ValueStopwatch.StartNew(); - context.Registration = registration; - - Log.HealthCheckBegin(_logger, registration); - - HealthReportEntry entry; - try - { - var result = await healthCheck.CheckHealthAsync(context, cancellationToken); - var duration = stopwatch.GetElapsedTime(); - - entry = new HealthReportEntry( - status: result.Status, - description: result.Description, - duration: duration, - exception: result.Exception, - data: result.Data); - - Log.HealthCheckEnd(_logger, registration, entry, duration); - Log.HealthCheckData(_logger, registration, entry); - } - - // Allow cancellation to propagate. - catch (Exception ex) when (ex as OperationCanceledException == null) - { - var duration = stopwatch.GetElapsedTime(); - entry = new HealthReportEntry( - status: HealthStatus.Unhealthy, - description: ex.Message, - duration: duration, - exception: ex, - data: null); - - Log.HealthCheckError(_logger, registration, ex, duration); - } - - entries[registration.Name] = entry; - } - } - - var totalElapsedTime = totalTime.GetElapsedTime(); - var report = new HealthReport(entries, totalElapsedTime); - Log.HealthCheckProcessingEnd(_logger, report.Status, totalElapsedTime); - return report; - } - } - - private static void ValidateRegistrations(IEnumerable registrations) - { - // Scan the list for duplicate names to provide a better error if there are duplicates. - var duplicateNames = registrations - .GroupBy(c => c.Name, StringComparer.OrdinalIgnoreCase) - .Where(g => g.Count() > 1) - .Select(g => g.Key) - .ToList(); - - if (duplicateNames.Count > 0) - { - throw new ArgumentException($"Duplicate health checks were registered with the name(s): {string.Join(", ", duplicateNames)}", nameof(registrations)); - } - } - - internal static class EventIds - { - public static readonly EventId HealthCheckProcessingBegin = new EventId(100, "HealthCheckProcessingBegin"); - public static readonly EventId HealthCheckProcessingEnd = new EventId(101, "HealthCheckProcessingEnd"); - - public static readonly EventId HealthCheckBegin = new EventId(102, "HealthCheckBegin"); - public static readonly EventId HealthCheckEnd = new EventId(103, "HealthCheckEnd"); - public static readonly EventId HealthCheckError = new EventId(104, "HealthCheckError"); - public static readonly EventId HealthCheckData = new EventId(105, "HealthCheckData"); - } - - private static class Log - { - private static readonly Action _healthCheckProcessingBegin = LoggerMessage.Define( - LogLevel.Debug, - EventIds.HealthCheckProcessingBegin, - "Running health checks"); - - private static readonly Action _healthCheckProcessingEnd = LoggerMessage.Define( - LogLevel.Debug, - EventIds.HealthCheckProcessingEnd, - "Health check processing completed after {ElapsedMilliseconds}ms with combined status {HealthStatus}"); - - private static readonly Action _healthCheckBegin = LoggerMessage.Define( - LogLevel.Debug, - EventIds.HealthCheckBegin, - "Running health check {HealthCheckName}"); - - // These are separate so they can have different log levels - private static readonly string HealthCheckEndText = "Health check {HealthCheckName} completed after {ElapsedMilliseconds}ms with status {HealthStatus} and '{HealthCheckDescription}'"; - - private static readonly Action _healthCheckEndHealthy = LoggerMessage.Define( - LogLevel.Debug, - EventIds.HealthCheckEnd, - HealthCheckEndText); - - private static readonly Action _healthCheckEndDegraded = LoggerMessage.Define( - LogLevel.Warning, - EventIds.HealthCheckEnd, - HealthCheckEndText); - - private static readonly Action _healthCheckEndUnhealthy = LoggerMessage.Define( - LogLevel.Error, - EventIds.HealthCheckEnd, - HealthCheckEndText); - - private static readonly Action _healthCheckEndFailed = LoggerMessage.Define( - LogLevel.Error, - EventIds.HealthCheckEnd, - HealthCheckEndText); - - private static readonly Action _healthCheckError = LoggerMessage.Define( - LogLevel.Error, - EventIds.HealthCheckError, - "Health check {HealthCheckName} threw an unhandled exception after {ElapsedMilliseconds}ms"); - - public static void HealthCheckProcessingBegin(ILogger logger) - { - _healthCheckProcessingBegin(logger, null); - } - - public static void HealthCheckProcessingEnd(ILogger logger, HealthStatus status, TimeSpan duration) - { - _healthCheckProcessingEnd(logger, duration.TotalMilliseconds, status, null); - } - - public static void HealthCheckBegin(ILogger logger, HealthCheckRegistration registration) - { - _healthCheckBegin(logger, registration.Name, null); - } - - public static void HealthCheckEnd(ILogger logger, HealthCheckRegistration registration, HealthReportEntry entry, TimeSpan duration) - { - switch (entry.Status) - { - case HealthStatus.Healthy: - _healthCheckEndHealthy(logger, registration.Name, duration.TotalMilliseconds, entry.Status, entry.Description, null); - break; - - case HealthStatus.Degraded: - _healthCheckEndDegraded(logger, registration.Name, duration.TotalMilliseconds, entry.Status, entry.Description, null); - break; - - case HealthStatus.Unhealthy: - _healthCheckEndUnhealthy(logger, registration.Name, duration.TotalMilliseconds, entry.Status, entry.Description, null); - break; - } - } - - public static void HealthCheckError(ILogger logger, HealthCheckRegistration registration, Exception exception, TimeSpan duration) - { - _healthCheckError(logger, registration.Name, duration.TotalMilliseconds, exception); - } - - public static void HealthCheckData(ILogger logger, HealthCheckRegistration registration, HealthReportEntry entry) - { - if (entry.Data.Count > 0 && logger.IsEnabled(LogLevel.Debug)) - { - logger.Log( - LogLevel.Debug, - EventIds.HealthCheckData, - new HealthCheckDataLogValue(registration.Name, entry.Data), - null, - (state, ex) => state.ToString()); - } - } - } - - internal class HealthCheckDataLogValue : IReadOnlyList> - { - private readonly string _name; - private readonly List> _values; - - private string _formatted; - - public HealthCheckDataLogValue(string name, IReadOnlyDictionary values) - { - _name = name; - _values = values.ToList(); - - // We add the name as a kvp so that you can filter by health check name in the logs. - // This is the same parameter name used in the other logs. - _values.Add(new KeyValuePair("HealthCheckName", name)); - } - - public KeyValuePair this[int index] - { - get - { - if (index < 0 || index >= Count) - { - throw new IndexOutOfRangeException(nameof(index)); - } - - return _values[index]; - } - } - - public int Count => _values.Count; - - public IEnumerator> GetEnumerator() - { - return _values.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return _values.GetEnumerator(); - } - - public override string ToString() - { - if (_formatted == null) - { - var builder = new StringBuilder(); - builder.AppendLine($"Health check data for {_name}:"); - - var values = _values; - for (var i = 0; i < values.Count; i++) - { - var kvp = values[i]; - builder.Append(" "); - builder.Append(kvp.Key); - builder.Append(": "); - - builder.AppendLine(kvp.Value?.ToString()); - } - - _formatted = builder.ToString(); - } - - return _formatted; - } - } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DelegateHealthCheck.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/DelegateHealthCheck.cs deleted file mode 100644 index 94069fd7d1..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DelegateHealthCheck.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 System; -using System.Threading; -using System.Threading.Tasks; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - /// - /// A simple implementation of which uses a provided delegate to - /// implement the check. - /// - internal sealed class DelegateHealthCheck : IHealthCheck - { - private readonly Func> _check; - - /// - /// Create an instance of from the specified delegate. - /// - /// A delegate which provides the code to execute when the health check is run. - public DelegateHealthCheck(Func> check) - { - _check = check ?? throw new ArgumentNullException(nameof(check)); - } - - /// - /// Runs the health check, returning the status of the component being checked. - /// - /// A context object associated with the current execution. - /// A that can be used to cancel the health check. - /// A that completes when the health check has finished, yielding the status of the component being checked. - public Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) => _check(cancellationToken); - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthCheckServiceCollectionExtensions.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthCheckServiceCollectionExtensions.cs deleted file mode 100644 index d6df03d2ae..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthCheckServiceCollectionExtensions.cs +++ /dev/null @@ -1,33 +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.DependencyInjection.Extensions; -using Microsoft.Extensions.Diagnostics.HealthChecks; -using Microsoft.Extensions.Hosting; - -namespace Microsoft.Extensions.DependencyInjection -{ - /// - /// Provides extension methods for registering in an . - /// - public static class HealthCheckServiceCollectionExtensions - { - /// - /// Adds the to the container, using the provided delegate to register - /// health checks. - /// - /// - /// This operation is idempotent - multiple invocations will still only result in a single - /// instance in the . It can be invoked - /// multiple times in order to get access to the in multiple places. - /// - /// The to add the to. - /// An instance of from which health checks can be registered. - public static IHealthChecksBuilder AddHealthChecks(this IServiceCollection services) - { - services.TryAddSingleton(); - services.TryAddSingleton(); - return new HealthChecksBuilder(services); - } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthChecksBuilder.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthChecksBuilder.cs deleted file mode 100644 index 231dd51717..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthChecksBuilder.cs +++ /dev/null @@ -1,33 +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.Diagnostics.HealthChecks; - -namespace Microsoft.Extensions.DependencyInjection -{ - internal class HealthChecksBuilder : IHealthChecksBuilder - { - public HealthChecksBuilder(IServiceCollection services) - { - Services = services; - } - - public IServiceCollection Services { get; } - - public IHealthChecksBuilder Add(HealthCheckRegistration registration) - { - if (registration == null) - { - throw new ArgumentNullException(nameof(registration)); - } - - Services.Configure(options => - { - options.Registrations.Add(registration); - }); - - return this; - } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthChecksBuilderAddCheckExtensions.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthChecksBuilderAddCheckExtensions.cs deleted file mode 100644 index 9508889054..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthChecksBuilderAddCheckExtensions.cs +++ /dev/null @@ -1,191 +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.Diagnostics.HealthChecks; - -namespace Microsoft.Extensions.DependencyInjection -{ - /// - /// Provides basic extension methods for registering instances in an . - /// - public static class HealthChecksBuilderAddCheckExtensions - { - /// - /// Adds a new health check with the specified name and implementation. - /// - /// The . - /// The name of the health check. - /// An instance. - /// - /// The that should be reported when the health check reports a failure. If the provided value - /// is null, then will be reported. - /// - /// A list of tags that can be used to filter health checks. - /// The . - public static IHealthChecksBuilder AddCheck( - this IHealthChecksBuilder builder, - string name, - IHealthCheck instance, - HealthStatus? failureStatus = null, - IEnumerable tags = null) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (instance == null) - { - throw new ArgumentNullException(nameof(instance)); - } - - return builder.Add(new HealthCheckRegistration(name, instance, failureStatus, tags)); - } - - /// - /// Adds a new health check with the specified name and implementation. - /// - /// The health check implementation type. - /// The . - /// The name of the health check. - /// - /// The that should be reported when the health check reports a failure. If the provided value - /// is null, then will be reported. - /// - /// A list of tags that can be used to filter health checks. - /// The . - /// - /// This method will use to create the health check - /// instance when needed. If a service of type is registred in the dependency injection container - /// with any liftime it will be used. Otherwise an instance of type will be constructed with - /// access to services from the dependency injection container. - /// - public static IHealthChecksBuilder AddCheck( - this IHealthChecksBuilder builder, - string name, - HealthStatus? failureStatus = null, - IEnumerable tags = null) where T : class, IHealthCheck - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - return builder.Add(new HealthCheckRegistration(name, s => ActivatorUtilities.GetServiceOrCreateInstance(s), failureStatus, tags)); - } - - // NOTE: AddTypeActivatedCheck has overloads rather than default parameters values, because default parameter values don't - // play super well with params. - - /// - /// Adds a new type activated health check with the specified name and implementation. - /// - /// The health check implementation type. - /// The . - /// The name of the health check. - /// Additional arguments to provide to the constructor. - /// The . - /// - /// This method will use to create the health check - /// instance when needed. Additional arguments can be provided to the constructor via . - /// - public static IHealthChecksBuilder AddTypeActivatedCheck(this IHealthChecksBuilder builder, string name, params object[] args) where T : class, IHealthCheck - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - return AddTypeActivatedCheck(builder, name, failureStatus: null, tags: null); - } - - /// - /// Adds a new type activated health check with the specified name and implementation. - /// - /// The health check implementation type. - /// The . - /// The name of the health check. - /// - /// The that should be reported when the health check reports a failure. If the provided value - /// is null, then will be reported. - /// - /// Additional arguments to provide to the constructor. - /// The . - /// - /// This method will use to create the health check - /// instance when needed. Additional arguments can be provided to the constructor via . - /// - public static IHealthChecksBuilder AddTypeActivatedCheck( - this IHealthChecksBuilder builder, - string name, - HealthStatus? failureStatus, - params object[] args) where T : class, IHealthCheck - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - return AddTypeActivatedCheck(builder, name, failureStatus, tags: null); - } - - /// - /// Adds a new type activated health check with the specified name and implementation. - /// - /// The health check implementation type. - /// The . - /// The name of the health check. - /// - /// The that should be reported when the health check reports a failure. If the provided value - /// is null, then will be reported. - /// - /// A list of tags that can be used to filter health checks. - /// Additional arguments to provide to the constructor. - /// The . - /// - /// This method will use to create the health check - /// instance when needed. Additional arguments can be provided to the constructor via . - /// - public static IHealthChecksBuilder AddTypeActivatedCheck( - this IHealthChecksBuilder builder, - string name, - HealthStatus? failureStatus, - IEnumerable tags, - params object[] args) where T : class, IHealthCheck - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - return builder.Add(new HealthCheckRegistration(name, s => ActivatorUtilities.CreateInstance(s, args), failureStatus, tags)); - } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthChecksBuilderDelegateExtensions.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthChecksBuilderDelegateExtensions.cs deleted file mode 100644 index d7dfdd90ae..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/HealthChecksBuilderDelegateExtensions.cs +++ /dev/null @@ -1,149 +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.Diagnostics.HealthChecks; - -namespace Microsoft.Extensions.DependencyInjection -{ - /// - /// Provides extension methods for registering delegates with the . - /// - public static class HealthChecksBuilderDelegateExtensions - { - /// - /// Adds a new health check with the specified name and implementation. - /// - /// The . - /// The name of the health check. - /// A list of tags that can be used to filter health checks. - /// A delegate that provides the health check implementation. - /// The . - public static IHealthChecksBuilder AddCheck( - this IHealthChecksBuilder builder, - string name, - Func check, - IEnumerable tags = null) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (check == null) - { - throw new ArgumentNullException(nameof(check)); - } - - var instance = new DelegateHealthCheck((ct) => Task.FromResult(check())); - return builder.Add(new HealthCheckRegistration(name, instance, failureStatus: null, tags)); - } - - /// - /// Adds a new health check with the specified name and implementation. - /// - /// The . - /// The name of the health check. - /// A list of tags that can be used to filter health checks. - /// A delegate that provides the health check implementation. - /// The . - public static IHealthChecksBuilder AddCheck( - this IHealthChecksBuilder builder, - string name, - Func check, - IEnumerable tags = null) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (check == null) - { - throw new ArgumentNullException(nameof(check)); - } - - var instance = new DelegateHealthCheck((ct) => Task.FromResult(check(ct))); - return builder.Add(new HealthCheckRegistration(name, instance, failureStatus: null, tags)); - } - - /// - /// Adds a new health check with the specified name and implementation. - /// - /// The . - /// The name of the health check. - /// A list of tags that can be used to filter health checks. - /// A delegate that provides the health check implementation. - /// The . - public static IHealthChecksBuilder AddAsyncCheck( - this IHealthChecksBuilder builder, - string name, - Func> check, - IEnumerable tags = null) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (check == null) - { - throw new ArgumentNullException(nameof(check)); - } - - var instance = new DelegateHealthCheck((ct) => check()); - return builder.Add(new HealthCheckRegistration(name, instance, failureStatus: null, tags)); - } - - /// - /// Adds a new health check with the specified name and implementation. - /// - /// The . - /// The name of the health check. - /// A list of tags that can be used to filter health checks. - /// A delegate that provides the health check implementation. - /// The . - public static IHealthChecksBuilder AddAsyncCheck( - this IHealthChecksBuilder builder, - string name, - Func> check, - IEnumerable tags = null) - { - if (builder == null) - { - throw new ArgumentNullException(nameof(builder)); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (check == null) - { - throw new ArgumentNullException(nameof(check)); - } - - var instance = new DelegateHealthCheck((ct) => check(ct)); - return builder.Add(new HealthCheckRegistration(name, instance, failureStatus: null, tags)); - } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/IHealthChecksBuilder.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/IHealthChecksBuilder.cs deleted file mode 100644 index eb78293f87..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/DependencyInjection/IHealthChecksBuilder.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 Microsoft.Extensions.Diagnostics.HealthChecks; - -namespace Microsoft.Extensions.DependencyInjection -{ - /// - /// A builder used to register health checks. - /// - public interface IHealthChecksBuilder - { - /// - /// Adds a for a health check. - /// - /// The . - IHealthChecksBuilder Add(HealthCheckRegistration registration); - - /// - /// Gets the into which instances should be registered. - /// - IServiceCollection Services { get; } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckLogScope.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckLogScope.cs deleted file mode 100644 index c7ef3ff5bd..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckLogScope.cs +++ /dev/null @@ -1,48 +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; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - internal class HealthCheckLogScope : IReadOnlyList> - { - public string HealthCheckName { get; } - - int IReadOnlyCollection>.Count { get; } = 1; - - KeyValuePair IReadOnlyList>.this[int index] - { - get - { - if (index == 0) - { - return new KeyValuePair(nameof(HealthCheckName), HealthCheckName); - } - - throw new ArgumentOutOfRangeException(nameof(index)); - } - } - - /// - /// Creates a new instance of with the provided name. - /// - /// The name of the health check being executed. - public HealthCheckLogScope(string healthCheckName) - { - HealthCheckName = healthCheckName; - } - - IEnumerator> IEnumerable>.GetEnumerator() - { - yield return new KeyValuePair(nameof(HealthCheckName), HealthCheckName); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return ((IEnumerable>)this).GetEnumerator(); - } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckPublisherHostedService.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckPublisherHostedService.cs deleted file mode 100644 index d124ffa2e3..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckPublisherHostedService.cs +++ /dev/null @@ -1,262 +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.Hosting; -using Microsoft.Extensions.Internal; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - internal sealed class HealthCheckPublisherHostedService : IHostedService - { - private readonly HealthCheckService _healthCheckService; - private readonly IOptions _options; - private readonly ILogger _logger; - private readonly IHealthCheckPublisher[] _publishers; - - private CancellationTokenSource _stopping; - private Timer _timer; - - public HealthCheckPublisherHostedService( - HealthCheckService healthCheckService, - IOptions options, - ILogger logger, - IEnumerable publishers) - { - if (healthCheckService == null) - { - throw new ArgumentNullException(nameof(healthCheckService)); - } - - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - if (logger == null) - { - throw new ArgumentNullException(nameof(logger)); - } - - if (publishers == null) - { - throw new ArgumentNullException(nameof(publishers)); - } - - _healthCheckService = healthCheckService; - _options = options; - _logger = logger; - _publishers = publishers.ToArray(); - - _stopping = new CancellationTokenSource(); - } - - internal bool IsStopping => _stopping.IsCancellationRequested; - - internal bool IsTimerRunning => _timer != null; - - public Task StartAsync(CancellationToken cancellationToken = default) - { - if (_publishers.Length == 0) - { - return Task.CompletedTask; - } - - // IMPORTANT - make sure this is the last thing that happens in this method. The timer can - // fire before other code runs. - _timer = NonCapturingTimer.Create(Timer_Tick, null, dueTime: _options.Value.Delay, period: _options.Value.Period); - - return Task.CompletedTask; - } - - public Task StopAsync(CancellationToken cancellationToken = default) - { - try - { - _stopping.Cancel(); - } - catch - { - // Ignore exceptions thrown as a result of a cancellation. - } - - if (_publishers.Length == 0) - { - return Task.CompletedTask; - } - - _timer?.Dispose(); - _timer = null; - - - return Task.CompletedTask; - } - - // Yes, async void. We need to be async. We need to be void. We handle the exceptions in RunAsync - private async void Timer_Tick(object state) - { - await RunAsync(); - } - - // Internal for testing - internal async Task RunAsync() - { - var duration = ValueStopwatch.StartNew(); - Logger.HealthCheckPublisherProcessingBegin(_logger); - - CancellationTokenSource cancellation = null; - try - { - var timeout = _options.Value.Timeout; - - cancellation = CancellationTokenSource.CreateLinkedTokenSource(_stopping.Token); - cancellation.CancelAfter(timeout); - - await RunAsyncCore(cancellation.Token); - - Logger.HealthCheckPublisherProcessingEnd(_logger, duration.GetElapsedTime()); - } - catch (OperationCanceledException) when (IsStopping) - { - // This is a cancellation - if the app is shutting down we want to ignore it. Otherwise, it's - // a timeout and we want to log it. - } - catch (Exception ex) - { - // This is an error, publishing failed. - Logger.HealthCheckPublisherProcessingEnd(_logger, duration.GetElapsedTime(), ex); - } - finally - { - cancellation.Dispose(); - } - } - - private async Task RunAsyncCore(CancellationToken cancellationToken) - { - // Forcibly yield - we want to unblock the timer thread. - await Task.Yield(); - - // The health checks service does it's own logging, and doesn't throw exceptions. - var report = await _healthCheckService.CheckHealthAsync(_options.Value.Predicate, cancellationToken); - - var publishers = _publishers; - var tasks = new Task[publishers.Length]; - for (var i = 0; i < publishers.Length; i++) - { - tasks[i] = RunPublisherAsync(publishers[i], report, cancellationToken); - } - - await Task.WhenAll(tasks); - } - - private async Task RunPublisherAsync(IHealthCheckPublisher publisher, HealthReport report, CancellationToken cancellationToken) - { - var duration = ValueStopwatch.StartNew(); - - try - { - Logger.HealthCheckPublisherBegin(_logger, publisher); - - await publisher.PublishAsync(report, cancellationToken); - Logger.HealthCheckPublisherEnd(_logger, publisher, duration.GetElapsedTime()); - } - catch (OperationCanceledException) when (IsStopping) - { - // This is a cancellation - if the app is shutting down we want to ignore it. Otherwise, it's - // a timeout and we want to log it. - } - catch (OperationCanceledException ocex) - { - Logger.HealthCheckPublisherTimeout(_logger, publisher, duration.GetElapsedTime()); - throw ocex; - } - catch (Exception ex) - { - Logger.HealthCheckPublisherError(_logger, publisher, duration.GetElapsedTime(), ex); - throw ex; - } - } - - internal static class EventIds - { - public static readonly EventId HealthCheckPublisherProcessingBegin = new EventId(100, "HealthCheckPublisherProcessingBegin"); - public static readonly EventId HealthCheckPublisherProcessingEnd = new EventId(101, "HealthCheckPublisherProcessingEnd"); - public static readonly EventId HealthCheckPublisherProcessingError = new EventId(101, "HealthCheckPublisherProcessingError"); - - public static readonly EventId HealthCheckPublisherBegin = new EventId(102, "HealthCheckPublisherBegin"); - public static readonly EventId HealthCheckPublisherEnd = new EventId(103, "HealthCheckPublisherEnd"); - public static readonly EventId HealthCheckPublisherError = new EventId(104, "HealthCheckPublisherError"); - public static readonly EventId HealthCheckPublisherTimeout = new EventId(104, "HealthCheckPublisherTimeout"); - } - - private static class Logger - { - private static readonly Action _healthCheckPublisherProcessingBegin = LoggerMessage.Define( - LogLevel.Debug, - EventIds.HealthCheckPublisherProcessingBegin, - "Running health check publishers"); - - private static readonly Action _healthCheckPublisherProcessingEnd = LoggerMessage.Define( - LogLevel.Debug, - EventIds.HealthCheckPublisherProcessingEnd, - "Health check publisher processing completed after {ElapsedMilliseconds}ms"); - - private static readonly Action _healthCheckPublisherBegin = LoggerMessage.Define( - LogLevel.Debug, - EventIds.HealthCheckPublisherBegin, - "Running health check publisher '{HealthCheckPublisher}'"); - - private static readonly Action _healthCheckPublisherEnd = LoggerMessage.Define( - LogLevel.Debug, - EventIds.HealthCheckPublisherEnd, - "Health check '{HealthCheckPublisher}' completed after {ElapsedMilliseconds}ms"); - - private static readonly Action _healthCheckPublisherError = LoggerMessage.Define( - LogLevel.Error, - EventIds.HealthCheckPublisherError, - "Health check {HealthCheckPublisher} threw an unhandled exception after {ElapsedMilliseconds}ms"); - - private static readonly Action _healthCheckPublisherTimeout = LoggerMessage.Define( - LogLevel.Error, - EventIds.HealthCheckPublisherTimeout, - "Health check {HealthCheckPublisher} was canceled after {ElapsedMilliseconds}ms"); - - public static void HealthCheckPublisherProcessingBegin(ILogger logger) - { - _healthCheckPublisherProcessingBegin(logger, null); - } - - public static void HealthCheckPublisherProcessingEnd(ILogger logger, TimeSpan duration, Exception exception = null) - { - _healthCheckPublisherProcessingEnd(logger, duration.TotalMilliseconds, exception); - } - - public static void HealthCheckPublisherBegin(ILogger logger, IHealthCheckPublisher publisher) - { - _healthCheckPublisherBegin(logger, publisher, null); - } - - public static void HealthCheckPublisherEnd(ILogger logger, IHealthCheckPublisher publisher, TimeSpan duration) - { - _healthCheckPublisherEnd(logger, publisher, duration.TotalMilliseconds, null); - } - - public static void HealthCheckPublisherError(ILogger logger, IHealthCheckPublisher publisher, TimeSpan duration, Exception exception) - { - _healthCheckPublisherError(logger, publisher, duration.TotalMilliseconds, exception); - } - - public static void HealthCheckPublisherTimeout(ILogger logger, IHealthCheckPublisher publisher, TimeSpan duration) - { - _healthCheckPublisherTimeout(logger, publisher, duration.TotalMilliseconds, null); - } - } - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckPublisherOptions.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckPublisherOptions.cs deleted file mode 100644 index 1313718af8..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckPublisherOptions.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; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - /// - /// Options for the default service that executes instances. - /// - public sealed class HealthCheckPublisherOptions - { - private TimeSpan _delay; - private TimeSpan _period; - - public HealthCheckPublisherOptions() - { - _delay = TimeSpan.FromSeconds(5); - _period = TimeSpan.FromSeconds(30); - } - - /// - /// Gets or sets the initial delay applied after the application starts before executing - /// instances. The delay is applied once at startup, and does - /// not apply to subsequent iterations. The default value is 5 seconds. - /// - public TimeSpan Delay - { - get => _delay; - set - { - if (value == System.Threading.Timeout.InfiniteTimeSpan) - { - throw new ArgumentException($"The {nameof(Delay)} must not be infinite.", nameof(value)); - } - - _delay = value; - } - } - - /// - /// Gets or sets the period of execution. The default value is - /// 30 seconds. - /// - /// - /// The cannot be set to a value lower than 1 second. - /// - public TimeSpan Period - { - get => _period; - set - { - if (value < TimeSpan.FromSeconds(1)) - { - throw new ArgumentException($"The {nameof(Period)} must be greater than or equal to one second.", nameof(value)); - } - - if (value == System.Threading.Timeout.InfiniteTimeSpan) - { - throw new ArgumentException($"The {nameof(Period)} must not be infinite.", nameof(value)); - } - - _delay = value; - } - } - - /// - /// Gets or sets a predicate that is used to filter the set of health checks executed. - /// - /// - /// If is null, the health check publisher service will run all - /// registered health checks - this is the default behavior. To run a subset of health checks, - /// provide a function that filters the set of checks. The predicate will be evaluated each period. - /// - public Func Predicate { get; set; } - - /// - /// Gets or sets the timeout for executing the health checks an all - /// instances. Use to execute with no timeout. - /// The default value is 30 seconds. - /// - public TimeSpan Timeout { get; set; } = TimeSpan.FromSeconds(30); - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckService.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckService.cs deleted file mode 100644 index e4a128148d..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckService.cs +++ /dev/null @@ -1,61 +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.Diagnostics.HealthChecks -{ - /// - /// A service which can be used to check the status of instances - /// registered in the application. - /// - /// - /// - /// The default implementation of is registered in the dependency - /// injection container as a singleton service by calling - /// . - /// - /// - /// The returned by - /// - /// provides a convenience API for registering health checks. - /// - /// - /// implementations can be registered through extension methods provided by - /// . - /// - /// - public abstract class HealthCheckService - { - /// - /// Runs all the health checks in the application and returns the aggregated status. - /// - /// A which can be used to cancel the health checks. - /// - /// A which will complete when all the health checks have been run, - /// yielding a containing the results. - /// - public Task CheckHealthAsync(CancellationToken cancellationToken = default) - { - return CheckHealthAsync(predicate: null, cancellationToken); - } - - /// - /// Runs the provided health checks and returns the aggregated status - /// - /// - /// A predicate that can be used to include health checks based on user-defined criteria. - /// - /// A which can be used to cancel the health checks. - /// - /// A which will complete when all the health checks have been run, - /// yielding a containing the results. - /// - public abstract Task CheckHealthAsync( - Func predicate, - CancellationToken cancellationToken = default); - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckServiceOptions.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckServiceOptions.cs deleted file mode 100644 index b8dfdb9b40..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/HealthCheckServiceOptions.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.Collections.Generic; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - /// - /// Options for the default implementation of - /// - public sealed class HealthCheckServiceOptions - { - /// - /// Gets the health check registrations. - /// - public ICollection Registrations { get; } = new List(); - } -} diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/Microsoft.Extensions.Diagnostics.HealthChecks.csproj b/src/Microsoft.Extensions.Diagnostics.HealthChecks/Microsoft.Extensions.Diagnostics.HealthChecks.csproj deleted file mode 100644 index 523803907a..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/Microsoft.Extensions.Diagnostics.HealthChecks.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - Components for performing health checks in .NET applications - -Commonly Used Types: -Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckService -Microsoft.Extensions.Diagnostics.HealthChecks.IHealthChecksBuilder - - netstandard2.0 - $(NoWarn);CS1591 - true - diagnostics;healthchecks - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/Properties/AssemblyInfo.cs b/src/Microsoft.Extensions.Diagnostics.HealthChecks/Properties/AssemblyInfo.cs deleted file mode 100644 index 13e969bfad..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,3 +0,0 @@ -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Microsoft.Extensions.Diagnostics.HealthChecks.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] \ No newline at end of file diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks/baseline.netcore.json b/src/Microsoft.Extensions.Diagnostics.HealthChecks/baseline.netcore.json deleted file mode 100644 index cb2fe053f1..0000000000 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks/baseline.netcore.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.Extensions.Diagnostics.HealthChecks, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - ] -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Diagnostics.Abstractions/CompilationFailure.cs b/src/Middleware/Diagnostics.Abstractions/src/CompilationFailure.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.Abstractions/CompilationFailure.cs rename to src/Middleware/Diagnostics.Abstractions/src/CompilationFailure.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.Abstractions/DiagnosticMessage.cs b/src/Middleware/Diagnostics.Abstractions/src/DiagnosticMessage.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.Abstractions/DiagnosticMessage.cs rename to src/Middleware/Diagnostics.Abstractions/src/DiagnosticMessage.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.Abstractions/ICompilationException.cs b/src/Middleware/Diagnostics.Abstractions/src/ICompilationException.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.Abstractions/ICompilationException.cs rename to src/Middleware/Diagnostics.Abstractions/src/ICompilationException.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.Abstractions/IExceptionHandlerFeature.cs b/src/Middleware/Diagnostics.Abstractions/src/IExceptionHandlerFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.Abstractions/IExceptionHandlerFeature.cs rename to src/Middleware/Diagnostics.Abstractions/src/IExceptionHandlerFeature.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.Abstractions/IExceptionHandlerPathFeature.cs b/src/Middleware/Diagnostics.Abstractions/src/IExceptionHandlerPathFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.Abstractions/IExceptionHandlerPathFeature.cs rename to src/Middleware/Diagnostics.Abstractions/src/IExceptionHandlerPathFeature.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.Abstractions/IStatusCodePagesFeature.cs b/src/Middleware/Diagnostics.Abstractions/src/IStatusCodePagesFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.Abstractions/IStatusCodePagesFeature.cs rename to src/Middleware/Diagnostics.Abstractions/src/IStatusCodePagesFeature.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.Abstractions/IStatusCodeReExecuteFeature.cs b/src/Middleware/Diagnostics.Abstractions/src/IStatusCodeReExecuteFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.Abstractions/IStatusCodeReExecuteFeature.cs rename to src/Middleware/Diagnostics.Abstractions/src/IStatusCodeReExecuteFeature.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.Abstractions/Microsoft.AspNetCore.Diagnostics.Abstractions.csproj b/src/Middleware/Diagnostics.Abstractions/src/Microsoft.AspNetCore.Diagnostics.Abstractions.csproj similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.Abstractions/Microsoft.AspNetCore.Diagnostics.Abstractions.csproj rename to src/Middleware/Diagnostics.Abstractions/src/Microsoft.AspNetCore.Diagnostics.Abstractions.csproj diff --git a/src/Microsoft.AspNetCore.Diagnostics.Abstractions/baseline.netcore.json b/src/Middleware/Diagnostics.Abstractions/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.Abstractions/baseline.netcore.json rename to src/Middleware/Diagnostics.Abstractions/src/baseline.netcore.json diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageExtensions.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageExtensions.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageExtensions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageMiddleware.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageMiddleware.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageMiddleware.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageOptions.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/DatabaseErrorPageOptions.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/DatabaseErrorPageOptions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/Internal/DiagnosticsEntityFrameworkCoreLoggerExtensions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj similarity index 53% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj index 5e29b7926a..f418a50148 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj +++ b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj @@ -9,13 +9,13 @@ - + - - - + + + diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointExtensions.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointExtensions.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointExtensions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointMiddleware.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointMiddleware.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointMiddleware.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointOptions.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/MigrationsEndPointOptions.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/MigrationsEndPointOptions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/AssemblyInfo.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/AssemblyInfo.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Properties/Strings.Designer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Properties/Strings.Designer.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/Properties/Strings.Designer.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Strings.resx similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Strings.resx rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/Strings.resx diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.Designer.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Views/DatabaseErrorPage.Designer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.Designer.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/Views/DatabaseErrorPage.Designer.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cshtml b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Views/DatabaseErrorPage.cshtml similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPage.cshtml rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/Views/DatabaseErrorPage.cshtml diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPageModel.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Views/DatabaseErrorPageModel.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/DatabaseErrorPageModel.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/Views/DatabaseErrorPageModel.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/ErrorPage.css b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Views/ErrorPage.css similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/Views/ErrorPage.css rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/Views/ErrorPage.css diff --git a/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/baseline.netcore.json b/src/Middleware/Diagnostics.EntityFrameworkCore/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore/baseline.netcore.json rename to src/Middleware/Diagnostics.EntityFrameworkCore/src/baseline.netcore.json diff --git a/test/Diagnostics.EFCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/DatabaseErrorPageMiddlewareTest.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/DatabaseErrorPageMiddlewareTest.cs diff --git a/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Diagnostics.EFCore.FunctionalTests.csproj b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Diagnostics.EFCore.FunctionalTests.csproj new file mode 100644 index 0000000000..a82ac7c490 --- /dev/null +++ b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Diagnostics.EFCore.FunctionalTests.csproj @@ -0,0 +1,16 @@ + + + + $(StandardTestTfms) + + Diagnostics.EFCore.FunctionalTests + + + + + + + + + + diff --git a/test/Diagnostics.EFCore.FunctionalTests/Helpers/PlatformHelper.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Helpers/PlatformHelper.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/Helpers/PlatformHelper.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Helpers/PlatformHelper.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/Helpers/StringHelpers.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Helpers/StringHelpers.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/Helpers/StringHelpers.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Helpers/StringHelpers.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/Helpers/TestLoggerProvider.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Helpers/TestLoggerProvider.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/Helpers/TestLoggerProvider.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/Helpers/TestLoggerProvider.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/MigrationsEndPointMiddlewareTest.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/MigrationsEndPointMiddlewareTest.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/MigrationsEndPointMiddlewareTest.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/MigrationsEndPointMiddlewareTest.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/SqlServerTestStore.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/SqlServerTestStore.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/SqlServerTestStore.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/SqlServerTestStore.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/TestModels/Blog.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/Blog.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/TestModels/Blog.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/Blog.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/TestModels/BloggingContext.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/BloggingContext.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/TestModels/BloggingContext.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/BloggingContext.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/TestModels/BloggingContextWithMigrations.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/BloggingContextWithMigrations.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/TestModels/BloggingContextWithMigrations.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/BloggingContextWithMigrations.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/BloggingContextWithPendingModelChanges.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs similarity index 100% rename from test/Diagnostics.EFCore.FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/FunctionalTests/TestModels/BloggingContextWithSnapshotThatThrows.cs diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/DatabaseErrorPageOptionsTest.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/DatabaseErrorPageOptionsTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/DatabaseErrorPageOptionsTest.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/DatabaseErrorPageOptionsTest.cs diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/DatabaseErrorPageTest.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/DatabaseErrorPageTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/DatabaseErrorPageTest.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/DatabaseErrorPageTest.cs diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Helpers/AssertHelpers.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/Helpers/AssertHelpers.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Helpers/AssertHelpers.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/Helpers/AssertHelpers.cs diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Helpers/StringHelpers.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/Helpers/StringHelpers.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Helpers/StringHelpers.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/Helpers/StringHelpers.cs diff --git a/src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj b/src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000000..fc5a2b350f --- /dev/null +++ b/src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,13 @@ + + + + $(StandardTestTfms) + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/TestHelperExtensions.cs b/src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/TestHelperExtensions.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/TestHelperExtensions.cs rename to src/Middleware/Diagnostics.EntityFrameworkCore/test/UnitTests/TestHelperExtensions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/.csslintrc b/src/Middleware/Diagnostics/src/.csslintrc similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/.csslintrc rename to src/Middleware/Diagnostics/src/.csslintrc diff --git a/src/Microsoft.AspNetCore.Diagnostics/.jshintrc b/src/Middleware/Diagnostics/src/.jshintrc similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/.jshintrc rename to src/Middleware/Diagnostics/src/.jshintrc diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageExtensions.cs b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageExtensions.cs rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageExtensions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageMiddleware.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageOptions.cs b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/DeveloperExceptionPageOptions.cs rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/DeveloperExceptionPageOptions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorModel.cs b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/CompilationErrorModel.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorModel.cs rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/CompilationErrorModel.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.Designer.cs b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/CompilationErrorPage.Designer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.Designer.cs rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/CompilationErrorPage.Designer.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cshtml b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/CompilationErrorPage.cshtml similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/CompilationErrorPage.cshtml rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/CompilationErrorPage.cshtml diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.Designer.cs b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPage.Designer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.Designer.cs rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPage.Designer.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPage.cshtml similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.cshtml rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPage.cshtml diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPage.css similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.css rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPage.css diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.js b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPage.js similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPage.js rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPage.js diff --git a/src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPageModel.cs b/src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPageModel.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/DeveloperExceptionPage/Views/ErrorPageModel.cs rename to src/Middleware/Diagnostics/src/DeveloperExceptionPage/Views/ErrorPageModel.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerExtensions.cs b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerExtensions.cs rename to src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerExtensions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerFeature.cs b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerFeature.cs rename to src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerFeature.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerMiddleware.cs b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerMiddleware.cs rename to src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerMiddleware.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerOptions.cs b/src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/ExceptionHandler/ExceptionHandlerOptions.cs rename to src/Middleware/Diagnostics/src/ExceptionHandler/ExceptionHandlerOptions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/Internal/DiagnosticsLoggerExtensions.cs b/src/Middleware/Diagnostics/src/Internal/DiagnosticsLoggerExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/Internal/DiagnosticsLoggerExtensions.cs rename to src/Middleware/Diagnostics/src/Internal/DiagnosticsLoggerExtensions.cs diff --git a/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj b/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj new file mode 100644 index 0000000000..3031479443 --- /dev/null +++ b/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj @@ -0,0 +1,30 @@ + + + + ASP.NET Core middleware for exception handling, exception display pages, and diagnostics information. Includes developer exception page middleware, exception handler middleware, runtime info middleware, status code page middleware, and welcome page middleware + netcoreapp3.0 + $(NoWarn);CS1591 + true + aspnetcore;diagnostics + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Microsoft.AspNetCore.Diagnostics/Properties/AssemblyInfo.cs b/src/Middleware/Diagnostics/src/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/Properties/AssemblyInfo.cs rename to src/Middleware/Diagnostics/src/Properties/AssemblyInfo.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/Properties/Resources.Designer.cs b/src/Middleware/Diagnostics/src/Properties/Resources.Designer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/Properties/Resources.Designer.cs rename to src/Middleware/Diagnostics/src/Properties/Resources.Designer.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/Resources.resx b/src/Middleware/Diagnostics/src/Resources.resx similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/Resources.resx rename to src/Middleware/Diagnostics/src/Resources.resx diff --git a/src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodeContext.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeContext.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodeContext.cs rename to src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeContext.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodePagesExtensions.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodePagesExtensions.cs rename to src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesExtensions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodePagesFeature.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodePagesFeature.cs rename to src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesFeature.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodePagesMiddleware.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodePagesMiddleware.cs rename to src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesMiddleware.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodePagesOptions.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodePagesOptions.cs rename to src/Middleware/Diagnostics/src/StatusCodePage/StatusCodePagesOptions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodeReExecuteFeature.cs b/src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeReExecuteFeature.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/StatusCodePage/StatusCodeReExecuteFeature.cs rename to src/Middleware/Diagnostics/src/StatusCodePage/StatusCodeReExecuteFeature.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/WelcomePage/Views/Obsolete/WelcomePage.cs b/src/Middleware/Diagnostics/src/WelcomePage/Views/Obsolete/WelcomePage.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/WelcomePage/Views/Obsolete/WelcomePage.cs rename to src/Middleware/Diagnostics/src/WelcomePage/Views/Obsolete/WelcomePage.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/WelcomePage/Views/Obsolete/WelcomePage.cshtml b/src/Middleware/Diagnostics/src/WelcomePage/Views/Obsolete/WelcomePage.cshtml similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/WelcomePage/Views/Obsolete/WelcomePage.cshtml rename to src/Middleware/Diagnostics/src/WelcomePage/Views/Obsolete/WelcomePage.cshtml diff --git a/src/Microsoft.AspNetCore.Diagnostics/WelcomePage/Views/WelcomePage.Designer.cs b/src/Middleware/Diagnostics/src/WelcomePage/Views/WelcomePage.Designer.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/WelcomePage/Views/WelcomePage.Designer.cs rename to src/Middleware/Diagnostics/src/WelcomePage/Views/WelcomePage.Designer.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/WelcomePage/Views/WelcomePage.cshtml b/src/Middleware/Diagnostics/src/WelcomePage/Views/WelcomePage.cshtml similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/WelcomePage/Views/WelcomePage.cshtml rename to src/Middleware/Diagnostics/src/WelcomePage/Views/WelcomePage.cshtml diff --git a/src/Microsoft.AspNetCore.Diagnostics/WelcomePage/WelcomePageExtensions.cs b/src/Middleware/Diagnostics/src/WelcomePage/WelcomePageExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/WelcomePage/WelcomePageExtensions.cs rename to src/Middleware/Diagnostics/src/WelcomePage/WelcomePageExtensions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/WelcomePage/WelcomePageMiddleware.cs b/src/Middleware/Diagnostics/src/WelcomePage/WelcomePageMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/WelcomePage/WelcomePageMiddleware.cs rename to src/Middleware/Diagnostics/src/WelcomePage/WelcomePageMiddleware.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/WelcomePage/WelcomePageOptions.cs b/src/Middleware/Diagnostics/src/WelcomePage/WelcomePageOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/WelcomePage/WelcomePageOptions.cs rename to src/Middleware/Diagnostics/src/WelcomePage/WelcomePageOptions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics/_gruntfile.js b/src/Middleware/Diagnostics/src/_gruntfile.js similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/_gruntfile.js rename to src/Middleware/Diagnostics/src/_gruntfile.js diff --git a/src/Microsoft.AspNetCore.Diagnostics/_gruntfile.readme b/src/Middleware/Diagnostics/src/_gruntfile.readme similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/_gruntfile.readme rename to src/Middleware/Diagnostics/src/_gruntfile.readme diff --git a/src/Microsoft.AspNetCore.Diagnostics/_package.json b/src/Middleware/Diagnostics/src/_package.json similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/_package.json rename to src/Middleware/Diagnostics/src/_package.json diff --git a/src/Microsoft.AspNetCore.Diagnostics/baseline.netcore.json b/src/Middleware/Diagnostics/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics/baseline.netcore.json rename to src/Middleware/Diagnostics/src/baseline.netcore.json diff --git a/test/Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs b/src/Middleware/Diagnostics/test/FunctionalTests/DatabaseErrorPageSampleTest.cs similarity index 100% rename from test/Diagnostics.FunctionalTests/DatabaseErrorPageSampleTest.cs rename to src/Middleware/Diagnostics/test/FunctionalTests/DatabaseErrorPageSampleTest.cs diff --git a/test/Diagnostics.FunctionalTests/DeveloperExceptionPageSampleTest.cs b/src/Middleware/Diagnostics/test/FunctionalTests/DeveloperExceptionPageSampleTest.cs similarity index 100% rename from test/Diagnostics.FunctionalTests/DeveloperExceptionPageSampleTest.cs rename to src/Middleware/Diagnostics/test/FunctionalTests/DeveloperExceptionPageSampleTest.cs diff --git a/src/Middleware/Diagnostics/test/FunctionalTests/Diagnostics.FunctionalTests.csproj b/src/Middleware/Diagnostics/test/FunctionalTests/Diagnostics.FunctionalTests.csproj new file mode 100644 index 0000000000..f581883ab8 --- /dev/null +++ b/src/Middleware/Diagnostics/test/FunctionalTests/Diagnostics.FunctionalTests.csproj @@ -0,0 +1,23 @@ + + + + $(StandardTestTfms) + false + Diagnostics.FunctionalTests + + + + + + + + + + + + + + + + + diff --git a/test/Diagnostics.FunctionalTests/ExceptionHandlerSampleTest.cs b/src/Middleware/Diagnostics/test/FunctionalTests/ExceptionHandlerSampleTest.cs similarity index 100% rename from test/Diagnostics.FunctionalTests/ExceptionHandlerSampleTest.cs rename to src/Middleware/Diagnostics/test/FunctionalTests/ExceptionHandlerSampleTest.cs diff --git a/test/Diagnostics.FunctionalTests/MiddlewareAnalysisSampleTest.cs b/src/Middleware/Diagnostics/test/FunctionalTests/MiddlewareAnalysisSampleTest.cs similarity index 100% rename from test/Diagnostics.FunctionalTests/MiddlewareAnalysisSampleTest.cs rename to src/Middleware/Diagnostics/test/FunctionalTests/MiddlewareAnalysisSampleTest.cs diff --git a/test/Diagnostics.FunctionalTests/StatusCodeSampleTest.cs b/src/Middleware/Diagnostics/test/FunctionalTests/StatusCodeSampleTest.cs similarity index 100% rename from test/Diagnostics.FunctionalTests/StatusCodeSampleTest.cs rename to src/Middleware/Diagnostics/test/FunctionalTests/StatusCodeSampleTest.cs diff --git a/test/Diagnostics.FunctionalTests/TestFixture.cs b/src/Middleware/Diagnostics/test/FunctionalTests/TestFixture.cs similarity index 100% rename from test/Diagnostics.FunctionalTests/TestFixture.cs rename to src/Middleware/Diagnostics/test/FunctionalTests/TestFixture.cs diff --git a/test/Diagnostics.FunctionalTests/WelcomePageSampleTest.cs b/src/Middleware/Diagnostics/test/FunctionalTests/WelcomePageSampleTest.cs similarity index 100% rename from test/Diagnostics.FunctionalTests/WelcomePageSampleTest.cs rename to src/Middleware/Diagnostics/test/FunctionalTests/WelcomePageSampleTest.cs diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/DeveloperExceptionPageMiddlewareTest.cs b/src/Middleware/Diagnostics/test/UnitTests/DeveloperExceptionPageMiddlewareTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.Tests/DeveloperExceptionPageMiddlewareTest.cs rename to src/Middleware/Diagnostics/test/UnitTests/DeveloperExceptionPageMiddlewareTest.cs diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/ExceptionDetailsProviderTest.cs b/src/Middleware/Diagnostics/test/UnitTests/ExceptionDetailsProviderTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.Tests/ExceptionDetailsProviderTest.cs rename to src/Middleware/Diagnostics/test/UnitTests/ExceptionDetailsProviderTest.cs diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/ExceptionHandlerTest.cs b/src/Middleware/Diagnostics/test/UnitTests/ExceptionHandlerTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.Tests/ExceptionHandlerTest.cs rename to src/Middleware/Diagnostics/test/UnitTests/ExceptionHandlerTest.cs diff --git a/src/Middleware/Diagnostics/test/UnitTests/Microsoft.AspNetCore.Diagnostics.Tests.csproj b/src/Middleware/Diagnostics/test/UnitTests/Microsoft.AspNetCore.Diagnostics.Tests.csproj new file mode 100644 index 0000000000..5c37cdf8c4 --- /dev/null +++ b/src/Middleware/Diagnostics/test/UnitTests/Microsoft.AspNetCore.Diagnostics.Tests.csproj @@ -0,0 +1,24 @@ + + + + $(StandardTestTfms) + + + + + + + + + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/Resources/TestFiles/EmbeddedSourceFile.txt b/src/Middleware/Diagnostics/test/UnitTests/Resources/TestFiles/EmbeddedSourceFile.txt similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.Tests/Resources/TestFiles/EmbeddedSourceFile.txt rename to src/Middleware/Diagnostics/test/UnitTests/Resources/TestFiles/EmbeddedSourceFile.txt diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/TestDiagnosticListener.cs b/src/Middleware/Diagnostics/test/UnitTests/TestDiagnosticListener.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.Tests/TestDiagnosticListener.cs rename to src/Middleware/Diagnostics/test/UnitTests/TestDiagnosticListener.cs diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/TestFiles/SourceFile.txt b/src/Middleware/Diagnostics/test/UnitTests/TestFiles/SourceFile.txt similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.Tests/TestFiles/SourceFile.txt rename to src/Middleware/Diagnostics/test/UnitTests/TestFiles/SourceFile.txt diff --git a/test/ClassLibraryWithPortablePdbs/ClassLibraryWithPortablePdbs.csproj b/src/Middleware/Diagnostics/test/testassets/ClassLibraryWithPortablePdbs/ClassLibraryWithPortablePdbs.csproj similarity index 100% rename from test/ClassLibraryWithPortablePdbs/ClassLibraryWithPortablePdbs.csproj rename to src/Middleware/Diagnostics/test/testassets/ClassLibraryWithPortablePdbs/ClassLibraryWithPortablePdbs.csproj diff --git a/test/ClassLibraryWithPortablePdbs/ExceptionType.cs b/src/Middleware/Diagnostics/test/testassets/ClassLibraryWithPortablePdbs/ExceptionType.cs similarity index 100% rename from test/ClassLibraryWithPortablePdbs/ExceptionType.cs rename to src/Middleware/Diagnostics/test/testassets/ClassLibraryWithPortablePdbs/ExceptionType.cs diff --git a/src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj b/src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj new file mode 100644 index 0000000000..84734a124c --- /dev/null +++ b/src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/DatabaseErrorPageSample.csproj @@ -0,0 +1,18 @@ + + + + netcoreapp3.0 + + + + + + + + + + + + + + diff --git a/samples/DatabaseErrorPageSample/Startup.cs b/src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/Startup.cs similarity index 100% rename from samples/DatabaseErrorPageSample/Startup.cs rename to src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/Startup.cs diff --git a/samples/DatabaseErrorPageSample/web.config b/src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/web.config similarity index 100% rename from samples/DatabaseErrorPageSample/web.config rename to src/Middleware/Diagnostics/test/testassets/DatabaseErrorPageSample/web.config diff --git a/src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj b/src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj new file mode 100644 index 0000000000..3c714fe27c --- /dev/null +++ b/src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/DeveloperExceptionPageSample.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp3.0 + + + + + + + + + + + + diff --git a/samples/DeveloperExceptionPageSample/Startup.cs b/src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/Startup.cs similarity index 100% rename from samples/DeveloperExceptionPageSample/Startup.cs rename to src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/Startup.cs diff --git a/samples/DeveloperExceptionPageSample/web.config b/src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/web.config similarity index 100% rename from samples/DeveloperExceptionPageSample/web.config rename to src/Middleware/Diagnostics/test/testassets/DeveloperExceptionPageSample/web.config diff --git a/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/ExceptionHandlerSample.csproj b/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/ExceptionHandlerSample.csproj new file mode 100644 index 0000000000..bcbefe0fda --- /dev/null +++ b/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/ExceptionHandlerSample.csproj @@ -0,0 +1,15 @@ + + + + netcoreapp3.0 + + + + + + + + + + + diff --git a/samples/ExceptionHandlerSample/Startup.cs b/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/Startup.cs similarity index 100% rename from samples/ExceptionHandlerSample/Startup.cs rename to src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/Startup.cs diff --git a/samples/ElmPageSample/web.config b/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/web.config similarity index 100% rename from samples/ElmPageSample/web.config rename to src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/web.config diff --git a/samples/ElmPageSample/wwwroot/error.html b/src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/wwwroot/error.html similarity index 100% rename from samples/ElmPageSample/wwwroot/error.html rename to src/Middleware/Diagnostics/test/testassets/ExceptionHandlerSample/wwwroot/error.html diff --git a/samples/StatusCodePagesSample/Startup.cs b/src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/Startup.cs similarity index 100% rename from samples/StatusCodePagesSample/Startup.cs rename to src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/Startup.cs diff --git a/src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/StatusCodePagesSample.csproj b/src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/StatusCodePagesSample.csproj new file mode 100644 index 0000000000..7f287786c3 --- /dev/null +++ b/src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/StatusCodePagesSample.csproj @@ -0,0 +1,13 @@ + + + + netcoreapp3.0 + + + + + + + + + diff --git a/samples/ExceptionHandlerSample/web.config b/src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/web.config similarity index 100% rename from samples/ExceptionHandlerSample/web.config rename to src/Middleware/Diagnostics/test/testassets/StatusCodePagesSample/web.config diff --git a/samples/WelcomePageSample/Startup.cs b/src/Middleware/Diagnostics/test/testassets/WelcomePageSample/Startup.cs similarity index 100% rename from samples/WelcomePageSample/Startup.cs rename to src/Middleware/Diagnostics/test/testassets/WelcomePageSample/Startup.cs diff --git a/src/Middleware/Diagnostics/test/testassets/WelcomePageSample/WelcomePageSample.csproj b/src/Middleware/Diagnostics/test/testassets/WelcomePageSample/WelcomePageSample.csproj new file mode 100644 index 0000000000..7f287786c3 --- /dev/null +++ b/src/Middleware/Diagnostics/test/testassets/WelcomePageSample/WelcomePageSample.csproj @@ -0,0 +1,13 @@ + + + + netcoreapp3.0 + + + + + + + + + diff --git a/samples/MiddlewareAnalysisSample/web.config b/src/Middleware/Diagnostics/test/testassets/WelcomePageSample/web.config similarity index 100% rename from samples/MiddlewareAnalysisSample/web.config rename to src/Middleware/Diagnostics/test/testassets/WelcomePageSample/web.config diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/DbContextHealthCheck.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheck.cs similarity index 100% rename from src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/DbContextHealthCheck.cs rename to src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheck.cs diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/DbContextHealthCheckOptions.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheckOptions.cs similarity index 100% rename from src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/DbContextHealthCheckOptions.cs rename to src/Middleware/HealthChecks.EntityFrameworkCore/src/DbContextHealthCheckOptions.cs diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensions.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/src/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensions.cs similarity index 100% rename from src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensions.cs rename to src/Middleware/HealthChecks.EntityFrameworkCore/src/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensions.cs diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj b/src/Middleware/HealthChecks.EntityFrameworkCore/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj similarity index 53% rename from src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj rename to src/Middleware/HealthChecks.EntityFrameworkCore/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj index 6a9c3cf5b9..6b59175d82 100644 --- a/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj +++ b/src/Middleware/HealthChecks.EntityFrameworkCore/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.csproj @@ -12,12 +12,9 @@ - - - - - - + + + diff --git a/src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/Properties/AssemblyInfo.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/src/Properties/AssemblyInfo.cs similarity index 100% rename from src/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore/Properties/AssemblyInfo.cs rename to src/Middleware/HealthChecks.EntityFrameworkCore/src/Properties/AssemblyInfo.cs diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests/DbContextHealthCheckTest.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/test/DbContextHealthCheckTest.cs similarity index 100% rename from test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests/DbContextHealthCheckTest.cs rename to src/Middleware/HealthChecks.EntityFrameworkCore/test/DbContextHealthCheckTest.cs diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensionsTest.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/test/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensionsTest.cs similarity index 100% rename from test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensionsTest.cs rename to src/Middleware/HealthChecks.EntityFrameworkCore/test/DependencyInjection/EntityFrameworkCoreHealthChecksBuilderExtensionsTest.cs diff --git a/src/Middleware/HealthChecks.EntityFrameworkCore/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj b/src/Middleware/HealthChecks.EntityFrameworkCore/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj new file mode 100644 index 0000000000..0580241f3d --- /dev/null +++ b/src/Middleware/HealthChecks.EntityFrameworkCore/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj @@ -0,0 +1,14 @@ + + + + netcoreapp3.0;net461 + Microsoft.AspNetCore.Diagnostics.HealthChecks + + + + + + + + + diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests/TestDbContext.cs b/src/Middleware/HealthChecks.EntityFrameworkCore/test/TestDbContext.cs similarity index 100% rename from test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests/TestDbContext.cs rename to src/Middleware/HealthChecks.EntityFrameworkCore/test/TestDbContext.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.HealthChecks/Builder/HealthCheckApplicationBuilderExtensions.cs b/src/Middleware/HealthChecks/src/Builder/HealthCheckApplicationBuilderExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.HealthChecks/Builder/HealthCheckApplicationBuilderExtensions.cs rename to src/Middleware/HealthChecks/src/Builder/HealthCheckApplicationBuilderExtensions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.HealthChecks/HealthCheckMiddleware.cs b/src/Middleware/HealthChecks/src/HealthCheckMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.HealthChecks/HealthCheckMiddleware.cs rename to src/Middleware/HealthChecks/src/HealthCheckMiddleware.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.HealthChecks/HealthCheckOptions.cs b/src/Middleware/HealthChecks/src/HealthCheckOptions.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.HealthChecks/HealthCheckOptions.cs rename to src/Middleware/HealthChecks/src/HealthCheckOptions.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.HealthChecks/HealthCheckResponseWriters.cs b/src/Middleware/HealthChecks/src/HealthCheckResponseWriters.cs similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.HealthChecks/HealthCheckResponseWriters.cs rename to src/Middleware/HealthChecks/src/HealthCheckResponseWriters.cs diff --git a/src/Microsoft.AspNetCore.Diagnostics.HealthChecks/Microsoft.AspNetCore.Diagnostics.HealthChecks.csproj b/src/Middleware/HealthChecks/src/Microsoft.AspNetCore.Diagnostics.HealthChecks.csproj similarity index 59% rename from src/Microsoft.AspNetCore.Diagnostics.HealthChecks/Microsoft.AspNetCore.Diagnostics.HealthChecks.csproj rename to src/Middleware/HealthChecks/src/Microsoft.AspNetCore.Diagnostics.HealthChecks.csproj index 3a50b5d24d..7a5a16a4db 100644 --- a/src/Microsoft.AspNetCore.Diagnostics.HealthChecks/Microsoft.AspNetCore.Diagnostics.HealthChecks.csproj +++ b/src/Middleware/HealthChecks/src/Microsoft.AspNetCore.Diagnostics.HealthChecks.csproj @@ -16,13 +16,10 @@ - - - - - - - + + + + diff --git a/src/Microsoft.AspNetCore.Diagnostics.HealthChecks/baseline.netcore.json b/src/Middleware/HealthChecks/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.Diagnostics.HealthChecks/baseline.netcore.json rename to src/Middleware/HealthChecks/src/baseline.netcore.json diff --git a/test/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests/HealthCheckMiddlewareSampleTest.cs b/src/Middleware/HealthChecks/test/UnitTests/HealthCheckMiddlewareSampleTest.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests/HealthCheckMiddlewareSampleTest.cs rename to src/Middleware/HealthChecks/test/UnitTests/HealthCheckMiddlewareSampleTest.cs diff --git a/test/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests/HealthCheckMiddlewareTests.cs b/src/Middleware/HealthChecks/test/UnitTests/HealthCheckMiddlewareTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests/HealthCheckMiddlewareTests.cs rename to src/Middleware/HealthChecks/test/UnitTests/HealthCheckMiddlewareTests.cs diff --git a/src/Middleware/HealthChecks/test/UnitTests/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests.csproj b/src/Middleware/HealthChecks/test/UnitTests/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests.csproj new file mode 100644 index 0000000000..ec431460cc --- /dev/null +++ b/src/Middleware/HealthChecks/test/UnitTests/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests.csproj @@ -0,0 +1,18 @@ + + + + $(StandardTestTfms) + Microsoft.AspNetCore.Diagnostics.HealthChecks + + + + + + + + + + + + + diff --git a/samples/HealthChecksSample/BasicStartup.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/BasicStartup.cs similarity index 100% rename from samples/HealthChecksSample/BasicStartup.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/BasicStartup.cs diff --git a/samples/HealthChecksSample/CustomWriterStartup.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/CustomWriterStartup.cs similarity index 100% rename from samples/HealthChecksSample/CustomWriterStartup.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/CustomWriterStartup.cs diff --git a/samples/HealthChecksSample/DBHealthStartup.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/DBHealthStartup.cs similarity index 100% rename from samples/HealthChecksSample/DBHealthStartup.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/DBHealthStartup.cs diff --git a/samples/HealthChecksSample/DbConnectionHealthCheck.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/DbConnectionHealthCheck.cs similarity index 100% rename from samples/HealthChecksSample/DbConnectionHealthCheck.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/DbConnectionHealthCheck.cs diff --git a/samples/HealthChecksSample/DbContextHealthStartup.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/DbContextHealthStartup.cs similarity index 100% rename from samples/HealthChecksSample/DbContextHealthStartup.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/DbContextHealthStartup.cs diff --git a/samples/HealthChecksSample/GCInfoHealthCheck.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/GCInfoHealthCheck.cs similarity index 100% rename from samples/HealthChecksSample/GCInfoHealthCheck.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/GCInfoHealthCheck.cs diff --git a/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/HealthChecksSample.csproj b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/HealthChecksSample.csproj new file mode 100644 index 0000000000..cc1807270c --- /dev/null +++ b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/HealthChecksSample.csproj @@ -0,0 +1,20 @@ + + + + netcoreapp3.0 + + + + + + + + + + + + + + + + diff --git a/samples/HealthChecksSample/LivenessProbeStartup.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/LivenessProbeStartup.cs similarity index 100% rename from samples/HealthChecksSample/LivenessProbeStartup.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/LivenessProbeStartup.cs diff --git a/samples/HealthChecksSample/ManagementPortStartup.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/ManagementPortStartup.cs similarity index 100% rename from samples/HealthChecksSample/ManagementPortStartup.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/ManagementPortStartup.cs diff --git a/samples/HealthChecksSample/MyContext.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/MyContext.cs similarity index 100% rename from samples/HealthChecksSample/MyContext.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/MyContext.cs diff --git a/samples/HealthChecksSample/Program.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/Program.cs similarity index 100% rename from samples/HealthChecksSample/Program.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/Program.cs diff --git a/samples/HealthChecksSample/Properties/launchSettings.json b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/Properties/launchSettings.json similarity index 100% rename from samples/HealthChecksSample/Properties/launchSettings.json rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/Properties/launchSettings.json diff --git a/samples/HealthChecksSample/SlowDependencyHealthCheck.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/SlowDependencyHealthCheck.cs similarity index 100% rename from samples/HealthChecksSample/SlowDependencyHealthCheck.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/SlowDependencyHealthCheck.cs diff --git a/samples/HealthChecksSample/SqlConnectionHealthCheck.cs b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/SqlConnectionHealthCheck.cs similarity index 100% rename from samples/HealthChecksSample/SqlConnectionHealthCheck.cs rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/SqlConnectionHealthCheck.cs diff --git a/samples/HealthChecksSample/appsettings.json b/src/Middleware/HealthChecks/test/testassets/HealthChecksSample/appsettings.json similarity index 100% rename from samples/HealthChecksSample/appsettings.json rename to src/Middleware/HealthChecks/test/testassets/HealthChecksSample/appsettings.json diff --git a/src/Middleware/MiddlewareAnalysis/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj b/src/Middleware/MiddlewareAnalysis/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj new file mode 100644 index 0000000000..9a9b2b4bff --- /dev/null +++ b/src/Middleware/MiddlewareAnalysis/samples/MiddlewareAnalysisSample/MiddlewareAnalysisSample.csproj @@ -0,0 +1,16 @@ + + + + netcoreapp3.0 + + + + + + + + + + + + diff --git a/samples/MiddlewareAnalysisSample/Startup.cs b/src/Middleware/MiddlewareAnalysis/samples/MiddlewareAnalysisSample/Startup.cs similarity index 100% rename from samples/MiddlewareAnalysisSample/Startup.cs rename to src/Middleware/MiddlewareAnalysis/samples/MiddlewareAnalysisSample/Startup.cs diff --git a/samples/StatusCodePagesSample/web.config b/src/Middleware/MiddlewareAnalysis/samples/MiddlewareAnalysisSample/web.config similarity index 100% rename from samples/StatusCodePagesSample/web.config rename to src/Middleware/MiddlewareAnalysis/samples/MiddlewareAnalysisSample/web.config diff --git a/src/Microsoft.AspNetCore.MiddlewareAnalysis/AnalysisBuilder.cs b/src/Middleware/MiddlewareAnalysis/src/AnalysisBuilder.cs similarity index 100% rename from src/Microsoft.AspNetCore.MiddlewareAnalysis/AnalysisBuilder.cs rename to src/Middleware/MiddlewareAnalysis/src/AnalysisBuilder.cs diff --git a/src/Microsoft.AspNetCore.MiddlewareAnalysis/AnalysisMiddleware.cs b/src/Middleware/MiddlewareAnalysis/src/AnalysisMiddleware.cs similarity index 100% rename from src/Microsoft.AspNetCore.MiddlewareAnalysis/AnalysisMiddleware.cs rename to src/Middleware/MiddlewareAnalysis/src/AnalysisMiddleware.cs diff --git a/src/Microsoft.AspNetCore.MiddlewareAnalysis/AnalysisServiceCollectionExtensions.cs b/src/Middleware/MiddlewareAnalysis/src/AnalysisServiceCollectionExtensions.cs similarity index 100% rename from src/Microsoft.AspNetCore.MiddlewareAnalysis/AnalysisServiceCollectionExtensions.cs rename to src/Middleware/MiddlewareAnalysis/src/AnalysisServiceCollectionExtensions.cs diff --git a/src/Microsoft.AspNetCore.MiddlewareAnalysis/AnalysisStartupFilter.cs b/src/Middleware/MiddlewareAnalysis/src/AnalysisStartupFilter.cs similarity index 100% rename from src/Microsoft.AspNetCore.MiddlewareAnalysis/AnalysisStartupFilter.cs rename to src/Middleware/MiddlewareAnalysis/src/AnalysisStartupFilter.cs diff --git a/src/Microsoft.AspNetCore.MiddlewareAnalysis/Microsoft.AspNetCore.MiddlewareAnalysis.csproj b/src/Middleware/MiddlewareAnalysis/src/Microsoft.AspNetCore.MiddlewareAnalysis.csproj similarity index 51% rename from src/Microsoft.AspNetCore.MiddlewareAnalysis/Microsoft.AspNetCore.MiddlewareAnalysis.csproj rename to src/Middleware/MiddlewareAnalysis/src/Microsoft.AspNetCore.MiddlewareAnalysis.csproj index 922d2ec938..c5bec0395a 100644 --- a/src/Microsoft.AspNetCore.MiddlewareAnalysis/Microsoft.AspNetCore.MiddlewareAnalysis.csproj +++ b/src/Middleware/MiddlewareAnalysis/src/Microsoft.AspNetCore.MiddlewareAnalysis.csproj @@ -9,9 +9,9 @@ - - - + + + diff --git a/src/Microsoft.AspNetCore.MiddlewareAnalysis/baseline.netcore.json b/src/Middleware/MiddlewareAnalysis/src/baseline.netcore.json similarity index 100% rename from src/Microsoft.AspNetCore.MiddlewareAnalysis/baseline.netcore.json rename to src/Middleware/MiddlewareAnalysis/src/baseline.netcore.json diff --git a/src/Middleware/MiddlewareAnalysis/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj b/src/Middleware/MiddlewareAnalysis/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj new file mode 100644 index 0000000000..d49320ea80 --- /dev/null +++ b/src/Middleware/MiddlewareAnalysis/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj @@ -0,0 +1,22 @@ + + + + $(StandardTestTfms) + + + + + + + + + + + + + + + + + + diff --git a/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/MiddlewareAnalysisTests.cs b/src/Middleware/MiddlewareAnalysis/test/MiddlewareAnalysisTests.cs similarity index 100% rename from test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/MiddlewareAnalysisTests.cs rename to src/Middleware/MiddlewareAnalysis/test/MiddlewareAnalysisTests.cs diff --git a/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/TestDiagnosticListener.cs b/src/Middleware/MiddlewareAnalysis/test/TestDiagnosticListener.cs similarity index 100% rename from test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/TestDiagnosticListener.cs rename to src/Middleware/MiddlewareAnalysis/test/TestDiagnosticListener.cs diff --git a/src/shared/AttributeValue.cs b/src/Shared/Diagnostics/AttributeValue.cs similarity index 100% rename from src/shared/AttributeValue.cs rename to src/Shared/Diagnostics/AttributeValue.cs diff --git a/src/shared/BaseView.cs b/src/Shared/Diagnostics/BaseView.cs similarity index 100% rename from src/shared/BaseView.cs rename to src/Shared/Diagnostics/BaseView.cs diff --git a/src/Shared/Diagnostics/Directory.Build.props b/src/Shared/Diagnostics/Directory.Build.props new file mode 100644 index 0000000000..446e684185 --- /dev/null +++ b/src/Shared/Diagnostics/Directory.Build.props @@ -0,0 +1,5 @@ + + + false + + \ No newline at end of file diff --git a/src/shared/HelperResult.cs b/src/Shared/Diagnostics/HelperResult.cs similarity index 100% rename from src/shared/HelperResult.cs rename to src/Shared/Diagnostics/HelperResult.cs diff --git a/test/Diagnostics.EFCore.FunctionalTests/Diagnostics.EFCore.FunctionalTests.csproj b/test/Diagnostics.EFCore.FunctionalTests/Diagnostics.EFCore.FunctionalTests.csproj deleted file mode 100644 index 0f42b911d8..0000000000 --- a/test/Diagnostics.EFCore.FunctionalTests/Diagnostics.EFCore.FunctionalTests.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - netcoreapp3.0 - - Diagnostics.EFCore.FunctionalTests - - - - - - - - - - - - - - - - - diff --git a/test/Diagnostics.FunctionalTests/Diagnostics.FunctionalTests.csproj b/test/Diagnostics.FunctionalTests/Diagnostics.FunctionalTests.csproj deleted file mode 100644 index 69d5faa1ec..0000000000 --- a/test/Diagnostics.FunctionalTests/Diagnostics.FunctionalTests.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - - netcoreapp3.0 - false - - Diagnostics.FunctionalTests - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Diagnostics.FunctionalTests/ElmPageSampleTest.cs b/test/Diagnostics.FunctionalTests/ElmPageSampleTest.cs deleted file mode 100644 index d5fc265e55..0000000000 --- a/test/Diagnostics.FunctionalTests/ElmPageSampleTest.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 System.Net; -using System.Net.Http; -using System.Threading.Tasks; -using Xunit; - -namespace Microsoft.AspNetCore.Diagnostics.FunctionalTests -{ - public class ElmPageSampleTest : IClassFixture> - { - public ElmPageSampleTest(TestFixture fixture) - { - Client = fixture.Client; - } - - public HttpClient Client { get; } - - [Fact] - public async Task ElmPagePage_ShowsError() - { - // Arrange - var request = new HttpRequestMessage(HttpMethod.Get, "http://localhost/throws"); - - // Act - var response = await Client.SendAsync(request); - - // Assert - var body = await response.Content.ReadAsStringAsync(); - Assert.Equal(HttpStatusCode.OK, response.StatusCode); - Assert.Contains("Elm Logs", body); - } - } -} diff --git a/test/Directory.Build.props b/test/Directory.Build.props deleted file mode 100644 index 4b89a431e7..0000000000 --- a/test/Directory.Build.props +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj b/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj deleted file mode 100644 index 85d0445c9d..0000000000 --- a/test/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.Tests.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests.csproj b/test/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests.csproj deleted file mode 100644 index 15ec911423..0000000000 --- a/test/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests/Microsoft.AspNetCore.Diagnostics.HealthChecks.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - netcoreapp3.0 - Microsoft.AspNetCore.Diagnostics.HealthChecks - - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmLoggerTest.cs b/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmLoggerTest.cs deleted file mode 100644 index 59cef168f1..0000000000 --- a/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmLoggerTest.cs +++ /dev/null @@ -1,356 +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 Microsoft.AspNetCore.Diagnostics.Elm; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Xunit; - -namespace Microsoft.AspNetCore.Diagnostics.Tests -{ - public class ElmLoggerTest - { - private const string _name = "test"; - private const string _state = "This is a test"; - private static Func _filter = (_, __) => true; - - private static Tuple SetUp(Func filter = null, string name = null) - { - // Arrange - var store = new ElmStore(); - var options = new ElmOptions() { Filter = filter ?? _filter }; - var provider = new ElmLoggerProvider(store, Options.Create(options)); - var logger = (ElmLogger)provider.CreateLogger(name ?? _name); - - return new Tuple(logger, store); - } - - [Fact] - public void LogsWhenNullFormatterGiven() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - // Act - logger.Log(LogLevel.Information, 0, _state, null, null); - - // Assert - Assert.Single(store.GetActivities()); - } - - [Fact] - public void DoesNotLogWithEmptyStateAndException() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - // Act - logger.Log(LogLevel.Information, 0, null, null, null); - - // Assert - Assert.Empty(store.GetActivities()); - } - - [Fact] - public void DefaultLogsForAllLogLevels() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - // Act - logger.Log(LogLevel.Trace, 0, _state, null, null); - logger.Log(LogLevel.Debug, 0, _state, null, null); - logger.Log(LogLevel.Information, 0, _state, null, null); - logger.Log(LogLevel.Warning, 0, _state, null, null); - logger.Log(LogLevel.Error, 0, _state, null, null); - logger.Log(LogLevel.Critical, 0, _state, null, null); - - // Assert - Assert.Equal(6, (store.GetActivities().SelectMany(a => NodeLogs(a.Root, new List()))).ToList().Count); - } - - [Theory] - [InlineData(LogLevel.Warning, "", 3)] - [InlineData(LogLevel.Warning, "te", 3)] - [InlineData(LogLevel.Warning, "bad", 0)] - [InlineData(LogLevel.Critical, "", 1)] - [InlineData(LogLevel.Critical, "test", 1)] - [InlineData(LogLevel.Trace, "t", 6)] - public void Filter_LogsWhenAppropriate(LogLevel minLevel, string prefix, int count) - { - // Arrange - var t = SetUp((name, level) => (name.StartsWith(prefix, StringComparison.Ordinal) && level >= minLevel), _name); - var logger = t.Item1; - var store = t.Item2; - - // Act - logger.Log(LogLevel.Trace, 0, _state, null, null); - logger.Log(LogLevel.Debug, 0, _state, null, null); - logger.Log(LogLevel.Information, 0, _state, null, null); - logger.Log(LogLevel.Warning, 0, _state, null, null); - logger.Log(LogLevel.Error, 0, _state, null, null); - logger.Log(LogLevel.Critical, 0, _state, null, null); - - // Assert - Assert.Equal(count, (store.GetActivities().SelectMany(a => NodeLogs(a.Root, new List()))).ToList().Count); - } - - [Fact] - public void CountReturnsCorrectNumber() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - // Act - using (logger.BeginScope("test14")) - { - for (var i = 0; i < 25; i++) - { - logger.LogWarning("hello world"); - } - using (logger.BeginScope("test15")) - { - for (var i = 0; i < 25; i++) - { - logger.LogCritical("goodbye world"); - } - } - } - - // Assert - Assert.Equal(50, store.Count()); - } - - [Fact] - public void ThreadsHaveSeparateActivityContexts() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - var testThread = new TestThread(logger); - Thread workerThread = new Thread(testThread.Work); - - // Act - workerThread.Start(); - using (logger.BeginScope("test1")) - { - logger.LogWarning("hello world"); - Thread.Sleep(1000); - logger.LogCritical("goodbye world"); - } - workerThread.Join(); - - // Assert - Assert.Equal(17, (store.GetActivities().SelectMany(a => NodeLogs(a.Root, new List()))).ToList().Count); - Assert.Equal(2, store.GetActivities().ToList().Count); - } - - [Fact] - public void ScopesHaveProperTreeStructure() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - var testThread = new TestThread(logger); - Thread workerThread = new Thread(testThread.Work); - - // Act - workerThread.Start(); - using (logger.BeginScope("test2")) - { - logger.LogWarning("hello world"); - Thread.Sleep(1000); - logger.LogCritical("goodbye world"); - } - workerThread.Join(); - - // Assert - // get the root of the activity for scope "test2" - var root1 = (store.GetActivities()) - .Where(a => string.Equals(a.Root.State?.ToString(), "test2"))? - .FirstOrDefault()? - .Root; - Assert.NotNull(root1); - var root2 = (store.GetActivities()) - .Where(a => string.Equals(a.Root.State?.ToString(), "test12"))? - .FirstOrDefault()? - .Root; - Assert.NotNull(root2); - - Assert.Empty(root1.Children); - Assert.Equal(2, root1.Messages.Count); - Assert.Single(root2.Children); - Assert.Equal(12, root2.Messages.Count); - Assert.Empty(root2.Children.First().Children); - Assert.Equal(3, root2.Children.First().Messages.Count); - } - - [Fact] - public void CollapseTree_CollapsesWhenNoLogsInSingleScope() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - // Act - using (logger.BeginScope("test3")) - { - } - - // Assert - Assert.Empty(store.GetActivities()); - } - - [Fact] - public void CollapseTree_CollapsesWhenNoLogsInNestedScope() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - // Act - using (logger.BeginScope("test4")) - { - using (logger.BeginScope("test5")) - { - } - } - - // Assert - Assert.Empty(store.GetActivities()); - } - - [Fact] - public void CollapseTree_DoesNotCollapseWhenLogsExist() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - // Act - using (logger.BeginScope("test6")) - { - using (logger.BeginScope("test7")) - { - logger.LogTrace("hi"); - } - } - - // Assert - Assert.Single(store.GetActivities()); - } - - [Fact] - public void CollapseTree_CollapsesAppropriateNodes() - { - // Arrange - var t = SetUp(); - var logger = t.Item1; - var store = t.Item2; - - // Act - using (logger.BeginScope("test8")) - { - logger.LogDebug("hi"); - using (logger.BeginScope("test9")) - { - } - } - - // Assert - Assert.Single(store.GetActivities()); - var context = store.GetActivities() - .Where(a => string.Equals(a.Root.State?.ToString(), "test8")) - .First(); - Assert.Empty(context.Root.Children); - } - - [Fact] - public void CollapseTree_WorksWithFilter() - { - // Arrange - var t = SetUp((_, level) => level >= LogLevel.Warning, null); - var logger = t.Item1; - var store = t.Item2; - - // Act - using (logger.BeginScope("test10")) - { - using (logger.BeginScope("test11")) - { - logger.LogInformation("hi"); - } - } - - // Assert - Assert.Empty(store.GetActivities()); - } - - private List NodeLogs(ScopeNode node, List logs) - { - if (node != null) - { - logs.AddRange(node.Messages); - foreach (var child in node.Children) - { - NodeLogs(child, logs); - } - } - return logs; - } - - private class TestThread - { - private ILogger _logger; - - public TestThread(ILogger logger) - { - _logger = logger; - } - - public void Work() - { - using (_logger.BeginScope("test12")) - { - for (var i = 0; i < 5; i++) - { - _logger.LogDebug(string.Format("xxx {0}", i)); - Thread.Sleep(5); - } - using (_logger.BeginScope("test13")) - { - for (var i = 0; i < 3; i++) - { - _logger.LogDebug(string.Format("yyy {0}", i)); - Thread.Sleep(200); - } - } - for (var i = 0; i < 7; i++) - { - _logger.LogDebug(string.Format("zzz {0}", i)); - Thread.Sleep(40); - } - } - } - } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmMiddlewareTest.cs b/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmMiddlewareTest.cs deleted file mode 100644 index 7a74e05a32..0000000000 --- a/test/Microsoft.AspNetCore.Diagnostics.Tests/ElmMiddlewareTest.cs +++ /dev/null @@ -1,316 +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.IO; -using System.Security.Claims; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Diagnostics.Elm; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Features; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; -using Moq; -using Xunit; - -namespace Microsoft.AspNetCore.Diagnostics.Tests -{ - public class ElmMiddlewareTest - { - private const string DefaultPath = "/Elm"; - - [Fact] - public void DefaultPageOptions_HasDefaultPath() - { - // Arrange & act - var options = new ElmOptions(); - - // Assert - Assert.Equal(DefaultPath, options.Path.Value); - } - - [Fact] - public async Task Invoke_WithNonMatchingPath_IgnoresRequest() - { - // Arrange - var elmStore = new ElmStore(); - var factory = new LoggerFactory(); - var optionsMock = new Mock>(); - optionsMock - .SetupGet(o => o.Value) - .Returns(new ElmOptions()); - factory.AddProvider(new ElmLoggerProvider(elmStore, optionsMock.Object)); - - RequestDelegate next = _ => - { - return Task.FromResult(null); - }; - - var captureMiddleware = new ElmCaptureMiddleware( - next, - factory, - optionsMock.Object); - var pageMiddleware = new ElmPageMiddleware( - next, - optionsMock.Object, - elmStore); - - var contextMock = GetMockContext("/nonmatchingpath"); - - // Act - await captureMiddleware.Invoke(contextMock.Object); - await pageMiddleware.Invoke(contextMock.Object); - - // Assert - // Request.Query is used by the ElmPageMiddleware to parse the query parameters - contextMock.VerifyGet(c => c.Request.Query, Times.Never()); - } - - [Fact] - public async Task Invoke_WithMatchingPath_FulfillsRequest() - { - // Arrange - var elmStore = new ElmStore(); - var factory = new LoggerFactory(); - var optionsMock = new Mock>(); - optionsMock - .SetupGet(o => o.Value) - .Returns(new ElmOptions()); - factory.AddProvider(new ElmLoggerProvider(elmStore, optionsMock.Object)); - - RequestDelegate next = _ => - { - return Task.FromResult(null); - }; - - var captureMiddleware = new ElmCaptureMiddleware( - next, - factory, - optionsMock.Object); - var pageMiddleware = new ElmPageMiddleware( - next, - optionsMock.Object, - elmStore); - var contextMock = GetMockContext("/Elm"); - - using (var responseStream = new MemoryStream()) - { - contextMock - .SetupGet(c => c.Response.Body) - .Returns(responseStream); - contextMock - .SetupGet(c => c.RequestServices) - .Returns(() => null); - - // Act - await captureMiddleware.Invoke(contextMock.Object); - await pageMiddleware.Invoke(contextMock.Object); - - string response = Encoding.UTF8.GetString(responseStream.ToArray()); - - // Assert - contextMock.VerifyGet(c => c.Request.Query, Times.AtLeastOnce()); - Assert.Contains("ASP.NET Core Logs", response); - } - } - - [Fact] - public async Task Invoke_BadRequestShowsError() - { - // Arrange - var elmStore = new ElmStore(); - var factory = new LoggerFactory(); - var optionsMock = new Mock>(); - optionsMock - .SetupGet(o => o.Value) - .Returns(new ElmOptions()); - factory.AddProvider(new ElmLoggerProvider(elmStore, optionsMock.Object)); - - RequestDelegate next = _ => - { - return Task.FromResult(null); - }; - - var captureMiddleware = new ElmCaptureMiddleware( - next, - factory, - optionsMock.Object); - var pageMiddleware = new ElmPageMiddleware( - next, - optionsMock.Object, - elmStore); - var contextMock = GetMockContext("/Elm/666"); - - using (var responseStream = new MemoryStream()) - { - contextMock - .SetupGet(c => c.Response.Body) - .Returns(responseStream); - - // Act - await captureMiddleware.Invoke(contextMock.Object); - await pageMiddleware.Invoke(contextMock.Object); - - string response = Encoding.UTF8.GetString(responseStream.ToArray()); - - // Assert - contextMock.VerifyGet(c => c.Request.Query, Times.AtLeastOnce()); - Assert.Contains("Invalid Id", response); - } - } - - private Mock GetMockContext(string path) - { - var contextMock = new Mock(MockBehavior.Strict); - contextMock - .SetupGet(c => c.Request.Path) - .Returns(new PathString(path)); - contextMock - .SetupGet(c => c.Request.Host) - .Returns(new HostString("localhost")); - contextMock - .SetupGet(c => c.Request.ContentType) - .Returns(""); - contextMock - .SetupGet(c => c.Request.Scheme) - .Returns("http"); - contextMock - .SetupGet(c => c.Request.Scheme) - .Returns("http"); - contextMock - .SetupGet(c => c.Response.StatusCode) - .Returns(200); - contextMock - .SetupGet(c => c.Response.Body) - .Returns(new Mock().Object); - contextMock - .SetupGet(c => c.User) - .Returns(new ClaimsPrincipal()); - contextMock - .SetupGet(c => c.Request.Method) - .Returns("GET"); - contextMock - .SetupGet(c => c.Request.Protocol) - .Returns("HTTP/1.1"); - contextMock - .SetupGet(c => c.Request.Headers) - .Returns(new Mock().Object); - contextMock - .SetupGet(c => c.Request.QueryString) - .Returns(new QueryString()); - contextMock - .SetupGet(c => c.Request.Query) - .Returns(new Mock().Object); - contextMock - .SetupGet(c => c.Request.Cookies) - .Returns(new Mock().Object); - contextMock - .Setup(c => c.Request.ReadFormAsync(It.IsAny())) - .Returns(Task.FromResult(new Mock().Object)); - contextMock - .Setup(c => c.Request.HasFormContentType) - .Returns(true); - var requestIdentifier = new Mock(); - requestIdentifier.Setup(f => f.TraceIdentifier).Returns(Guid.NewGuid().ToString()); - var featureCollection = new FeatureCollection(); - featureCollection.Set(requestIdentifier.Object); - contextMock - .SetupGet(c => c.Features) - .Returns(featureCollection); - return contextMock; - } - - [Fact] - public async Task SetsNewIdentifierFeature_IfNotPresentOnContext() - { - // Arrange - var context = new DefaultHttpContext(); - var loggerFactory = new LoggerFactory(); - loggerFactory.AddProvider(new ElmLoggerProvider(new ElmStore(), Options.Create(new ElmOptions()))); - - // Act & Assert - var errorPageMiddleware = new ElmCaptureMiddleware((innerContext) => - { - var feature = innerContext.Features.Get(); - Assert.NotNull(feature); - Assert.False(string.IsNullOrEmpty(feature.TraceIdentifier)); - return Task.FromResult(0); - }, loggerFactory, new TestElmOptions()); - - await errorPageMiddleware.Invoke(context); - - Assert.Null(context.Features.Get()); - } - - [Fact] - public async Task UsesIdentifierFeature_IfAlreadyPresentOnContext() - { - var context = new DefaultHttpContext(); - var requestIdentifierFeature = new HttpRequestIdentifierFeature() - { - TraceIdentifier = Guid.NewGuid().ToString() - }; - context.Features.Set(requestIdentifierFeature); - var loggerFactory = new LoggerFactory(); - loggerFactory.AddProvider(new ElmLoggerProvider(new ElmStore(), Options.Create(new ElmOptions()))); - - var errorPageMiddleware = new ElmCaptureMiddleware((innerContext) => - { - Assert.Same(requestIdentifierFeature, innerContext.Features.Get()); - return Task.FromResult(0); - }, loggerFactory, new TestElmOptions()); - - await errorPageMiddleware.Invoke(context); - - Assert.Same(requestIdentifierFeature, context.Features.Get()); - } - - [Theory] - [InlineData("")] - // Note that HttpRequestIdentifierFeature now provides a default TraceIdentifier and will never return null. - public async Task UpdatesTraceIdentifier_IfEmpty(string requestId) - { - var context = new DefaultHttpContext(); - var requestIdentifierFeature = new HttpRequestIdentifierFeature() { TraceIdentifier = requestId }; - context.Features.Set(requestIdentifierFeature); - var loggerFactory = new LoggerFactory(); - loggerFactory.AddProvider(new ElmLoggerProvider(new ElmStore(), Options.Create(new ElmOptions()))); - - var errorPageMiddleware = new ElmCaptureMiddleware((innerContext) => - { - var feature = innerContext.Features.Get(); - Assert.NotNull(feature); - Assert.False(string.IsNullOrEmpty(feature.TraceIdentifier)); - return Task.FromResult(0); - }, loggerFactory, new TestElmOptions()); - - await errorPageMiddleware.Invoke(context); - - Assert.Equal(requestId, context.Features.Get().TraceIdentifier); - } - - private class TestElmOptions : IOptions - { - private readonly ElmOptions _innerOptions; - - public TestElmOptions() : - this(new ElmOptions()) - { - } - - public TestElmOptions(ElmOptions innerOptions) - { - _innerOptions = innerOptions; - } - - public ElmOptions Value - { - get - { - return _innerOptions; - } - } - } - } -} diff --git a/test/Microsoft.AspNetCore.Diagnostics.Tests/Microsoft.AspNetCore.Diagnostics.Tests.csproj b/test/Microsoft.AspNetCore.Diagnostics.Tests/Microsoft.AspNetCore.Diagnostics.Tests.csproj deleted file mode 100644 index 40759b10ea..0000000000 --- a/test/Microsoft.AspNetCore.Diagnostics.Tests/Microsoft.AspNetCore.Diagnostics.Tests.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj b/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj deleted file mode 100644 index f3cec36793..0000000000 --- a/test/Microsoft.AspNetCore.MiddlewareAnalysis.Tests/Microsoft.AspNetCore.MiddlewareAnalysis.Tests.csproj +++ /dev/null @@ -1,22 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - - - - - - - - - - - - diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj b/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj deleted file mode 100644 index ad6eb242ff..0000000000 --- a/test/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests/Microsoft.Extensions.Diagnostics.HealthChecks.EntityFrameworkCore.Tests.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netcoreapp3.0;net461 - Microsoft.AspNetCore.Diagnostics.HealthChecks - - - - - - - - - - - - - - - diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/DefaultHealthCheckServiceTest.cs b/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/DefaultHealthCheckServiceTest.cs deleted file mode 100644 index 9ab991204e..0000000000 --- a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/DefaultHealthCheckServiceTest.cs +++ /dev/null @@ -1,419 +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.Logging.Testing; -using Microsoft.Extensions.Options; -using Xunit; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - public class DefaultHealthCheckServiceTest - { - [Fact] - public void Constructor_ThrowsUsefulExceptionForDuplicateNames() - { - // Arrange - // - // Doing this the old fashioned way so we can verify that the exception comes - // from the constructor. - var serviceCollection = new ServiceCollection(); - serviceCollection.AddLogging(); - serviceCollection.AddOptions(); - serviceCollection.AddHealthChecks() - .AddCheck("Foo", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))) - .AddCheck("Foo", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))) - .AddCheck("Bar", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))) - .AddCheck("Baz", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))) - .AddCheck("Baz", new DelegateHealthCheck(_ => Task.FromResult(HealthCheckResult.Healthy()))); - - var services = serviceCollection.BuildServiceProvider(); - - var scopeFactory = services.GetRequiredService(); - var options = services.GetRequiredService>(); - var logger = services.GetRequiredService>(); - - // Act - var exception = Assert.Throws(() => new DefaultHealthCheckService(scopeFactory, options, logger)); - - // Assert - Assert.StartsWith($"Duplicate health checks were registered with the name(s): Foo, Baz", exception.Message); - } - - [Fact] - public async Task CheckAsync_RunsAllChecksAndAggregatesResultsAsync() - { - const string DataKey = "Foo"; - const string DataValue = "Bar"; - const string DegradedMessage = "I'm not feeling so good"; - const string UnhealthyMessage = "Halp!"; - const string HealthyMessage = "Everything is A-OK"; - var exception = new Exception("Things are pretty bad!"); - - // Arrange - var data = new Dictionary() - { - { DataKey, DataValue } - }; - - var service = CreateHealthChecksService(b => - { - b.AddAsyncCheck("HealthyCheck", _ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage, data))); - b.AddAsyncCheck("DegradedCheck", _ => Task.FromResult(HealthCheckResult.Degraded(DegradedMessage))); - b.AddAsyncCheck("UnhealthyCheck", _ => Task.FromResult(HealthCheckResult.Unhealthy(UnhealthyMessage, exception))); - }); - - // Act - var results = await service.CheckHealthAsync(); - - // Assert - Assert.Collection( - results.Entries.OrderBy(kvp => kvp.Key), - actual => - { - Assert.Equal("DegradedCheck", actual.Key); - Assert.Equal(DegradedMessage, actual.Value.Description); - Assert.Equal(HealthStatus.Degraded, actual.Value.Status); - Assert.Null(actual.Value.Exception); - Assert.Empty(actual.Value.Data); - }, - actual => - { - Assert.Equal("HealthyCheck", actual.Key); - Assert.Equal(HealthyMessage, actual.Value.Description); - Assert.Equal(HealthStatus.Healthy, actual.Value.Status); - Assert.Null(actual.Value.Exception); - Assert.Collection(actual.Value.Data, item => - { - Assert.Equal(DataKey, item.Key); - Assert.Equal(DataValue, item.Value); - }); - }, - actual => - { - Assert.Equal("UnhealthyCheck", actual.Key); - Assert.Equal(UnhealthyMessage, actual.Value.Description); - Assert.Equal(HealthStatus.Unhealthy, actual.Value.Status); - Assert.Same(exception, actual.Value.Exception); - Assert.Empty(actual.Value.Data); - }); - } - - [Fact] - public async Task CheckAsync_RunsFilteredChecksAndAggregatesResultsAsync() - { - const string DataKey = "Foo"; - const string DataValue = "Bar"; - const string DegradedMessage = "I'm not feeling so good"; - const string UnhealthyMessage = "Halp!"; - const string HealthyMessage = "Everything is A-OK"; - var exception = new Exception("Things are pretty bad!"); - - // Arrange - var data = new Dictionary - { - { DataKey, DataValue } - }; - - var service = CreateHealthChecksService(b => - { - b.AddAsyncCheck("HealthyCheck", _ => Task.FromResult(HealthCheckResult.Healthy(HealthyMessage, data))); - b.AddAsyncCheck("DegradedCheck", _ => Task.FromResult(HealthCheckResult.Degraded(DegradedMessage))); - b.AddAsyncCheck("UnhealthyCheck", _ => Task.FromResult(HealthCheckResult.Unhealthy(UnhealthyMessage, exception))); - }); - - // Act - var results = await service.CheckHealthAsync(c => c.Name == "HealthyCheck"); - - // Assert - Assert.Collection(results.Entries, - actual => - { - Assert.Equal("HealthyCheck", actual.Key); - Assert.Equal(HealthyMessage, actual.Value.Description); - Assert.Equal(HealthStatus.Healthy, actual.Value.Status); - Assert.Null(actual.Value.Exception); - Assert.Collection(actual.Value.Data, item => - { - Assert.Equal(DataKey, item.Key); - Assert.Equal(DataValue, item.Value); - }); - }); - } - - [Fact] - public async Task CheckHealthAsync_SetsRegistrationForEachCheck() - { - // Arrange - var thrownException = new InvalidOperationException("Whoops!"); - var faultedException = new InvalidOperationException("Ohnoes!"); - - var service = CreateHealthChecksService(b => - { - b.AddCheck("A"); - b.AddCheck("B"); - b.AddCheck("C"); - }); - - // Act - var results = await service.CheckHealthAsync(); - - // Assert - Assert.Collection( - results.Entries, - actual => - { - Assert.Equal("A", actual.Key); - Assert.Collection( - actual.Value.Data, - kvp => Assert.Equal(kvp, new KeyValuePair("name", "A"))); - }, - actual => - { - Assert.Equal("B", actual.Key); - Assert.Collection( - actual.Value.Data, - kvp => Assert.Equal(kvp, new KeyValuePair("name", "B"))); - }, - actual => - { - Assert.Equal("C", actual.Key); - Assert.Collection( - actual.Value.Data, - kvp => Assert.Equal(kvp, new KeyValuePair("name", "C"))); - }); - } - - [Fact] - public async Task CheckHealthAsync_Cancellation_CanPropagate() - { - // Arrange - var insideCheck = new TaskCompletionSource(); - - var service = CreateHealthChecksService(b => - { - b.AddAsyncCheck("cancels", async ct => - { - insideCheck.SetResult(null); - - await Task.Delay(10000, ct); - return HealthCheckResult.Unhealthy(); - }); - }); - - var cancel = new CancellationTokenSource(); - var task = service.CheckHealthAsync(cancel.Token); - - // After this returns we know the check has started - await insideCheck.Task; - - cancel.Cancel(); - - // Act & Assert - await Assert.ThrowsAsync(async () => await task); - } - - [Fact] - public async Task CheckHealthAsync_ConvertsExceptionInHealthCheckToUnhealthyResultAsync() - { - // Arrange - var thrownException = new InvalidOperationException("Whoops!"); - var faultedException = new InvalidOperationException("Ohnoes!"); - - var service = CreateHealthChecksService(b => - { - b.AddAsyncCheck("Throws", ct => throw thrownException); - b.AddAsyncCheck("Faults", ct => Task.FromException(faultedException)); - b.AddAsyncCheck("Succeeds", ct => Task.FromResult(HealthCheckResult.Healthy())); - }); - - // Act - var results = await service.CheckHealthAsync(); - - // Assert - Assert.Collection( - results.Entries, - actual => - { - Assert.Equal("Throws", actual.Key); - Assert.Equal(thrownException.Message, actual.Value.Description); - Assert.Equal(HealthStatus.Unhealthy, actual.Value.Status); - Assert.Same(thrownException, actual.Value.Exception); - }, - actual => - { - Assert.Equal("Faults", actual.Key); - Assert.Equal(faultedException.Message, actual.Value.Description); - Assert.Equal(HealthStatus.Unhealthy, actual.Value.Status); - Assert.Same(faultedException, actual.Value.Exception); - }, - actual => - { - Assert.Equal("Succeeds", actual.Key); - Assert.Null(actual.Value.Description); - Assert.Equal(HealthStatus.Healthy, actual.Value.Status); - Assert.Null(actual.Value.Exception); - }); - } - - [Fact] - public async Task CheckHealthAsync_SetsUpALoggerScopeForEachCheck() - { - // Arrange - var sink = new TestSink(); - var check = new DelegateHealthCheck(cancellationToken => - { - Assert.Collection(sink.Scopes, - actual => - { - Assert.Equal(actual.LoggerName, typeof(DefaultHealthCheckService).FullName); - Assert.Collection((IEnumerable>)actual.Scope, - item => - { - Assert.Equal("HealthCheckName", item.Key); - Assert.Equal("TestScope", item.Value); - }); - }); - return Task.FromResult(HealthCheckResult.Healthy()); - }); - - var loggerFactory = new TestLoggerFactory(sink, enabled: true); - var service = CreateHealthChecksService(b => - { - // Override the logger factory for testing - b.Services.AddSingleton(loggerFactory); - - b.AddCheck("TestScope", check); - }); - - // Act - var results = await service.CheckHealthAsync(); - - // Assert - Assert.Collection(results.Entries, actual => - { - Assert.Equal("TestScope", actual.Key); - Assert.Equal(HealthStatus.Healthy, actual.Value.Status); - }); - } - - [Fact] - public async Task CheckHealthAsync_CheckCanDependOnTransientService() - { - // Arrange - var service = CreateHealthChecksService(b => - { - b.Services.AddTransient(); - - b.AddCheck("Test"); - }); - - // Act - var results = await service.CheckHealthAsync(); - - // Assert - Assert.Collection( - results.Entries, - actual => - { - Assert.Equal("Test", actual.Key); - Assert.Equal(HealthStatus.Healthy, actual.Value.Status); - }); - } - - [Fact] - public async Task CheckHealthAsync_CheckCanDependOnScopedService() - { - // Arrange - var service = CreateHealthChecksService(b => - { - b.Services.AddScoped(); - - b.AddCheck("Test"); - }); - - // Act - var results = await service.CheckHealthAsync(); - - // Assert - Assert.Collection( - results.Entries, - actual => - { - Assert.Equal("Test", actual.Key); - Assert.Equal(HealthStatus.Healthy, actual.Value.Status); - }); - } - - [Fact] - public async Task CheckHealthAsync_CheckCanDependOnSingletonService() - { - // Arrange - var service = CreateHealthChecksService(b => - { - b.Services.AddSingleton(); - - b.AddCheck("Test"); - }); - - // Act - var results = await service.CheckHealthAsync(); - - // Assert - Assert.Collection( - results.Entries, - actual => - { - Assert.Equal("Test", actual.Key); - Assert.Equal(HealthStatus.Healthy, actual.Value.Status); - }); - } - - private static DefaultHealthCheckService CreateHealthChecksService(Action configure) - { - var services = new ServiceCollection(); - services.AddLogging(); - services.AddOptions(); - - var builder = services.AddHealthChecks(); - if (configure != null) - { - configure(builder); - } - - return (DefaultHealthCheckService)services.BuildServiceProvider(validateScopes: true).GetRequiredService(); - } - - private class AnotherService { } - - private class CheckWithServiceDependency : IHealthCheck - { - public CheckWithServiceDependency(AnotherService _) - { - } - - public Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) - { - return Task.FromResult(HealthCheckResult.Healthy()); - } - } - - private class NameCapturingCheck : IHealthCheck - { - public Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) - { - var data = new Dictionary() - { - { "name", context.Registration.Name }, - }; - return Task.FromResult(HealthCheckResult.Healthy(data: data)); - } - } - } -} diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/DependencyInjection/HealthChecksBuilderTest.cs b/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/DependencyInjection/HealthChecksBuilderTest.cs deleted file mode 100644 index 4235f152a2..0000000000 --- a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/DependencyInjection/HealthChecksBuilderTest.cs +++ /dev/null @@ -1,257 +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; -using Microsoft.Extensions.Diagnostics.HealthChecks; -using Microsoft.Extensions.Options; -using Xunit; - -namespace Microsoft.Extensions.DependencyInjection -{ - // Integration tests for extension methods on IHealthCheckBuilder - // - // We test the longest overload of each 'family' of Add...Check methods, since they chain to each other. - public class HealthChecksBuilderTest - { - [Fact] - public void AddCheck_Instance() - { - // Arrange - var instance = new DelegateHealthCheck((_) => - { - return Task.FromResult(HealthCheckResult.Healthy()); - }); - - var services = CreateServices(); - services.AddHealthChecks().AddCheck("test", failureStatus: HealthStatus.Degraded,tags: new[] { "tag", }, instance: instance); - - var serviceProvider = services.BuildServiceProvider(); - - // Act - var options = serviceProvider.GetRequiredService>().Value; - - // Assert - var registration = Assert.Single(options.Registrations); - Assert.Equal("test", registration.Name); - Assert.Equal(HealthStatus.Degraded, registration.FailureStatus); - Assert.Equal(new[] { "tag", }, registration.Tags); - Assert.Same(instance, registration.Factory(serviceProvider)); - } - - [Fact] - public void AddCheck_T_TypeActivated() - { - // Arrange - var services = CreateServices(); - services.AddHealthChecks().AddCheck("test", failureStatus: HealthStatus.Degraded, tags: new[] { "tag", }); - - var serviceProvider = services.BuildServiceProvider(); - - // Act - var options = serviceProvider.GetRequiredService>().Value; - - // Assert - var registration = Assert.Single(options.Registrations); - Assert.Equal("test", registration.Name); - Assert.Equal(HealthStatus.Degraded, registration.FailureStatus); - Assert.Equal(new[] { "tag", }, registration.Tags); - Assert.IsType(registration.Factory(serviceProvider)); - } - - [Fact] - public void AddCheck_T_Service() - { - // Arrange - var instance = new TestHealthCheck(); - - var services = CreateServices(); - services.AddSingleton(instance); - services.AddHealthChecks().AddCheck("test", failureStatus: HealthStatus.Degraded, tags: new[] { "tag", }); - - var serviceProvider = services.BuildServiceProvider(); - - // Act - var options = serviceProvider.GetRequiredService>().Value; - - // Assert - var registration = Assert.Single(options.Registrations); - Assert.Equal("test", registration.Name); - Assert.Equal(HealthStatus.Degraded, registration.FailureStatus); - Assert.Equal(new[] { "tag", }, registration.Tags); - Assert.Same(instance, registration.Factory(serviceProvider)); - } - - [Fact] - public void AddTypeActivatedCheck() - { - // Arrange - var services = CreateServices(); - services - .AddHealthChecks() - .AddTypeActivatedCheck("test", failureStatus: HealthStatus.Degraded, tags: new[] { "tag", }, args: new object[] { 5, "hi", }); - - var serviceProvider = services.BuildServiceProvider(); - - // Act - var options = serviceProvider.GetRequiredService>().Value; - - // Assert - var registration = Assert.Single(options.Registrations); - Assert.Equal("test", registration.Name); - Assert.Equal(HealthStatus.Degraded, registration.FailureStatus); - Assert.Equal(new[] { "tag", }, registration.Tags); - - var check = Assert.IsType(registration.Factory(serviceProvider)); - Assert.Equal(5, check.I); - Assert.Equal("hi", check.S); - } - - [Fact] - public void AddDelegateCheck_NoArg() - { - // Arrange - var services = CreateServices(); - services.AddHealthChecks().AddCheck("test", tags: new[] { "tag", }, check: () => - { - return HealthCheckResult.Healthy(); - }); - - var serviceProvider = services.BuildServiceProvider(); - - // Act - var options = serviceProvider.GetRequiredService>().Value; - - // Assert - var registration = Assert.Single(options.Registrations); - Assert.Equal("test", registration.Name); - Assert.Equal(HealthStatus.Unhealthy, registration.FailureStatus); - Assert.Equal(new[] { "tag", }, registration.Tags); - Assert.IsType(registration.Factory(serviceProvider)); - } - - [Fact] - public void AddDelegateCheck_CancellationToken() - { - // Arrange - var services = CreateServices(); - services.AddHealthChecks().AddCheck("test", (_) => - { - return HealthCheckResult.Degraded(); - }, tags: new[] { "tag", }); - - var serviceProvider = services.BuildServiceProvider(); - - // Act - var options = serviceProvider.GetRequiredService>().Value; - - // Assert - var registration = Assert.Single(options.Registrations); - Assert.Equal("test", registration.Name); - Assert.Equal(HealthStatus.Unhealthy, registration.FailureStatus); - Assert.Equal(new[] { "tag", }, registration.Tags); - Assert.IsType(registration.Factory(serviceProvider)); - } - - [Fact] - public void AddAsyncDelegateCheck_NoArg() - { - // Arrange - var services = CreateServices(); - services.AddHealthChecks().AddAsyncCheck("test", () => - { - return Task.FromResult(HealthCheckResult.Healthy()); - }, tags: new[] { "tag", }); - - var serviceProvider = services.BuildServiceProvider(); - - // Act - var options = serviceProvider.GetRequiredService>().Value; - - // Assert - var registration = Assert.Single(options.Registrations); - Assert.Equal("test", registration.Name); - Assert.Equal(HealthStatus.Unhealthy, registration.FailureStatus); - Assert.Equal(new[] { "tag", }, registration.Tags); - Assert.IsType(registration.Factory(serviceProvider)); - } - - [Fact] - public void AddAsyncDelegateCheck_CancellationToken() - { - // Arrange - var services = CreateServices(); - services.AddHealthChecks().AddAsyncCheck("test", (_) => - { - return Task.FromResult(HealthCheckResult.Unhealthy()); - }, tags: new[] { "tag", }); - - var serviceProvider = services.BuildServiceProvider(); - - // Act - var options = serviceProvider.GetRequiredService>().Value; - - // Assert - var registration = Assert.Single(options.Registrations); - Assert.Equal("test", registration.Name); - Assert.Equal(HealthStatus.Unhealthy, registration.FailureStatus); - Assert.Equal(new[] { "tag", }, registration.Tags); - Assert.IsType(registration.Factory(serviceProvider)); - } - - [Fact] - public void ChecksCanBeRegisteredInMultipleCallsToAddHealthChecks() - { - var services = new ServiceCollection(); - services - .AddHealthChecks() - .AddAsyncCheck("Foo", () => Task.FromResult(HealthCheckResult.Healthy())); - services - .AddHealthChecks() - .AddAsyncCheck("Bar", () => Task.FromResult(HealthCheckResult.Healthy())); - - // Act - var options = services.BuildServiceProvider().GetRequiredService>(); - - // Assert - Assert.Collection( - options.Value.Registrations, - actual => Assert.Equal("Foo", actual.Name), - actual => Assert.Equal("Bar", actual.Name)); - } - - private IServiceCollection CreateServices() - { - var services = new ServiceCollection(); - services.AddLogging(); - services.AddOptions(); - return services; - } - - private class TestHealthCheck : IHealthCheck - { - public Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) - { - throw new System.NotImplementedException(); - } - } - - private class TestHealthCheckWithArgs : IHealthCheck - { - public TestHealthCheckWithArgs(int i, string s) - { - I = i; - S = s; - } - - public int I { get; set; } - - public string S { get; set; } - - public Task CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default) - { - throw new System.NotImplementedException(); - } - } - } -} diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/DependencyInjection/ServiceCollectionExtensionsTest.cs b/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/DependencyInjection/ServiceCollectionExtensionsTest.cs deleted file mode 100644 index 694a97628d..0000000000 --- a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/DependencyInjection/ServiceCollectionExtensionsTest.cs +++ /dev/null @@ -1,43 +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.Linq; -using Microsoft.Extensions.Diagnostics.HealthChecks; -using Microsoft.Extensions.Hosting; -using Xunit; - -namespace Microsoft.Extensions.DependencyInjection -{ - public class ServiceCollectionExtensionsTest - { - [Fact] - public void AddHealthChecks_RegistersSingletonHealthCheckServiceIdempotently() - { - // Arrange - var services = new ServiceCollection(); - - // Act - services.AddHealthChecks(); - services.AddHealthChecks(); - - // Assert - Assert.Collection(services.OrderBy(s => s.ServiceType.FullName), - actual => - { - Assert.Equal(ServiceLifetime.Singleton, actual.Lifetime); - Assert.Equal(typeof(HealthCheckService), actual.ServiceType); - Assert.Equal(typeof(DefaultHealthCheckService), actual.ImplementationType); - Assert.Null(actual.ImplementationInstance); - Assert.Null(actual.ImplementationFactory); - }, - actual => - { - Assert.Equal(ServiceLifetime.Singleton, actual.Lifetime); - Assert.Equal(typeof(IHostedService), actual.ServiceType); - Assert.Equal(typeof(HealthCheckPublisherHostedService), actual.ImplementationType); - Assert.Null(actual.ImplementationInstance); - Assert.Null(actual.ImplementationFactory); - }); - } - } -} diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/HealthCheckPublisherHostedServiceTest.cs b/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/HealthCheckPublisherHostedServiceTest.cs deleted file mode 100644 index 94687efcb8..0000000000 --- a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/HealthCheckPublisherHostedServiceTest.cs +++ /dev/null @@ -1,528 +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.AspNetCore.Testing; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Testing; -using Xunit; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - public class HealthCheckPublisherHostedServiceTest - { - [Fact] - public async Task StartAsync_WithoutPublishers_DoesNotStartTimer() - { - // Arrange - var publishers = new IHealthCheckPublisher[] - { - }; - - var service = CreateService(publishers); - - try - { - // Act - await service.StartAsync(); - - // Assert - Assert.False(service.IsTimerRunning); - Assert.False(service.IsStopping); - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - } - - [Fact] - public async Task StartAsync_WithPublishers_StartsTimer() - { - // Arrange - var publishers = new IHealthCheckPublisher[] - { - new TestPublisher(), - }; - - var service = CreateService(publishers); - - try - { - // Act - await service.StartAsync(); - - // Assert - Assert.True(service.IsTimerRunning); - Assert.False(service.IsStopping); - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - } - - [Fact] - public async Task StartAsync_WithPublishers_StartsTimer_RunsPublishers() - { - // Arrange - var unblock0 = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var unblock1 = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var unblock2 = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - - var publishers = new TestPublisher[] - { - new TestPublisher() { Wait = unblock0.Task, }, - new TestPublisher() { Wait = unblock1.Task, }, - new TestPublisher() { Wait = unblock2.Task, }, - }; - - var service = CreateService(publishers, configure: (options) => - { - options.Delay = TimeSpan.FromMilliseconds(0); - }); - - try - { - // Act - await service.StartAsync(); - - await publishers[0].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); - await publishers[1].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); - await publishers[2].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); - - unblock0.SetResult(null); - unblock1.SetResult(null); - unblock2.SetResult(null); - - // Assert - Assert.True(service.IsTimerRunning); - Assert.False(service.IsStopping); - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - } - - [Fact] - public async Task StopAsync_CancelsExecution() - { - // Arrange - var unblock = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - - var publishers = new TestPublisher[] - { - new TestPublisher() { Wait = unblock.Task, } - }; - - var service = CreateService(publishers); - - try - { - await service.StartAsync(); - - // Start execution - var running = service.RunAsync(); - - // Wait for the publisher to see the cancellation token - await publishers[0].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); - Assert.Single(publishers[0].Entries); - - // Act - await service.StopAsync(); // Trigger cancellation - - // Assert - await AssertCancelledAsync(publishers[0].Entries[0].cancellationToken); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - - unblock.SetResult(null); - - await running.TimeoutAfter(TimeSpan.FromSeconds(10)); - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - } - - [Fact] - public async Task RunAsync_WaitsForCompletion_Single() - { - // Arrange - var sink = new TestSink(); - - var unblock = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - - var publishers = new TestPublisher[] - { - new TestPublisher() { Wait = unblock.Task, }, - }; - - var service = CreateService(publishers, sink: sink); - - try - { - await service.StartAsync(); - - // Act - var running = service.RunAsync(); - - await publishers[0].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); - - unblock.SetResult(null); - - await running.TimeoutAfter(TimeSpan.FromSeconds(10)); - - // Assert - Assert.True(service.IsTimerRunning); - Assert.False(service.IsStopping); - - for (var i = 0; i < publishers.Length; i++) - { - var report = Assert.Single(publishers[i].Entries).report; - Assert.Equal(new[] { "one", "two", }, report.Entries.Keys.OrderBy(k => k)); - } - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - - Assert.Collection( - sink.Writes, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherProcessingBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckProcessingBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckEnd, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckEnd, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckProcessingEnd, entry.EventId); }, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherBegin, entry.EventId); }, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherEnd, entry.EventId); }, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherProcessingEnd, entry.EventId); }); - } - - // Not testing logs here to avoid differences in logging order - [Fact] - public async Task RunAsync_WaitsForCompletion_Multiple() - { - // Arrange - var unblock0 = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var unblock1 = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - var unblock2 = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - - var publishers = new TestPublisher[] - { - new TestPublisher() { Wait = unblock0.Task, }, - new TestPublisher() { Wait = unblock1.Task, }, - new TestPublisher() { Wait = unblock2.Task, }, - }; - - var service = CreateService(publishers); - - try - { - await service.StartAsync(); - - // Act - var running = service.RunAsync(); - - await publishers[0].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); - await publishers[1].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); - await publishers[2].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); - - unblock0.SetResult(null); - unblock1.SetResult(null); - unblock2.SetResult(null); - - await running.TimeoutAfter(TimeSpan.FromSeconds(10)); - - // Assert - Assert.True(service.IsTimerRunning); - Assert.False(service.IsStopping); - - for (var i = 0; i < publishers.Length; i++) - { - var report = Assert.Single(publishers[i].Entries).report; - Assert.Equal(new[] { "one", "two", }, report.Entries.Keys.OrderBy(k => k)); - } - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - } - - [Fact] - public async Task RunAsync_PublishersCanTimeout() - { - // Arrange - var sink = new TestSink(); - var unblock = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - - var publishers = new TestPublisher[] - { - new TestPublisher() { Wait = unblock.Task, }, - }; - - var service = CreateService(publishers, sink: sink, configure: (options) => - { - options.Timeout = TimeSpan.FromMilliseconds(50); - }); - - try - { - await service.StartAsync(); - - // Act - var running = service.RunAsync(); - - await publishers[0].Started.TimeoutAfter(TimeSpan.FromSeconds(10)); - - await AssertCancelledAsync(publishers[0].Entries[0].cancellationToken); - - unblock.SetResult(null); - - await running.TimeoutAfter(TimeSpan.FromSeconds(10)); - - // Assert - Assert.True(service.IsTimerRunning); - Assert.False(service.IsStopping); - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - - Assert.Collection( - sink.Writes, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherProcessingBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckProcessingBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckEnd, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckEnd, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckProcessingEnd, entry.EventId); }, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherBegin, entry.EventId); }, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherTimeout, entry.EventId); }, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherProcessingEnd, entry.EventId); }); - } - - [Fact] - public async Task RunAsync_CanFilterHealthChecks() - { - // Arrange - var publishers = new TestPublisher[] - { - new TestPublisher(), - new TestPublisher(), - }; - - var service = CreateService(publishers, configure: (options) => - { - options.Predicate = (r) => r.Name == "one"; - }); - - try - { - await service.StartAsync(); - - // Act - await service.RunAsync().TimeoutAfter(TimeSpan.FromSeconds(10)); - - // Assert - for (var i = 0; i < publishers.Length; i++) - { - var report = Assert.Single(publishers[i].Entries).report; - Assert.Equal(new[] { "one", }, report.Entries.Keys.OrderBy(k => k)); - } - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - } - - [Fact] - public async Task RunAsync_HandlesExceptions() - { - // Arrange - var sink = new TestSink(); - var publishers = new TestPublisher[] - { - new TestPublisher() { Exception = new InvalidTimeZoneException(), }, - }; - - var service = CreateService(publishers, sink: sink); - - try - { - await service.StartAsync(); - - // Act - await service.RunAsync().TimeoutAfter(TimeSpan.FromSeconds(10)); - - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - - Assert.Collection( - sink.Writes, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherProcessingBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckProcessingBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckEnd, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckBegin, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckEnd, entry.EventId); }, - entry => { Assert.Equal(DefaultHealthCheckService.EventIds.HealthCheckProcessingEnd, entry.EventId); }, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherBegin, entry.EventId); }, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherError, entry.EventId); }, - entry => { Assert.Equal(HealthCheckPublisherHostedService.EventIds.HealthCheckPublisherProcessingEnd, entry.EventId); }); - } - - // Not testing logging here to avoid flaky ordering issues - [Fact] - public async Task RunAsync_HandlesExceptions_Multiple() - { - // Arrange - var sink = new TestSink(); - var publishers = new TestPublisher[] - { - new TestPublisher() { Exception = new InvalidTimeZoneException(), }, - new TestPublisher(), - new TestPublisher() { Exception = new InvalidTimeZoneException(), }, - }; - - var service = CreateService(publishers, sink: sink); - - try - { - await service.StartAsync(); - - // Act - await service.RunAsync().TimeoutAfter(TimeSpan.FromSeconds(10)); - - } - finally - { - await service.StopAsync(); - Assert.False(service.IsTimerRunning); - Assert.True(service.IsStopping); - } - } - - private HealthCheckPublisherHostedService CreateService( - IHealthCheckPublisher[] publishers, - Action configure = null, - TestSink sink = null) - { - var serviceCollection = new ServiceCollection(); - serviceCollection.AddOptions(); - serviceCollection.AddLogging(); - serviceCollection.AddHealthChecks() - .AddCheck("one", () => { return HealthCheckResult.Healthy(); }) - .AddCheck("two", () => { return HealthCheckResult.Healthy(); }); - - // Choosing big values for tests to make sure that we're not dependent on the defaults. - // All of the tests that rely on the timer will set their own values for speed. - serviceCollection.Configure(options => - { - options.Delay = TimeSpan.FromMinutes(5); - options.Period = TimeSpan.FromMinutes(5); - options.Timeout = TimeSpan.FromMinutes(5); - }); - - if (publishers != null) - { - for (var i = 0; i < publishers.Length; i++) - { - serviceCollection.AddSingleton(publishers[i]); - } - } - - if (configure != null) - { - serviceCollection.Configure(configure); - } - - if (sink != null) - { - serviceCollection.AddSingleton(new TestLoggerFactory(sink, enabled: true)); - } - - var services = serviceCollection.BuildServiceProvider(); - return services.GetServices().OfType< HealthCheckPublisherHostedService>().Single(); - } - - private static async Task AssertCancelledAsync(CancellationToken cancellationToken) - { - await Assert.ThrowsAsync(() => Task.Delay(TimeSpan.FromSeconds(10), cancellationToken)); - } - - private class TestPublisher : IHealthCheckPublisher - { - private TaskCompletionSource _started; - - public TestPublisher() - { - _started = new TaskCompletionSource(TaskCreationOptions.RunContinuationsAsynchronously); - } - - public List<(HealthReport report, CancellationToken cancellationToken)> Entries { get; } = new List<(HealthReport report, CancellationToken cancellationToken)>(); - - public Exception Exception { get; set; } - - public Task Started => _started.Task; - - public Task Wait { get; set; } - - public async Task PublishAsync(HealthReport report, CancellationToken cancellationToken) - { - Entries.Add((report, cancellationToken)); - - // Signal that we've started - _started.SetResult(null); - - if (Wait != null) - { - await Wait; - } - - if (Exception != null) - { - throw Exception; - } - - cancellationToken.ThrowIfCancellationRequested(); - } - } - } -} diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/HealthReportTest.cs b/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/HealthReportTest.cs deleted file mode 100644 index 07f8e5a8e3..0000000000 --- a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/HealthReportTest.cs +++ /dev/null @@ -1,45 +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 Xunit; - -namespace Microsoft.Extensions.Diagnostics.HealthChecks -{ - public class HealthReportTest - { - [Theory] - [InlineData(HealthStatus.Healthy)] - [InlineData(HealthStatus.Degraded)] - [InlineData(HealthStatus.Unhealthy)] - public void Status_MatchesWorstStatusInResults(HealthStatus status) - { - var result = new HealthReport(new Dictionary() - { - {"Foo", new HealthReportEntry(HealthStatus.Healthy, null,TimeSpan.MinValue, null, null) }, - {"Bar", new HealthReportEntry(HealthStatus.Healthy, null, TimeSpan.MinValue,null, null) }, - {"Baz", new HealthReportEntry(status, exception: null, description: null,duration:TimeSpan.MinValue, data: null) }, - {"Quick", new HealthReportEntry(HealthStatus.Healthy, null, TimeSpan.MinValue, null, null) }, - {"Quack", new HealthReportEntry(HealthStatus.Healthy, null, TimeSpan.MinValue, null, null) }, - {"Quock", new HealthReportEntry(HealthStatus.Healthy, null, TimeSpan.MinValue, null, null) }, - }, totalDuration: TimeSpan.MinValue); - - Assert.Equal(status, result.Status); - } - - [Theory] - [InlineData(200)] - [InlineData(300)] - [InlineData(400)] - public void TotalDuration_MatchesTotalDurationParameter(int milliseconds) - { - var result = new HealthReport(new Dictionary() - { - {"Foo", new HealthReportEntry(HealthStatus.Healthy, null,TimeSpan.MinValue, null, null) } - }, totalDuration: TimeSpan.FromMilliseconds(milliseconds)); - - Assert.Equal(TimeSpan.FromMilliseconds(milliseconds), result.TotalDuration); - } - } -} diff --git a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/Microsoft.Extensions.Diagnostics.HealthChecks.Tests.csproj b/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/Microsoft.Extensions.Diagnostics.HealthChecks.Tests.csproj deleted file mode 100644 index dc8d2cf9ea..0000000000 --- a/test/Microsoft.Extensions.Diagnostics.HealthChecks.Tests/Microsoft.Extensions.Diagnostics.HealthChecks.Tests.csproj +++ /dev/null @@ -1,19 +0,0 @@ - - - - netcoreapp3.0;net461 - Microsoft.Extensions.Diagnostics.HealthChecks - - - - - - - - - - - - - - diff --git a/version.props b/version.props deleted file mode 100644 index 0c50eff262..0000000000 --- a/version.props +++ /dev/null @@ -1,17 +0,0 @@ - - - 3.0.0 - alpha1 - $(VersionPrefix) - $(VersionPrefix)-$(VersionSuffix)-final - t000 - a- - $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-')) - $(VersionSuffix)-$(BuildNumber) - 0.6.0 - alpha1 - $(ExperimentalVersionPrefix) - $(ExperimentalVersionPrefix)-$(ExperimentalVersionSuffix)-final - $(ExperimentalVersionSuffix)-$(BuildNumber) - -