Merge branch 'master' into merge/release/3.0-preview4-to-master

This commit is contained in:
Doug Bunting 2019-04-13 22:50:36 -07:00 committed by GitHub
commit 0d16b79d26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
316 changed files with 6181 additions and 29452 deletions

View File

@ -303,15 +303,10 @@ jobs:
displayName: Install SQL Server 2016 Express LocalDB
- powershell: "& ./src/Servers/IIS/tools/UpdateIISExpressCertificate.ps1; & ./src/Servers/IIS/tools/update_schema.ps1"
displayName: Setup IISExpress test certificates and schema
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe"
displayName: Start AppVerifier
afterBuild:
- powershell: "& ./build.ps1 -CI -NoBuild -Test /p:RunFlakyTests=true"
displayName: Run Flaky Tests
continueOnError: true
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Shutdown signalrclienttests.exe"
displayName: Stop AppVerifier
condition: always()
artifacts:
- name: Windows_Test_Logs
path: artifacts/logs/

View File

@ -189,13 +189,21 @@ jobs:
buildConfiguration: $(BuildConfiguration)
buildPlatform: $(AgentOsName)
- task: PublishTestResults@2
displayName: Publish junit test results
displayName: Publish js test results
condition: always()
inputs:
testRunner: junit
testResultsFiles: '**/artifacts/logs/**/*.junit.xml'
buildConfiguration: $(BuildConfiguration)
buildPlatform: $(AgentOsName)
- task: PublishTestResults@2
displayName: Publish Java test results
condition: always()
inputs:
testRunner: junit
testResultsFiles: '**/TEST-com.microsoft.signalr*.xml'
buildConfiguration: $(BuildConfiguration)
buildPlatform: $(AgentOsName)
- ${{ each artifact in parameters.artifacts }}:
- task: PublishBuildArtifacts@1
displayName: Upload artifacts from ${{ artifact.path }}

View File

@ -14,11 +14,4 @@ jobs:
agentOs: Windows
jobName: SignalRDailyTests
jobDisplayName: "SignalR Daily Tests"
beforeBuild:
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Setup signalrclienttests.exe"
displayName: Start AppVerifier
afterBuild:
- powershell: "& ./.azure/pipelines/tools/SetupTestEnvironment.ps1 Shutdown signalrclienttests.exe"
displayName: Stop AppVerifier
condition: always()

30
.github/CODEOWNERS vendored
View File

@ -1,18 +1,18 @@
# Users referenced in this file will automatically be requested as reviewers for PRs that modify the given paths.
# See https://help.github.com/articles/about-code-owners/
/.azure/ @dougbu
/.config/ @dougbu
/build/ @dougbu
/eng/ @dougbu
/src/Components/ @SteveSandersonMS
/src/DefaultBuilder/ @tratcher @anurse
/src/Hosting/ @tratcher @anurse
/src/Http/ @tratcher @jkotalik @anurse
/src/Middleware/ @tratcher @anurse
/src/ProjectTemplates/ @ryanbrandenburg
/src/Security/ @tratcher @anurse
/src/Servers/ @tratcher @jkotalik @anurse
/src/Middleware/Rewrite @jkotalik @anurse
/src/Middleware/HttpsPolicy @jkotalik @anurse
/src/SignalR/ @mikaelm12 @BrennanConroy @halter73 @anurse
/.azure/ @aspnet/build
/.config/ @aspnet/build
/build/ @aspnet/build
/eng/ @aspnet/build
/src/Components/ @SteveSandersonMS
/src/DefaultBuilder/ @tratcher @anurse
/src/Hosting/ @tratcher @anurse
/src/Http/ @tratcher @jkotalik @anurse
/src/Middleware/ @tratcher @anurse
/src/ProjectTemplates/ @ryanbrandenburg
/src/Security/ @tratcher @anurse
/src/Servers/ @tratcher @jkotalik @anurse
/src/Middleware/Rewrite @jkotalik @anurse
/src/Middleware/HttpsPolicy @jkotalik @anurse
/src/SignalR/ @mikaelm12 @BrennanConroy @halter73 @anurse

View File

@ -54,8 +54,6 @@
$(RepositoryRoot)src\Tools\dotnet-watch\test\TestProjects\**\*.csproj;
$(RepositoryRoot)src\Razor\Razor.Design\test\testassets\**\*.*proj;
$(RepositoryRoot)src\submodules\**\*.*proj;
$(RepositoryRoot)src\SignalR\clients\cpp\samples\**\*.*proj;
$(RepositoryRoot)src\SignalR\clients\cpp\test\signalrclient-testhost\**\*.*proj;
$(RepositoryRoot)src\Installers\**\*.*proj;
$(RepositoryRoot)src\SignalR\clients\ts\**\node_modules\**\*.*proj;
$(RepositoryRoot)src\Components\Blazor\Templates\src\content\**\*.*proj;

View File

@ -20,6 +20,7 @@
https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json;
https://dotnet.myget.org/F/blazor-dev/api/v3/index.json;
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
https://dotnet.myget.org/F/nuget-build/api/v3/index.json;
https://dotnet.myget.org/F/roslyn-tools/api/v3/index.json;
https://dotnet.myget.org/F/roslyn/api/v3/index.json;
https://vside.myget.org/F/devcore/api/v3/index.json;

View File

@ -12,7 +12,7 @@
<ItemGroup>
<PackageReference Remove="Internal.AspNetCore.Sdk" />
<PackageReference Include="NuGet.Build.Tasks" Version="4.9.3" />
<PackageReference Include="NuGet.Build.Tasks" Version="5.1.0-rtm.5921" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.1.0" />
<PackageReference Include="Yarn.MSBuild" Version="1.13.0" />
</ItemGroup>

View File

@ -19,9 +19,8 @@ Building ASP.NET Core on Windows requires:
PS> ./eng/scripts/InstallVisualStudio.ps1
```
* Git. <https://git-scm.org>
* (Optional) some optional components, like the SignalR Java client, may require
* NodeJS. LTS version of 10.14.2 or newer recommended <https://nodejs.org>
* Java Development Kit (JDK) v8 with Java Runtime Environment (JRE) v8. See https://www.oracle.com/technetwork/java/javase/downloads/index.html
* NodeJS. LTS version of 10.14.2 or newer <https://nodejs.org>
* Java Development Kit (JDK) v8 with Java Runtime Environment (JRE) v8. See https://www.oracle.com/technetwork/java/javase/downloads/index.html
### macOS/Linux
@ -31,11 +30,10 @@ Building ASP.NET Core on macOS or Linux requires:
* If using Linux, you need a machine with all .NET Core Linux prerequisites: <https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites>
* At least 10 GB of disk space and a good internet connection (our build scripts download a lot of tools and dependencies)
* Git <https://git-scm.org>
* (Optional) some optional components, like the SignalR Java client, may require
* NodeJS. LTS version of 10.14.2 or newer recommended <https://nodejs.org>
* Java Development Kit 10 or newer. Either:
* OpenJDK <http://jdk.java.net/10/>
* Oracle's JDK <https://www.oracle.com/technetwork/java/javase/downloads/index.html>
* NodeJS. LTS version of 10.14.2 or newer <https://nodejs.org>
* Java Development Kit 10 or newer. Either:
* OpenJDK <http://jdk.java.net/10/>
* Oracle's JDK <https://www.oracle.com/technetwork/java/javase/downloads/index.html>
## Clone the source code

View File

@ -14,6 +14,10 @@ If you want to download the latest daily build and use it in a project, then you
<packageSources>
<clear />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="extensions" value="https://dotnetfeed.blob.core.windows.net/aspnet-extensions/index.json" />
<add key="entityframeworkcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-entityframeworkcore/index.json" />
<add key="aspnetcore-tooling" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore-tooling/index.json" />
<add key="aspnetcore" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>

View File

@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
<AspNetCoreBaselineVersion>2.2.3</AspNetCoreBaselineVersion>
<AspNetCoreBaselineVersion>2.2.4</AspNetCoreBaselineVersion>
</PropertyGroup>
<!-- Package: dotnet-dev-certs-->
<PropertyGroup Condition=" '$(PackageId)' == 'dotnet-dev-certs' ">
@ -81,7 +81,7 @@
</PropertyGroup>
<!-- Package: Microsoft.AspNetCore.AspNetCoreModuleV2-->
<PropertyGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.AspNetCoreModuleV2' ">
<BaselinePackageVersion>2.2.2</BaselinePackageVersion>
<BaselinePackageVersion>2.2.4</BaselinePackageVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(PackageId)' == 'Microsoft.AspNetCore.AspNetCoreModuleV2' AND '$(TargetFramework)' == 'netcoreapp2.2' " />
<!-- Package: Microsoft.AspNetCore.Authentication.Abstractions-->

View File

@ -4,7 +4,7 @@ This file contains a list of all the packages and their versions which were rele
build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch.
-->
<Baseline Version="2.2.3">
<Baseline Version="2.2.4">
<Package Id="dotnet-dev-certs" Version="2.2.0" />
<Package Id="dotnet-sql-cache" Version="2.2.0" />
<Package Id="dotnet-user-secrets" Version="2.2.0" />
@ -13,7 +13,7 @@ build of ASP.NET Core 2.2.x. Update this list when preparing for a new patch.
<Package Id="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" Version="2.2.0-preview-35687" />
<Package Id="Microsoft.AspNetCore.ApplicationInsights.HostingStartup" Version="2.2.0" />
<Package Id="Microsoft.AspNetCore.AspNetCoreModule" Version="2.2.1" />
<Package Id="Microsoft.AspNetCore.AspNetCoreModuleV2" Version="2.2.2" />
<Package Id="Microsoft.AspNetCore.AspNetCoreModuleV2" Version="2.2.4" />
<Package Id="Microsoft.AspNetCore.Authentication.Abstractions" Version="2.2.0" />
<Package Id="Microsoft.AspNetCore.Authentication.AzureAD.UI" Version="2.2.0" />
<Package Id="Microsoft.AspNetCore.Authentication.AzureADB2C.UI" Version="2.2.0" />

View File

@ -36,6 +36,15 @@ Later on, this will be checked using this condition:
<PropertyGroup Condition=" '$(VersionPrefix)' == '2.2.4' ">
<PackagesInPatch>
@aspnet/signalr;
Microsoft.AspNetCore.AspNetCoreModuleV2;
</PackagesInPatch>
</PropertyGroup>
<PropertyGroup Condition=" '$(VersionPrefix)' == '2.2.5' ">
<PackagesInPatch>
Microsoft.AspNetCore.AspNetCoreModule;
Microsoft.AspNetCore.AspNetCoreModuleV2;
java:signalr;
</PackagesInPatch>
</PropertyGroup>
</Project>

View File

@ -119,6 +119,7 @@
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Http.Connections.Client" ProjectPath="$(RepositoryRoot)src\SignalR\clients\csharp\Http.Connections.Client\src\Microsoft.AspNetCore.Http.Connections.Client.csproj" RefProjectPath="$(RepositoryRoot)src\SignalR\clients\csharp\Http.Connections.Client\ref\Microsoft.AspNetCore.Http.Connections.Client.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Http.Connections.Common" ProjectPath="$(RepositoryRoot)src\SignalR\common\Http.Connections.Common\src\Microsoft.AspNetCore.Http.Connections.Common.csproj" RefProjectPath="$(RepositoryRoot)src\SignalR\common\Http.Connections.Common\ref\Microsoft.AspNetCore.Http.Connections.Common.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Http.Connections" ProjectPath="$(RepositoryRoot)src\SignalR\common\Http.Connections\src\Microsoft.AspNetCore.Http.Connections.csproj" RefProjectPath="$(RepositoryRoot)src\SignalR\common\Http.Connections\ref\Microsoft.AspNetCore.Http.Connections.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.SignalR.Protocols.Json" ProjectPath="$(RepositoryRoot)src\SignalR\common\Protocols.Json\src\Microsoft.AspNetCore.SignalR.Protocols.Json.csproj" RefProjectPath="$(RepositoryRoot)src\SignalR\common\Protocols.Json\ref\Microsoft.AspNetCore.SignalR.Protocols.Json.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" ProjectPath="$(RepositoryRoot)src\SignalR\common\Protocols.MessagePack\src\Microsoft.AspNetCore.SignalR.Protocols.MessagePack.csproj" RefProjectPath="$(RepositoryRoot)src\SignalR\common\Protocols.MessagePack\ref\Microsoft.AspNetCore.SignalR.Protocols.MessagePack.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" ProjectPath="$(RepositoryRoot)src\SignalR\common\Protocols.NewtonsoftJson\src\Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson.csproj" RefProjectPath="$(RepositoryRoot)src\SignalR\common\Protocols.NewtonsoftJson\ref\Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.SignalR.Common" ProjectPath="$(RepositoryRoot)src\SignalR\common\SignalR.Common\src\Microsoft.AspNetCore.SignalR.Common.csproj" RefProjectPath="$(RepositoryRoot)src\SignalR\common\SignalR.Common\ref\Microsoft.AspNetCore.SignalR.Common.csproj" />

View File

@ -11,6 +11,7 @@
<AspNetCoreAppReferenceAndPackage Include="Microsoft.AspNetCore.Http.Features" />
<AspNetCoreAppReferenceAndPackage Include="Microsoft.AspNetCore.Connections.Abstractions" />
<AspNetCoreAppReferenceAndPackage Include="Microsoft.AspNetCore.Http.Connections.Common" />
<AspNetCoreAppReferenceAndPackage Include="Microsoft.AspNetCore.SignalR.Protocols.Json" />
<AspNetCoreAppReferenceAndPackage Include="Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson" />
<AspNetCoreAppReferenceAndPackage Include="Microsoft.AspNetCore.SignalR.Common" />
<AspNetCoreAppReferenceAndPackage Include="Microsoft.AspNetCore.Components.Browser" />

View File

@ -9,384 +9,384 @@
-->
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.AspNetCore.Razor.Language" Version="3.0.0-preview4.19213.3">
<Dependency Name="Microsoft.AspNetCore.Razor.Language" Version="3.0.0-preview5.19212.3">
<Uri>https://github.com/aspnet/AspNetCore-Tooling</Uri>
<Sha>9aa97d76f4a811b4caa9c94c2659a14c888370c3</Sha>
<Sha>81ea07caf7e5063b5f593d2d6a14d997643152e5</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="3.0.0-preview4.19213.3">
<Dependency Name="Microsoft.AspNetCore.Mvc.Razor.Extensions" Version="3.0.0-preview5.19212.3">
<Uri>https://github.com/aspnet/AspNetCore-Tooling</Uri>
<Sha>9aa97d76f4a811b4caa9c94c2659a14c888370c3</Sha>
<Sha>81ea07caf7e5063b5f593d2d6a14d997643152e5</Sha>
</Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Razor" Version="3.0.0-preview4.19213.3">
<Dependency Name="Microsoft.CodeAnalysis.Razor" Version="3.0.0-preview5.19212.3">
<Uri>https://github.com/aspnet/AspNetCore-Tooling</Uri>
<Sha>9aa97d76f4a811b4caa9c94c2659a14c888370c3</Sha>
<Sha>81ea07caf7e5063b5f593d2d6a14d997643152e5</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Sdk.Razor" Version="3.0.0-preview4.19213.3">
<Dependency Name="Microsoft.NET.Sdk.Razor" Version="3.0.0-preview5.19212.3">
<Uri>https://github.com/aspnet/AspNetCore-Tooling</Uri>
<Sha>9aa97d76f4a811b4caa9c94c2659a14c888370c3</Sha>
<Sha>81ea07caf7e5063b5f593d2d6a14d997643152e5</Sha>
</Dependency>
<Dependency Name="dotnet-ef" Version="3.0.0-preview4.19213.5">
<Dependency Name="dotnet-ef" Version="3.0.0-preview5.19212.1">
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
<Sha>e50f63918e73f906979190cd5974abc930192471</Sha>
<Sha>56e1b6d94969715ab7c6591a6c0e1a361c84e6b8</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="3.0.0-preview4.19213.5">
<Dependency Name="Microsoft.EntityFrameworkCore.InMemory" Version="3.0.0-preview5.19212.1">
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
<Sha>e50f63918e73f906979190cd5974abc930192471</Sha>
<Sha>56e1b6d94969715ab7c6591a6c0e1a361c84e6b8</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="3.0.0-preview4.19213.5">
<Dependency Name="Microsoft.EntityFrameworkCore.Relational" Version="3.0.0-preview5.19212.1">
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
<Sha>e50f63918e73f906979190cd5974abc930192471</Sha>
<Sha>56e1b6d94969715ab7c6591a6c0e1a361c84e6b8</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0-preview4.19213.5">
<Dependency Name="Microsoft.EntityFrameworkCore.Sqlite" Version="3.0.0-preview5.19212.1">
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
<Sha>e50f63918e73f906979190cd5974abc930192471</Sha>
<Sha>56e1b6d94969715ab7c6591a6c0e1a361c84e6b8</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-preview4.19213.5">
<Dependency Name="Microsoft.EntityFrameworkCore.SqlServer" Version="3.0.0-preview5.19212.1">
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
<Sha>e50f63918e73f906979190cd5974abc930192471</Sha>
<Sha>56e1b6d94969715ab7c6591a6c0e1a361c84e6b8</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0-preview4.19213.5">
<Dependency Name="Microsoft.EntityFrameworkCore.Tools" Version="3.0.0-preview5.19212.1">
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
<Sha>e50f63918e73f906979190cd5974abc930192471</Sha>
<Sha>56e1b6d94969715ab7c6591a6c0e1a361c84e6b8</Sha>
</Dependency>
<Dependency Name="Microsoft.EntityFrameworkCore" Version="3.0.0-preview4.19213.5">
<Dependency Name="Microsoft.EntityFrameworkCore" Version="3.0.0-preview5.19212.1">
<Uri>https://github.com/aspnet/EntityFrameworkCore</Uri>
<Sha>e50f63918e73f906979190cd5974abc930192471</Sha>
<Sha>56e1b6d94969715ab7c6591a6c0e1a361c84e6b8</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.Analyzer.Testing" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.AspNetCore.Analyzer.Testing" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.BenchmarkRunner.Sources" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.AspNetCore.BenchmarkRunner.Sources" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.ActivatorUtilities.Sources" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.ActivatorUtilities.Sources" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Caching.Abstractions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Caching.Memory" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Caching.Memory" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Caching.SqlServer" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Caching.SqlServer" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Caching.StackExchangeRedis" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.CommandLineUtils.Sources" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.CommandLineUtils.Sources" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.Abstractions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.AzureKeyVault" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.Binder" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.Binder" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.CommandLine" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.CommandLine" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.FileExtensions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.FileExtensions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.Ini" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.Ini" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.Json" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.Json" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.KeyPerFile" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.KeyPerFile" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.UserSecrets" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.UserSecrets" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration.Xml" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration.Xml" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Configuration" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Configuration" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.DependencyInjection.Abstractions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.DependencyInjection" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.DependencyInjection" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.DiagnosticAdapter" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.DiagnosticAdapter" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Diagnostics.HealthChecks.Abstractions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Diagnostics.HealthChecks" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Diagnostics.HealthChecks" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.FileProviders.Abstractions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.FileProviders.Abstractions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.FileProviders.Composite" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.FileProviders.Composite" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.FileProviders.Embedded" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.FileProviders.Embedded" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.FileProviders.Physical" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.FileProviders.Physical" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.FileSystemGlobbing" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.FileSystemGlobbing" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.HashCodeCombiner.Sources" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.HashCodeCombiner.Sources" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Hosting.Abstractions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Hosting.Abstractions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Hosting" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Hosting" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.HostFactoryResolver.Sources" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Http" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Http" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Localization.Abstractions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Localization.Abstractions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Localization" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Localization" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.Abstractions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Logging.Abstractions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.AzureAppServices" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Logging.AzureAppServices" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.Configuration" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Logging.Configuration" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.Console" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Logging.Console" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.Debug" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Logging.Debug" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.EventSource" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Logging.EventSource" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.TraceSource" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Logging.TraceSource" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging.Testing" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Logging.Testing" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Logging" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Logging" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.ObjectPool" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.ObjectPool" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Options.ConfigurationExtensions" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Options.DataAnnotations" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Options.DataAnnotations" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Options" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Options" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.ParameterDefaultValue.Sources" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.ParameterDefaultValue.Sources" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.Primitives" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.Primitives" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.TypeNameHelper.Sources" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.TypeNameHelper.Sources" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.ValueStopwatch.Sources" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.ValueStopwatch.Sources" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.WebEncoders" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Extensions.WebEncoders" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Internal.Extensions.Refs" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.Internal.Extensions.Refs" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.JSInterop" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.JSInterop" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Mono.WebAssembly.Interop" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Mono.WebAssembly.Interop" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.Bcl.Json.Sources" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="Microsoft.Bcl.Json.Sources" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="Microsoft.CSharp" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="Microsoft.CSharp" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.ComponentModel.Annotations" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.ComponentModel.Annotations" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Data.SqlClient" Version="4.7.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Data.SqlClient" Version="4.7.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.IO.Pipelines" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.IO.Pipelines" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Net.Http.WinHttpHandler" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Net.Http.WinHttpHandler" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Net.WebSockets.WebSocketProtocol" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Net.WebSockets.WebSocketProtocol" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Reflection.Metadata" Version="1.7.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Reflection.Metadata" Version="1.7.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Runtime.CompilerServices.Unsafe" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Runtime.CompilerServices.Unsafe" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Security.Cryptography.Cng" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Security.Cryptography.Cng" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Security.Cryptography.Pkcs" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Security.Cryptography.Pkcs" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Security.Permissions" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Security.Permissions" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Security.Principal.Windows" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Security.Principal.Windows" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.ServiceProcess.ServiceController" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.ServiceProcess.ServiceController" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Text.Encodings.Web" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Text.Encodings.Web" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="System.Threading.Channels" Version="4.6.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Threading.Channels" Version="4.6.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="Microsoft.Extensions.DependencyModel" Version="3.0.0-preview4-27613-07" CoherentParentDependency="Microsoft.Extensions.Logging">
<Dependency Name="Microsoft.Extensions.DependencyModel" Version="3.0.0-preview5-27608-16" CoherentParentDependency="Microsoft.Extensions.Logging">
<Uri>https://github.com/dotnet/core-setup</Uri>
<Sha>5c329c85ae31cc90220e84cfab8c1f1d0787b0d3</Sha>
<Sha>59c193bd93deafba5926cb827872b80338aca7c0</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App" Version="3.0.0-preview4-27613-07" CoherentParentDependency="Microsoft.Extensions.Logging">
<Dependency Name="Microsoft.NETCore.App" Version="3.0.0-preview5-27608-16" CoherentParentDependency="Microsoft.Extensions.Logging">
<Uri>https://github.com/dotnet/core-setup</Uri>
<Sha>5c329c85ae31cc90220e84cfab8c1f1d0787b0d3</Sha>
<Sha>59c193bd93deafba5926cb827872b80338aca7c0</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<!-- Listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
<Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-preview4.19212.13" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-preview5.19208.5" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>dc522ef97fac72e64cd74825b7ef497f82af4624</Sha>
<Sha>6ca16758a5d454c1f1b04975bf55f259dd71fc49</Sha>
</Dependency>
<Dependency Name="Internal.AspNetCore.Analyzers" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Internal.AspNetCore.Analyzers" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenAPI" Version="1.0.0-beta.19207.1">
<Dependency Name="Microsoft.DotNet.GenAPI" Version="1.0.0-beta.19212.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>b1f9e12fe3ee71c48ea60b15968745850ac0a4a7</Sha>
<Sha>9d0fd805448082c8d55e2434607b481bca70a146</Sha>
</Dependency>
<Dependency Name="Microsoft.AspNetCore.Testing" Version="3.0.0-preview4.19213.3" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Dependency Name="Microsoft.AspNetCore.Testing" Version="3.0.0-preview5.19210.2" CoherentParentDependency="Microsoft.EntityFrameworkCore">
<Uri>https://github.com/aspnet/Extensions</Uri>
<Sha>489b0512c337c7c46421b48793303160a4416276</Sha>
<Sha>17cb5265d011311233c2795727532d5c8eb22b5f</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>

View File

@ -17,106 +17,106 @@
-->
<PropertyGroup Label="Automated">
<!-- Packages from dotnet/arcade -->
<MicrosoftDotNetGenAPIPackageVersion>1.0.0-beta.19207.1</MicrosoftDotNetGenAPIPackageVersion>
<MicrosoftDotNetGenAPIPackageVersion>1.0.0-beta.19212.2</MicrosoftDotNetGenAPIPackageVersion>
<!-- Packages from dotnet/core-setup -->
<MicrosoftExtensionsDependencyModelPackageVersion>3.0.0-preview4-27613-07</MicrosoftExtensionsDependencyModelPackageVersion>
<MicrosoftNETCoreAppPackageVersion>3.0.0-preview4-27613-07</MicrosoftNETCoreAppPackageVersion>
<MicrosoftExtensionsDependencyModelPackageVersion>3.0.0-preview5-27608-16</MicrosoftExtensionsDependencyModelPackageVersion>
<MicrosoftNETCoreAppPackageVersion>3.0.0-preview5-27608-16</MicrosoftNETCoreAppPackageVersion>
<!-- Packages from dotnet/corefx -->
<MicrosoftBclJsonSourcesPackageVersion>4.6.0-preview4.19212.13</MicrosoftBclJsonSourcesPackageVersion>
<MicrosoftCSharpPackageVersion>4.6.0-preview4.19212.13</MicrosoftCSharpPackageVersion>
<MicrosoftWin32RegistryPackageVersion>4.6.0-preview4.19212.13</MicrosoftWin32RegistryPackageVersion>
<SystemComponentModelAnnotationsPackageVersion>4.6.0-preview4.19212.13</SystemComponentModelAnnotationsPackageVersion>
<SystemDataSqlClientPackageVersion>4.7.0-preview4.19212.13</SystemDataSqlClientPackageVersion>
<SystemDiagnosticsEventLogPackageVersion>4.6.0-preview4.19212.13</SystemDiagnosticsEventLogPackageVersion>
<SystemIOPipelinesPackageVersion>4.6.0-preview4.19212.13</SystemIOPipelinesPackageVersion>
<SystemNetHttpWinHttpHandlerPackageVersion>4.6.0-preview4.19212.13</SystemNetHttpWinHttpHandlerPackageVersion>
<SystemNetWebSocketsWebSocketProtocolPackageVersion>4.6.0-preview4.19212.13</SystemNetWebSocketsWebSocketProtocolPackageVersion>
<SystemReflectionMetadataPackageVersion>1.7.0-preview4.19212.13</SystemReflectionMetadataPackageVersion>
<SystemRuntimeCompilerServicesUnsafePackageVersion>4.6.0-preview4.19212.13</SystemRuntimeCompilerServicesUnsafePackageVersion>
<SystemSecurityCryptographyCngPackageVersion>4.6.0-preview4.19212.13</SystemSecurityCryptographyCngPackageVersion>
<SystemSecurityCryptographyPkcsPackageVersion>4.6.0-preview4.19212.13</SystemSecurityCryptographyPkcsPackageVersion>
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-preview4.19212.13</SystemSecurityCryptographyXmlPackageVersion>
<SystemSecurityPermissionsPackageVersion>4.6.0-preview4.19212.13</SystemSecurityPermissionsPackageVersion>
<SystemSecurityPrincipalWindowsPackageVersion>4.6.0-preview4.19212.13</SystemSecurityPrincipalWindowsPackageVersion>
<SystemServiceProcessServiceControllerPackageVersion>4.6.0-preview4.19212.13</SystemServiceProcessServiceControllerPackageVersion>
<SystemTextEncodingsWebPackageVersion>4.6.0-preview4.19212.13</SystemTextEncodingsWebPackageVersion>
<SystemThreadingChannelsPackageVersion>4.6.0-preview4.19212.13</SystemThreadingChannelsPackageVersion>
<MicrosoftBclJsonSourcesPackageVersion>4.6.0-preview5.19208.5</MicrosoftBclJsonSourcesPackageVersion>
<MicrosoftCSharpPackageVersion>4.6.0-preview5.19208.5</MicrosoftCSharpPackageVersion>
<MicrosoftWin32RegistryPackageVersion>4.6.0-preview5.19208.5</MicrosoftWin32RegistryPackageVersion>
<SystemComponentModelAnnotationsPackageVersion>4.6.0-preview5.19208.5</SystemComponentModelAnnotationsPackageVersion>
<SystemDataSqlClientPackageVersion>4.7.0-preview5.19208.5</SystemDataSqlClientPackageVersion>
<SystemDiagnosticsEventLogPackageVersion>4.6.0-preview5.19208.5</SystemDiagnosticsEventLogPackageVersion>
<SystemIOPipelinesPackageVersion>4.6.0-preview5.19208.5</SystemIOPipelinesPackageVersion>
<SystemNetHttpWinHttpHandlerPackageVersion>4.6.0-preview5.19208.5</SystemNetHttpWinHttpHandlerPackageVersion>
<SystemNetWebSocketsWebSocketProtocolPackageVersion>4.6.0-preview5.19208.5</SystemNetWebSocketsWebSocketProtocolPackageVersion>
<SystemReflectionMetadataPackageVersion>1.7.0-preview5.19208.5</SystemReflectionMetadataPackageVersion>
<SystemRuntimeCompilerServicesUnsafePackageVersion>4.6.0-preview5.19208.5</SystemRuntimeCompilerServicesUnsafePackageVersion>
<SystemSecurityCryptographyCngPackageVersion>4.6.0-preview5.19208.5</SystemSecurityCryptographyCngPackageVersion>
<SystemSecurityCryptographyPkcsPackageVersion>4.6.0-preview5.19208.5</SystemSecurityCryptographyPkcsPackageVersion>
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-preview5.19208.5</SystemSecurityCryptographyXmlPackageVersion>
<SystemSecurityPermissionsPackageVersion>4.6.0-preview5.19208.5</SystemSecurityPermissionsPackageVersion>
<SystemSecurityPrincipalWindowsPackageVersion>4.6.0-preview5.19208.5</SystemSecurityPrincipalWindowsPackageVersion>
<SystemServiceProcessServiceControllerPackageVersion>4.6.0-preview5.19208.5</SystemServiceProcessServiceControllerPackageVersion>
<SystemTextEncodingsWebPackageVersion>4.6.0-preview5.19208.5</SystemTextEncodingsWebPackageVersion>
<SystemThreadingChannelsPackageVersion>4.6.0-preview5.19208.5</SystemThreadingChannelsPackageVersion>
<!-- Only listed explicitly to workaround https://github.com/dotnet/cli/issues/10528 -->
<MicrosoftNETCorePlatformsPackageVersion>3.0.0-preview4.19212.13</MicrosoftNETCorePlatformsPackageVersion>
<MicrosoftNETCorePlatformsPackageVersion>3.0.0-preview5.19208.5</MicrosoftNETCorePlatformsPackageVersion>
<!-- Packages from aspnet/Extensions -->
<InternalAspNetCoreAnalyzersPackageVersion>3.0.0-preview4.19213.3</InternalAspNetCoreAnalyzersPackageVersion>
<MicrosoftAspNetCoreAnalyzerTestingPackageVersion>3.0.0-preview4.19213.3</MicrosoftAspNetCoreAnalyzerTestingPackageVersion>
<MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>3.0.0-preview4.19213.3</MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>
<MicrosoftAspNetCoreTestingPackageVersion>3.0.0-preview4.19213.3</MicrosoftAspNetCoreTestingPackageVersion>
<MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion>
<MicrosoftExtensionsCachingAbstractionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsCachingAbstractionsPackageVersion>
<MicrosoftExtensionsCachingMemoryPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsCachingMemoryPackageVersion>
<MicrosoftExtensionsCachingSqlServerPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsCachingSqlServerPackageVersion>
<MicrosoftExtensionsCachingStackExchangeRedisPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsCachingStackExchangeRedisPackageVersion>
<MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>
<MicrosoftExtensionsConfigurationAbstractionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationAbstractionsPackageVersion>
<MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>
<MicrosoftExtensionsConfigurationBinderPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationBinderPackageVersion>
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
<MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>
<MicrosoftExtensionsConfigurationIniPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationIniPackageVersion>
<MicrosoftExtensionsConfigurationJsonPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationJsonPackageVersion>
<MicrosoftExtensionsConfigurationKeyPerFilePackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationKeyPerFilePackageVersion>
<MicrosoftExtensionsConfigurationPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationPackageVersion>
<MicrosoftExtensionsConfigurationUserSecretsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationUserSecretsPackageVersion>
<MicrosoftExtensionsConfigurationXmlPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsConfigurationXmlPackageVersion>
<MicrosoftExtensionsDependencyInjectionAbstractionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsDependencyInjectionAbstractionsPackageVersion>
<MicrosoftExtensionsDependencyInjectionPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsDependencyInjectionPackageVersion>
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
<MicrosoftExtensionsDiagnosticsHealthChecksAbstractionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsDiagnosticsHealthChecksAbstractionsPackageVersion>
<MicrosoftExtensionsDiagnosticsHealthChecksPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsDiagnosticsHealthChecksPackageVersion>
<MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>
<MicrosoftExtensionsFileProvidersCompositePackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsFileProvidersCompositePackageVersion>
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
<MicrosoftExtensionsFileProvidersPhysicalPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsFileProvidersPhysicalPackageVersion>
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
<MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>
<MicrosoftExtensionsHostingAbstractionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsHostingAbstractionsPackageVersion>
<MicrosoftExtensionsHostingPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsHostingPackageVersion>
<MicrosoftExtensionsHostFactoryResolverSourcesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsHostFactoryResolverSourcesPackageVersion>
<MicrosoftExtensionsHttpPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsHttpPackageVersion>
<MicrosoftExtensionsLocalizationAbstractionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLocalizationAbstractionsPackageVersion>
<MicrosoftExtensionsLocalizationPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLocalizationPackageVersion>
<MicrosoftExtensionsLoggingAbstractionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLoggingAbstractionsPackageVersion>
<MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>
<MicrosoftExtensionsLoggingConfigurationPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLoggingConfigurationPackageVersion>
<MicrosoftExtensionsLoggingConsolePackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLoggingConsolePackageVersion>
<MicrosoftExtensionsLoggingDebugPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLoggingDebugPackageVersion>
<MicrosoftExtensionsLoggingEventSourcePackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLoggingEventSourcePackageVersion>
<MicrosoftExtensionsLoggingPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLoggingPackageVersion>
<MicrosoftExtensionsLoggingTestingPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLoggingTestingPackageVersion>
<MicrosoftExtensionsLoggingTraceSourcePackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsLoggingTraceSourcePackageVersion>
<MicrosoftExtensionsObjectPoolPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsObjectPoolPackageVersion>
<MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
<MicrosoftExtensionsOptionsDataAnnotationsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsOptionsDataAnnotationsPackageVersion>
<MicrosoftExtensionsOptionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsOptionsPackageVersion>
<MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>
<MicrosoftExtensionsPrimitivesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsPrimitivesPackageVersion>
<MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>
<MicrosoftExtensionsValueStopwatchSourcesPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsValueStopwatchSourcesPackageVersion>
<MicrosoftExtensionsWebEncodersPackageVersion>3.0.0-preview4.19213.3</MicrosoftExtensionsWebEncodersPackageVersion>
<MicrosoftInternalExtensionsRefsPackageVersion>3.0.0-preview4.19213.3</MicrosoftInternalExtensionsRefsPackageVersion>
<MicrosoftJSInteropPackageVersion>3.0.0-preview4.19213.3</MicrosoftJSInteropPackageVersion>
<MonoWebAssemblyInteropPackageVersion>3.0.0-preview4.19213.3</MonoWebAssemblyInteropPackageVersion>
<InternalAspNetCoreAnalyzersPackageVersion>3.0.0-preview5.19210.2</InternalAspNetCoreAnalyzersPackageVersion>
<MicrosoftAspNetCoreAnalyzerTestingPackageVersion>3.0.0-preview5.19210.2</MicrosoftAspNetCoreAnalyzerTestingPackageVersion>
<MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>3.0.0-preview5.19210.2</MicrosoftAspNetCoreBenchmarkRunnerSourcesPackageVersion>
<MicrosoftAspNetCoreTestingPackageVersion>3.0.0-preview5.19210.2</MicrosoftAspNetCoreTestingPackageVersion>
<MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsActivatorUtilitiesSourcesPackageVersion>
<MicrosoftExtensionsCachingAbstractionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsCachingAbstractionsPackageVersion>
<MicrosoftExtensionsCachingMemoryPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsCachingMemoryPackageVersion>
<MicrosoftExtensionsCachingSqlServerPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsCachingSqlServerPackageVersion>
<MicrosoftExtensionsCachingStackExchangeRedisPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsCachingStackExchangeRedisPackageVersion>
<MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsCommandLineUtilsSourcesPackageVersion>
<MicrosoftExtensionsConfigurationAbstractionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationAbstractionsPackageVersion>
<MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationAzureKeyVaultPackageVersion>
<MicrosoftExtensionsConfigurationBinderPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationBinderPackageVersion>
<MicrosoftExtensionsConfigurationCommandLinePackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationCommandLinePackageVersion>
<MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationEnvironmentVariablesPackageVersion>
<MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationFileExtensionsPackageVersion>
<MicrosoftExtensionsConfigurationIniPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationIniPackageVersion>
<MicrosoftExtensionsConfigurationJsonPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationJsonPackageVersion>
<MicrosoftExtensionsConfigurationKeyPerFilePackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationKeyPerFilePackageVersion>
<MicrosoftExtensionsConfigurationPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationPackageVersion>
<MicrosoftExtensionsConfigurationUserSecretsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationUserSecretsPackageVersion>
<MicrosoftExtensionsConfigurationXmlPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsConfigurationXmlPackageVersion>
<MicrosoftExtensionsDependencyInjectionAbstractionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsDependencyInjectionAbstractionsPackageVersion>
<MicrosoftExtensionsDependencyInjectionPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsDependencyInjectionPackageVersion>
<MicrosoftExtensionsDiagnosticAdapterPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsDiagnosticAdapterPackageVersion>
<MicrosoftExtensionsDiagnosticsHealthChecksAbstractionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsDiagnosticsHealthChecksAbstractionsPackageVersion>
<MicrosoftExtensionsDiagnosticsHealthChecksPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsDiagnosticsHealthChecksPackageVersion>
<MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsFileProvidersAbstractionsPackageVersion>
<MicrosoftExtensionsFileProvidersCompositePackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsFileProvidersCompositePackageVersion>
<MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsFileProvidersEmbeddedPackageVersion>
<MicrosoftExtensionsFileProvidersPhysicalPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsFileProvidersPhysicalPackageVersion>
<MicrosoftExtensionsFileSystemGlobbingPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsFileSystemGlobbingPackageVersion>
<MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsHashCodeCombinerSourcesPackageVersion>
<MicrosoftExtensionsHostingAbstractionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsHostingAbstractionsPackageVersion>
<MicrosoftExtensionsHostingPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsHostingPackageVersion>
<MicrosoftExtensionsHostFactoryResolverSourcesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsHostFactoryResolverSourcesPackageVersion>
<MicrosoftExtensionsHttpPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsHttpPackageVersion>
<MicrosoftExtensionsLocalizationAbstractionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLocalizationAbstractionsPackageVersion>
<MicrosoftExtensionsLocalizationPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLocalizationPackageVersion>
<MicrosoftExtensionsLoggingAbstractionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLoggingAbstractionsPackageVersion>
<MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLoggingAzureAppServicesPackageVersion>
<MicrosoftExtensionsLoggingConfigurationPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLoggingConfigurationPackageVersion>
<MicrosoftExtensionsLoggingConsolePackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLoggingConsolePackageVersion>
<MicrosoftExtensionsLoggingDebugPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLoggingDebugPackageVersion>
<MicrosoftExtensionsLoggingEventSourcePackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLoggingEventSourcePackageVersion>
<MicrosoftExtensionsLoggingPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLoggingPackageVersion>
<MicrosoftExtensionsLoggingTestingPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLoggingTestingPackageVersion>
<MicrosoftExtensionsLoggingTraceSourcePackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsLoggingTraceSourcePackageVersion>
<MicrosoftExtensionsObjectPoolPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsObjectPoolPackageVersion>
<MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsOptionsConfigurationExtensionsPackageVersion>
<MicrosoftExtensionsOptionsDataAnnotationsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsOptionsDataAnnotationsPackageVersion>
<MicrosoftExtensionsOptionsPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsOptionsPackageVersion>
<MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsParameterDefaultValueSourcesPackageVersion>
<MicrosoftExtensionsPrimitivesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsPrimitivesPackageVersion>
<MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsTypeNameHelperSourcesPackageVersion>
<MicrosoftExtensionsValueStopwatchSourcesPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsValueStopwatchSourcesPackageVersion>
<MicrosoftExtensionsWebEncodersPackageVersion>3.0.0-preview5.19210.2</MicrosoftExtensionsWebEncodersPackageVersion>
<MicrosoftInternalExtensionsRefsPackageVersion>3.0.0-preview5.19210.2</MicrosoftInternalExtensionsRefsPackageVersion>
<MicrosoftJSInteropPackageVersion>3.0.0-preview5.19210.2</MicrosoftJSInteropPackageVersion>
<MonoWebAssemblyInteropPackageVersion>3.0.0-preview5.19210.2</MonoWebAssemblyInteropPackageVersion>
<!-- Packages from aspnet/EntityFrameworkCore -->
<dotnetefPackageVersion>3.0.0-preview4.19213.5</dotnetefPackageVersion>
<MicrosoftEntityFrameworkCoreInMemoryPackageVersion>3.0.0-preview4.19213.5</MicrosoftEntityFrameworkCoreInMemoryPackageVersion>
<MicrosoftEntityFrameworkCoreRelationalPackageVersion>3.0.0-preview4.19213.5</MicrosoftEntityFrameworkCoreRelationalPackageVersion>
<MicrosoftEntityFrameworkCoreSqlitePackageVersion>3.0.0-preview4.19213.5</MicrosoftEntityFrameworkCoreSqlitePackageVersion>
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>3.0.0-preview4.19213.5</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
<MicrosoftEntityFrameworkCoreToolsPackageVersion>3.0.0-preview4.19213.5</MicrosoftEntityFrameworkCoreToolsPackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>3.0.0-preview4.19213.5</MicrosoftEntityFrameworkCorePackageVersion>
<dotnetefPackageVersion>3.0.0-preview5.19212.1</dotnetefPackageVersion>
<MicrosoftEntityFrameworkCoreInMemoryPackageVersion>3.0.0-preview5.19212.1</MicrosoftEntityFrameworkCoreInMemoryPackageVersion>
<MicrosoftEntityFrameworkCoreRelationalPackageVersion>3.0.0-preview5.19212.1</MicrosoftEntityFrameworkCoreRelationalPackageVersion>
<MicrosoftEntityFrameworkCoreSqlitePackageVersion>3.0.0-preview5.19212.1</MicrosoftEntityFrameworkCoreSqlitePackageVersion>
<MicrosoftEntityFrameworkCoreSqlServerPackageVersion>3.0.0-preview5.19212.1</MicrosoftEntityFrameworkCoreSqlServerPackageVersion>
<MicrosoftEntityFrameworkCoreToolsPackageVersion>3.0.0-preview5.19212.1</MicrosoftEntityFrameworkCoreToolsPackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>3.0.0-preview5.19212.1</MicrosoftEntityFrameworkCorePackageVersion>
<!-- Packages from aspnet/AspNetCore-Tooling -->
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>3.0.0-preview4.19213.3</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
<MicrosoftAspNetCoreRazorLanguagePackageVersion>3.0.0-preview4.19213.3</MicrosoftAspNetCoreRazorLanguagePackageVersion>
<MicrosoftCodeAnalysisRazorPackageVersion>3.0.0-preview4.19213.3</MicrosoftCodeAnalysisRazorPackageVersion>
<MicrosoftNETSdkRazorPackageVersion>3.0.0-preview4.19213.3</MicrosoftNETSdkRazorPackageVersion>
<MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>3.0.0-preview5.19212.3</MicrosoftAspNetCoreMvcRazorExtensionsPackageVersion>
<MicrosoftAspNetCoreRazorLanguagePackageVersion>3.0.0-preview5.19212.3</MicrosoftAspNetCoreRazorLanguagePackageVersion>
<MicrosoftCodeAnalysisRazorPackageVersion>3.0.0-preview5.19212.3</MicrosoftCodeAnalysisRazorPackageVersion>
<MicrosoftNETSdkRazorPackageVersion>3.0.0-preview5.19212.3</MicrosoftNETSdkRazorPackageVersion>
</PropertyGroup>
<!--

View File

@ -1,6 +1,6 @@
{
"sdk": {
"version": "3.0.100-preview4-010309"
"version": "3.0.100-preview4-011136"
},
"msbuild-sdks": {
"Yarn.MSBuild": "1.13.0"

View File

@ -1,2 +1,2 @@
version:3.0.0-build-20190322.1
commithash:c38761a564c72b5bc96356ec99c89de5f281a358
version:3.0.0-build-20190408.1
commithash:8b533cbfa5357e5785f4c4231231c1234cfc2c5f

View File

@ -10,6 +10,7 @@
<Reference Include="Microsoft.AspNetCore.Mvc.Components.Prerendering" />
<Reference Include="Microsoft.AspNetCore.Components.Server" />
<Reference Include="Microsoft.AspNetCore.Mvc" />
<Reference Include="Newtonsoft.Json" />
<ProjectReference Include="..\ComponentsApp.App\ComponentsApp.App.csproj" />
</ItemGroup>

View File

@ -268,7 +268,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal
// _builder.ConfigureContainer<T>(ConfigureContainer);
typeof(IHostBuilder).GetMethods().First(m => m.Name == nameof(IHostBuilder.ConfigureContainer))
.MakeGenericMethod(containerType)
.Invoke(_builder, new object[] { configureCallback });
.InvokeWithoutWrappingExceptions(_builder, new object[] { configureCallback });
}
// Resolve Configure after calling ConfigureServices and ConfigureContainer

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Globalization;
using System.Reflection;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
@ -52,8 +53,9 @@ namespace Microsoft.AspNetCore.Hosting.Internal
}
}
}
MethodInfo.Invoke(instance, parameters);
MethodInfo.InvokeWithoutWrappingExceptions(instance, parameters);
}
}
}
}
}

View File

@ -1,4 +1,4 @@
// Copyright (c) .NET Foundation. All rights reserved.
// 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;
@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal
var arguments = new object[1] { container };
MethodInfo.Invoke(instance, arguments);
MethodInfo.InvokeWithoutWrappingExceptions(instance, arguments);
}
}
}
}

View File

@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Hosting.Internal
arguments[0] = services;
}
return MethodInfo.Invoke(instance, arguments) as IServiceProvider;
return MethodInfo.InvokeWithoutWrappingExceptions(instance, arguments) as IServiceProvider;
}
}
}
}

View File

@ -0,0 +1,20 @@
// 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.Reflection;
namespace Microsoft.AspNetCore.Hosting.Internal
{
internal static class MethodInfoExtensions
{
// This version of MethodInfo.Invoke removes TargetInvocationExceptions
public static object InvokeWithoutWrappingExceptions(this MethodInfo methodInfo, object obj, object[] parameters)
{
// These are the default arguments passed when methodInfo.Invoke(obj, parameters) are called. We do the same
// here but specify BindingFlags.DoNotWrapExceptions to avoid getting TAE (TargetInvocationException)
// methodInfo.Invoke(obj, BindingFlags.Default, binder: null, parameters: parameters, culture: null)
return methodInfo.Invoke(obj, BindingFlags.DoNotWrapExceptions, binder: null, parameters: parameters, culture: null);
}
}
}

View File

@ -175,6 +175,10 @@ namespace Microsoft.AspNetCore.Hosting
{
host.Initialize();
// resolve configuration explicitly once to mark it as resolved within the
// service provider, ensuring it will be properly disposed with the provider
_ = host.Services.GetService<IConfiguration>();
var logger = host.Services.GetRequiredService<ILogger<WebHost>>();
// Warn about duplicate HostingStartupAssemblies
@ -264,12 +268,13 @@ namespace Microsoft.AspNetCore.Hosting
var builder = new ConfigurationBuilder()
.SetBasePath(_hostingEnvironment.ContentRootPath)
.AddConfiguration(_config);
.AddConfiguration(_config, shouldDisposeConfiguration: true);
_configureAppConfigurationBuilder?.Invoke(_context, builder);
var configuration = builder.Build();
services.AddSingleton<IConfiguration>(configuration);
// register configuration as factory to make it dispose with the service provider
services.AddSingleton<IConfiguration>(_ => configuration);
_context.Configuration = configuration;
var listener = new DiagnosticListener("Microsoft.AspNetCore");

View File

@ -500,8 +500,36 @@ namespace Microsoft.AspNetCore.Hosting.Tests
var app = new ApplicationBuilder(services);
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
var ex = Assert.Throws<TargetInvocationException>(() => startup.ConfigureDelegate(app));
Assert.IsAssignableFrom<InvalidOperationException>(ex.InnerException);
Assert.Throws<InvalidOperationException>(() => startup.ConfigureDelegate(app));
}
[Fact]
public void ConfigureServicesThrowingDoesNotThrowTargetInvocationException()
{
var serviceCollection = new ServiceCollection();
serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>();
var services = serviceCollection.BuildServiceProvider();
var startup = StartupLoader.LoadMethods(services, typeof(StartupConfigureServicesThrows), environmentName: null);
var app = new ApplicationBuilder(services);
Assert.Throws<Exception>(() => startup.ConfigureServicesDelegate(serviceCollection));
}
[Fact]
public void ConfigureThrowingDoesNotThrowTargetInvocationException()
{
var serviceCollection = new ServiceCollection();
serviceCollection.AddSingleton<IServiceProviderFactory<IServiceCollection>, DefaultServiceProviderFactory>();
var services = serviceCollection.BuildServiceProvider();
var startup = StartupLoader.LoadMethods(services, typeof(StartupConfigureThrows), environmentName: null);
var app = new ApplicationBuilder(services);
app.ApplicationServices = startup.ConfigureServicesDelegate(serviceCollection);
Assert.Throws<Exception>(() => startup.ConfigureDelegate(app));
}
[Fact]

View File

@ -975,6 +975,54 @@ namespace Microsoft.AspNetCore.Hosting
Assert.Contains("ConfigureServices", ex.Message);
}
[Fact]
public void Dispose_DisposesAppConfiguration()
{
var providerMock = new Mock<ConfigurationProvider>().As<IDisposable>();
providerMock.Setup(d => d.Dispose());
var sourceMock = new Mock<IConfigurationSource>();
sourceMock.Setup(s => s.Build(It.IsAny<IConfigurationBuilder>()))
.Returns((ConfigurationProvider)providerMock.Object);
var host = CreateBuilder()
.ConfigureAppConfiguration(configuration =>
{
configuration.Add(sourceMock.Object);
})
.Build();
providerMock.Verify(c => c.Dispose(), Times.Never);
host.Dispose();
providerMock.Verify(c => c.Dispose(), Times.AtLeastOnce());
}
[Fact]
public async Task DisposeAsync_DisposesAppConfiguration()
{
var providerMock = new Mock<ConfigurationProvider>().As<IDisposable>();
providerMock.Setup(d => d.Dispose());
var sourceMock = new Mock<IConfigurationSource>();
sourceMock.Setup(s => s.Build(It.IsAny<IConfigurationBuilder>()))
.Returns((ConfigurationProvider)providerMock.Object);
var host = CreateBuilder()
.ConfigureAppConfiguration(configuration =>
{
configuration.Add(sourceMock.Object);
})
.Build();
providerMock.Verify(c => c.Dispose(), Times.Never);
await ((IAsyncDisposable)host).DisposeAsync();
providerMock.Verify(c => c.Dispose(), Times.AtLeastOnce());
}
public class BadConfigureServicesStartup
{
public void ConfigureServices(IServiceCollection services, int gunk) { }

View File

@ -19,11 +19,9 @@ namespace Microsoft.AspNetCore.Http.Internal
public static StringValues GetHeaderSplit(IHeaderDictionary headers, string key)
{
var values = GetHeaderUnmodified(headers, key);
return new StringValues(GetHeaderSplitImplementation(values).ToArray());
}
private static IEnumerable<string> GetHeaderSplitImplementation(StringValues values)
{
StringValues result = default;
foreach (var segment in new HeaderSegmentCollection(values))
{
if (!StringSegment.IsNullOrEmpty(segment.Data))
@ -31,10 +29,12 @@ namespace Microsoft.AspNetCore.Http.Internal
var value = DeQuote(segment.Data.Value);
if (!string.IsNullOrEmpty(value))
{
yield return value;
result = StringValues.Concat(in result, value);
}
}
}
return result;
}
public static StringValues GetHeaderUnmodified(IHeaderDictionary headers, string key)

View File

@ -0,0 +1 @@
[assembly: BenchmarkDotNet.Attributes.AspNetCoreBenchmark]

View File

@ -0,0 +1,63 @@
// 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 BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Configs;
using Microsoft.AspNetCore.Http.Internal;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Primitives;
namespace Microsoft.AspNetCore.Http.Abstractions.Microbenchmarks
{
public class GetHeaderSplitBenchmark
{
HeaderDictionary _dictionary;
[GlobalSetup]
public void GlobalSetup()
{
var dict = new Dictionary<string, StringValues>()
{
{ "singleValue", new StringValues("single") },
{ "singleValueQuoted", new StringValues("\"single\"") },
{ "doubleValue", new StringValues(new [] { "first", "second" }) },
{ "manyValue", new StringValues(new [] { "first", "second", "third", "fourth", "fifth", "sixth" }) }
};
_dictionary = new HeaderDictionary(dict);
}
[Benchmark]
public void SplitSingleHeader()
{
var values = ParsingHelpers.GetHeaderSplit(_dictionary, "singleValue");
if (values.Count != 1)
throw new Exception();
}
[Benchmark]
public void SplitSingleQuotedHeader()
{
var values = ParsingHelpers.GetHeaderSplit(_dictionary, "singleValueQuoted");
if (values.Count != 1)
throw new Exception();
}
[Benchmark]
public void SplitDoubleHeader()
{
var values = ParsingHelpers.GetHeaderSplit(_dictionary, "doubleValue");
if (values.Count != 2)
throw new Exception();
}
[Benchmark]
public void SplitManyHeaders()
{
var values = ParsingHelpers.GetHeaderSplit(_dictionary, "manyValue");
if (values.Count != 6)
throw new Exception();
}
}
}

View File

@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<Reference Include="BenchmarkDotNet" />
<Reference Include="Microsoft.AspNetCore.BenchmarkRunner.Sources" />
<Reference Include="Microsoft.AspNetCore.Http.Abstractions" />
<Reference Include="Microsoft.AspNetCore.Http" />
</ItemGroup>
</Project>

View File

@ -11,6 +11,8 @@
<SuppressIces>ICE03</SuppressIces>
<DisableGuidGeneration>true</DisableGuidGeneration>
<SchemaVersion>2.0</SchemaVersion>
<TempPlatform Condition="'$(Platform)' == 'x64'">x64</TempPlatform>
<TempPlatform Condition="'$(Platform)' == 'x86'">Win32</TempPlatform>
</PropertyGroup>
<ItemGroup>
@ -51,6 +53,15 @@
</ProjectReference>
</ItemGroup>
<Target Name="CopyBuildOutputToArtifactDirectory"
Condition=" '$(IsProductInstaller)' == 'true' "
AfterTargets="Build">
<ItemGroup>
<BuildContentForAncm Include="$(RepositoryRoot)src\Servers\IIS\AspNetCoreModuleV2\AspNetCore\bin\$(Configuration)\$(TempPlatform)\*.*" />
</ItemGroup>
<Copy SourceFiles="@(BuildContentForAncm)" DestinationFolder="$(InstallersOutputPath)\IISExpressSymbols\$(TempPlatform)" />
</Target>
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), Directory.Build.targets))\Directory.Build.targets" />
<Import Project="..\build\settings.props" />
<Import Project="..\build\versions.props" />

View File

@ -366,66 +366,25 @@
Value="&quot;[IISEXPRESS_INSTALL_PATH]appcmd.exe&quot; set config -section:system.webServer/httpCompression /+&quot;dynamicTypes.[\[]mimeType='text/event-stream',enabled='FALSE'[\]]&quot; /apphostconfig:&quot;[IISEXPRESS_APPHOST_CONFIG_TMP]&quot;"/>
<CustomAction Id="CA_UPDATE_DYNAMIC_COMPRESSION_TMP" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>
<!-- CA to add config section to applicationhost.config -->
<CustomAction Id="CA_ADD_CONFIGSECTION_PROPERTY"
Property="CA_ADD_CONFIGSECTION"
Value="[IISEXPRESS_APPHOST_CONFIG];[IISEXPRESS_APPHOST_CONFIG_TMP]"/>
<CustomAction Id="CA_ADD_CONFIGSECTION" Script="jscript" Execute="deferred" Return="check" Impersonate="no">
<![CDATA[
var caData = Session.Property("CustomActionData");
configfiles = caData.split(';');
for (var i = 0; i < configfiles.length; i++) {
var configfile = configfiles[i];
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.preserveWhiteSpace = true;
xmlDoc.load(configfile );
if (xmlDoc.parseError.errorCode == 0) {
xmlDoc.setProperty("SelectionLanguage", "XPath");
var websvrNode = xmlDoc.selectSingleNode("//configuration/configSections/sectionGroup[@name=\"system.webServer\"]");
if (websvrNode != null) {
var ancmNode = xmlDoc.selectSingleNode("//configuration/configSections/sectionGroup[@name=\"system.webServer\"]/section[@name=\"$(var.AspNetCoreSectionName)\"]");
if (ancmNode == null) {
ancmNode = xmlDoc.createElement("section");
ancmNode.setAttribute("name", "$(var.AspNetCoreSectionName)");
ancmNode.setAttribute("overrideModeDefault", "Allow");
websvrNode.appendChild(ancmNode);
xmlDoc.save(configfile );
}
}
}
}
]]>
</CustomAction>
Value="[IISEXPRESS_APPHOST_CONFIG]"/>
<CustomAction BinaryKey="IISCustomActionDll" Id="CA_ADD_CONFIGSECTION" DllEntry="AddConfigSection" Execute="deferred" Return="check" Impersonate="no"/>
<CustomAction Id="CA_ADD_CONFIGSECTION_PROPERTY_TMP"
Property="CA_ADD_CONFIGSECTION_TMP"
Value="[IISEXPRESS_APPHOST_CONFIG_TMP]"/>
<CustomAction BinaryKey="IISCustomActionDll" Id="CA_ADD_CONFIGSECTION_TMP" DllEntry="AddConfigSection" Execute="deferred" Return="check" Impersonate="no"/>
<!-- CA to remove config section to applicationhost.config -->
<CustomAction Id="CA_REMOVE_CONFIGSECTION_PROPERTY"
Property="CA_REMOVE_CONFIGSECTION"
Value="[IISEXPRESS_APPHOST_CONFIG];[IISEXPRESS_APPHOST_CONFIG_TMP]"/>
<CustomAction Id="CA_REMOVE_CONFIGSECTION" Script="jscript" Execute="deferred" Return="check" Impersonate="no">
<![CDATA[
var caData = Session.Property("CustomActionData");
configfiles = caData.split(';');
for (var i = 0; i < configfiles.length; i++) {
var configfile = configfiles[i];
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.preserveWhiteSpace = true;
xmlDoc.load(configfile );
if (xmlDoc.parseError.errorCode == 0) {
xmlDoc.setProperty("SelectionLanguage", "XPath");
var websvrNode = xmlDoc.selectSingleNode("//configuration/configSections/sectionGroup[@name=\"system.webServer\"]");
if (websvrNode != null) {
var ancmNode = xmlDoc.selectSingleNode("//configuration/configSections/sectionGroup[@name=\"system.webServer\"]/section[@name=\"$(var.AspNetCoreSectionName)\"]");
if (ancmNode != null) {
websvrNode.removeChild(ancmNode);
xmlDoc.save(configfile );
}
}
}
}
]]>
</CustomAction>
Property="CA_REMOVE_CONFIGSECTION"
Value="[IISEXPRESS_APPHOST_CONFIG]"/>
<CustomAction Id="CA_REMOVE_CONFIGSECTION" BinaryKey="IISCustomActionDll" DllEntry="RemoveConfigSection" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="CA_REMOVE_CONFIGSECTION_PROPERTY_TMP"
Property="CA_REMOVE_CONFIGSECTION_TMP"
Value="[IISEXPRESS_APPHOST_CONFIG_TMP]"/>
<CustomAction Id="CA_REMOVE_CONFIGSECTION_TMP" BinaryKey="IISCustomActionDll" DllEntry="RemoveConfigSection" Execute="deferred" Return="check" Impersonate="no" />
<?if $(var.Platform) = "x64" ?>
<CustomAction Id="CA_UNLOCK_HANDLER32_PROPERTY"
@ -520,68 +479,25 @@
Value="&quot;[IISEXPRESS_INSTALL_PATH32]appcmd.exe&quot; set config -section:system.webServer/httpCompression /+&quot;dynamicTypes.[\[]mimeType='text/event-stream',enabled='FALSE'[\]]&quot; /apphostconfig:&quot;[IISEXPRESS_APPHOST_CONFIG32]&quot;"/>
<CustomAction Id="CA_UPDATE_DYNAMIC_COMPRESSION_TMP32" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no"/>
<!-- CA to add config section to applicationhost.config -->
<CustomAction Id="CA_ADD_CONFIGSECTION32_PROPERTY"
Property="CA_ADD_CONFIGSECTION32"
Value="[IISEXPRESS_APPHOST_CONFIG32];[IISEXPRESS_APPHOST_CONFIG_TMP32]"/>
<CustomAction Id="CA_ADD_CONFIGSECTION32" Script="jscript" Execute="deferred" Return="check" Impersonate="no">
<!-- Warning LGHT1076: ICE03: String overflow. Orca.exe inspection shows the custom action value is populated correctly -->
<![CDATA[
var caData = Session.Property("CustomActionData");
configfiles = caData.split(';');
for (var i = 0; i < configfiles.length; i++) {
var configfile = configfiles[i];
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.preserveWhiteSpace = true;
xmlDoc.load(configfile);
if (xmlDoc.parseError.errorCode == 0) {
xmlDoc.setProperty("SelectionLanguage", "XPath");
var websvrNode = xmlDoc.selectSingleNode("//configuration/configSections/sectionGroup[@name=\"system.webServer\"]");
if (websvrNode != null) {
var ancmNode = xmlDoc.selectSingleNode("//configuration/configSections/sectionGroup[@name=\"system.webServer\"]/section[@name=\"$(var.AspNetCoreSectionName)\"]");
if (ancmNode == null) {
ancmNode = xmlDoc.createElement("section");
ancmNode.setAttribute("name", "$(var.AspNetCoreSectionName)");
ancmNode.setAttribute("overrideModeDefault", "Allow");
websvrNode.appendChild(ancmNode);
xmlDoc.save(configfile);
}
}
}
}
]]>
</CustomAction>
Property="CA_ADD_CONFIGSECTION32"
Value="[IISEXPRESS_APPHOST_CONFIG32]"/>
<CustomAction BinaryKey="IISCustomActionDll" Id="CA_ADD_CONFIGSECTION32" DllEntry="AddConfigSection" Execute="deferred" Return="check" Impersonate="no"/>
<CustomAction Id="CA_ADD_CONFIGSECTION32_PROPERTY_TMP"
Property="CA_ADD_CONFIGSECTION32_TMP"
Value="[IISEXPRESS_APPHOST_CONFIG_TMP32]"/>
<CustomAction BinaryKey="IISCustomActionDll" Id="CA_ADD_CONFIGSECTION32_TMP" DllEntry="AddConfigSection" Execute="deferred" Return="check" Impersonate="no"/>
<!-- CA to remove config section to applicationhost.config -->
<CustomAction Id="CA_REMOVE_CONFIGSECTION32_PROPERTY"
Property="CA_REMOVE_CONFIGSECTION32"
Value="[IISEXPRESS_APPHOST_CONFIG32];[IISEXPRESS_APPHOST_CONFIG_TMP32]"/>
<CustomAction Id="CA_REMOVE_CONFIGSECTION32" Script="jscript" Execute="deferred" Return="check" Impersonate="no">
<![CDATA[
var caData = Session.Property("CustomActionData");
configfiles = caData.split(';');
for (var i = 0; i < configfiles.length; i++) {
var configfile = configfiles[i];
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.preserveWhiteSpace = true;
xmlDoc.load(configfile);
if (xmlDoc.parseError.errorCode == 0) {
xmlDoc.setProperty("SelectionLanguage", "XPath");
var websvrNode = xmlDoc.selectSingleNode("//configuration/configSections/sectionGroup[@name=\"system.webServer\"]");
if (websvrNode != null) {
var ancmNode = xmlDoc.selectSingleNode("//configuration/configSections/sectionGroup[@name=\"system.webServer\"]/section[@name=\"$(var.AspNetCoreSectionName)\"]");
if (ancmNode != null) {
websvrNode.removeChild(ancmNode);
xmlDoc.save(configfile);
}
}
}
}
]]>
</CustomAction>
Value="[IISEXPRESS_APPHOST_CONFIG32]"/>
<CustomAction Id="CA_REMOVE_CONFIGSECTION32" BinaryKey="IISCustomActionDll" DllEntry="RemoveConfigSection" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="CA_REMOVE_CONFIGSECTION32_PROPERTY_TMP"
Property="CA_REMOVE_CONFIGSECTION32_TMP"
Value="[IISEXPRESS_APPHOST_CONFIG_TMP32]"/>
<CustomAction Id="CA_REMOVE_CONFIGSECTION32_TMP" BinaryKey="IISCustomActionDll" DllEntry="RemoveConfigSection" Execute="deferred" Return="check" Impersonate="no" />
<?endif?>
<InstallExecuteSequence>
@ -600,7 +516,9 @@
<Custom Action="CA_SET_MODULE" After="CA_SET_MODULE_PROPERTY"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_CONFIGSECTION_PROPERTY" After="CA_SET_MODULE"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_CONFIGSECTION" After="CA_ADD_CONFIGSECTION_PROPERTY"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION_PROPERTY" After="CA_ADD_CONFIGSECTION"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_CONFIGSECTION_PROPERTY_TMP" After="CA_ADD_CONFIGSECTION"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_CONFIGSECTION_TMP" After="CA_ADD_CONFIGSECTION_PROPERTY_TMP"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION_PROPERTY" After="CA_ADD_CONFIGSECTION_TMP"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION" After="CA_ADD_TRACE_PROVIDER_DEFINITION_PROPERTY"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION_TMP_PROPERTY" After="CA_ADD_TRACE_PROVIDER_DEFINITION"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION_TMP" After="CA_ADD_TRACE_PROVIDER_DEFINITION_TMP_PROPERTY"><![CDATA[(NOT REMOVE)]]></Custom>
@ -610,6 +528,8 @@
<Custom Action="CA_REMOVE_MODULE" Before="RemoveFiles"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_CONFIGSECTION_PROPERTY" Before="CA_REMOVE_CONFIGSECTION"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_CONFIGSECTION" Before="RemoveFiles"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_CONFIGSECTION_PROPERTY_TMP" Before="CA_REMOVE_CONFIGSECTION_TMP"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_CONFIGSECTION_TMP" Before="RemoveFiles"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_TRACE_PROVIDER_DEFINITION_PROPERTY" Before="CA_REMOVE_TRACE_PROVIDER_DEFINITION"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_TRACE_PROVIDER_DEFINITION" Before="RemoveFiles"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_TRACE_PROVIDER_DEFINITION_TMP_PROPERTY" Before="CA_REMOVE_TRACE_PROVIDER_DEFINITION_TMP"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
@ -640,7 +560,9 @@
<Custom Action="CA_SET_MODULE32" After="CA_ADD_MODULE32_PROPERTY"><![CDATA[(NOT REMOVE AND IISEXPRESS_INSTALL_PATH32)]]></Custom>
<Custom Action="CA_ADD_CONFIGSECTION32_PROPERTY" After="CA_SET_MODULE32"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_CONFIGSECTION32" After="CA_ADD_CONFIGSECTION32_PROPERTY"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION32_PROPERTY" After="CA_ADD_CONFIGSECTION32"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_CONFIGSECTION32_PROPERTY_TMP" After="CA_ADD_CONFIGSECTION32"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_CONFIGSECTION32_TMP" After="CA_ADD_CONFIGSECTION32_PROPERTY_TMP"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION32_PROPERTY" After="CA_ADD_CONFIGSECTION32_TMP"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION32" After="CA_ADD_TRACE_PROVIDER_DEFINITION32_PROPERTY"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION_TMP32_PROPERTY" After="CA_ADD_TRACE_PROVIDER_DEFINITION32"><![CDATA[(NOT REMOVE)]]></Custom>
<Custom Action="CA_ADD_TRACE_PROVIDER_DEFINITION_TMP32" After="CA_ADD_TRACE_PROVIDER_DEFINITION_TMP32_PROPERTY"><![CDATA[(NOT REMOVE)]]></Custom>
@ -650,6 +572,8 @@
<Custom Action="CA_REMOVE_MODULE32" After="CA_REMOVE_MODULE32_PROPERTY"><![CDATA[(REMOVE~="ALL" AND IISEXPRESS_INSTALL_PATH32 AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_CONFIGSECTION32_PROPERTY" Before="CA_REMOVE_CONFIGSECTION32"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_CONFIGSECTION32" Before="RemoveFiles"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_CONFIGSECTION32_PROPERTY_TMP" Before="CA_REMOVE_CONFIGSECTION32_TMP"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_CONFIGSECTION32_TMP" Before="RemoveFiles"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_TRACE_PROVIDER_DEFINITION32_PROPERTY" Before="CA_REMOVE_TRACE_PROVIDER_DEFINITION32"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_TRACE_PROVIDER_DEFINITION32" Before="RemoveFiles"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>
<Custom Action="CA_REMOVE_TRACE_PROVIDER_DEFINITION_TMP32_PROPERTY" Before="CA_REMOVE_TRACE_PROVIDER_DEFINITION_TMP32"><![CDATA[(REMOVE~="ALL" AND NOT UPGRADINGPRODUCTCODE)]]></Custom>

View File

@ -2,6 +2,8 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#include <precomp.h>
#include <MsiQuery.h>
#include <msxml6.h>
DECLARE_DEBUG_PRINT_OBJECT( "proxyCA.dll" );
@ -40,6 +42,137 @@ struct COMPRESSION_MIME_TYPE
COMPRESSION_MIME_TYPE gMimeTypes[] =
{ { L"text/event-stream", FALSE} };
#define _HR_RET(hr) __pragma(warning(push)) \
__pragma(warning(disable:26498)) /*disable constexpr warning */ \
const HRESULT __hrRet = hr; \
__pragma(warning(pop))
#define _GOTO_FINISHED() __pragma(warning(push)) \
__pragma(warning(disable:26438)) /*disable avoid goto warning*/ \
goto Finished \
__pragma(warning(pop))
#define RETURN_IF_FAILED(hrr) do { _HR_RET(hrr); if (FAILED(__hrRet)) { hr = __hrRet; IISLogWrite(SETUP_LOG_SEVERITY_INFORMATION, L"Exiting hr=0x%x", hr); return hr; }} while (0, 0)
// Modifies the configSections to include the aspNetCore section
UINT
WINAPI
AddConfigSection(
IN MSIHANDLE handle
)
{
HRESULT hr;
CComPtr<IXMLDOMDocument2> pXMLDoc;
VARIANT_BOOL variantResult;
IXMLDOMNode* webServerNode;
IXMLDOMNode* aspNetCoreNode;
IXMLDOMNode* tempNode;
IXMLDOMElement* element;
STRU customActionData;
CComBSTR selectLanguage = SysAllocString(L"SelectionLanguage");
CComBSTR xPath = SysAllocString(L"XPath");
CComBSTR webServerPath = SysAllocString(L"//configuration/configSections/sectionGroup[@name=\"system.webServer\"]");
CComBSTR aspNetCorePath = SysAllocString(L"//configuration/configSections/sectionGroup[@name=\"system.webServer\"]/section[@name=\"aspNetCore\"]");
CComBSTR section = SysAllocString(L"section");
CComBSTR name = SysAllocString(L"name");
CComBSTR aspNetCore = SysAllocString(L"aspNetCore");
CComBSTR overrideMode = SysAllocString(L"overrideModeDefault");
CComBSTR allow = SysAllocString(L"Allow");
RETURN_IF_FAILED(CoInitialize(NULL));
hr = MsiUtilGetProperty(handle, TEXT("CustomActionData"), &customActionData);
RETURN_IF_FAILED(hr = pXMLDoc.CoCreateInstance(__uuidof(DOMDocument60)));
RETURN_IF_FAILED(hr = pXMLDoc->put_async(false));
RETURN_IF_FAILED(hr = pXMLDoc->load(CComVariant(customActionData.QueryStr()), &variantResult));
if (variantResult == VARIANT_FALSE)
{
return ERROR_SUCCESS;
}
RETURN_IF_FAILED(hr = pXMLDoc->setProperty(selectLanguage, CComVariant(xPath)));
RETURN_IF_FAILED(hr = pXMLDoc->selectSingleNode(webServerPath, &webServerNode));
RETURN_IF_FAILED(hr = pXMLDoc->selectSingleNode(aspNetCorePath, &aspNetCoreNode));
if (aspNetCoreNode == NULL)
{
RETURN_IF_FAILED(hr = pXMLDoc->createElement(section, &element));
RETURN_IF_FAILED(hr = element->setAttribute(name, CComVariant(aspNetCore)));
RETURN_IF_FAILED(hr = element->setAttribute(overrideMode, CComVariant(allow)));
RETURN_IF_FAILED(hr = webServerNode->appendChild(element, &tempNode));
RETURN_IF_FAILED(hr = pXMLDoc->save(CComVariant(customActionData.QueryStr())));
}
return ERROR_SUCCESS;
}
// Modifies the configSections to remove the aspNetCore section
UINT
WINAPI
RemoveConfigSection(
IN MSIHANDLE handle
)
{
HRESULT hr;
CComPtr<IXMLDOMDocument2> pXMLDoc;
VARIANT_BOOL variantResult;
IXMLDOMNode* webServerNode;
IXMLDOMNode* aspNetCoreNode;
IXMLDOMNode* tempNode;
STRU customActionData;
CComBSTR selectLanguage = SysAllocString(L"SelectionLanguage");
CComBSTR xPath = SysAllocString(L"XPath");
CComBSTR webServerPath = SysAllocString(L"//configuration/configSections/sectionGroup[@name=\"system.webServer\"]");
CComBSTR aspNetCorePath = SysAllocString(L"//configuration/configSections/sectionGroup[@name=\"system.webServer\"]/section[@name=\"aspNetCore\"]");
CComBSTR section = SysAllocString(L"section");
CComBSTR name = SysAllocString(L"name");
CComBSTR aspNetCore = SysAllocString(L"aspNetCore");
CComBSTR overrideMode = SysAllocString(L"overrideModeDefault");
CComBSTR allow = SysAllocString(L"Allow");
RETURN_IF_FAILED(CoInitialize(NULL));
hr = MsiUtilGetProperty(handle, TEXT("CustomActionData"), &customActionData);
RETURN_IF_FAILED(hr = pXMLDoc.CoCreateInstance(__uuidof(DOMDocument60)));
RETURN_IF_FAILED(hr = pXMLDoc->put_async(false));
RETURN_IF_FAILED(hr = pXMLDoc->load(CComVariant(customActionData.QueryStr()), &variantResult));
if (variantResult == VARIANT_FALSE)
{
return ERROR_SUCCESS;
}
RETURN_IF_FAILED(hr = pXMLDoc->setProperty(selectLanguage, CComVariant(xPath)));
RETURN_IF_FAILED(hr = pXMLDoc->selectSingleNode(webServerPath, &webServerNode));
RETURN_IF_FAILED(hr = pXMLDoc->selectSingleNode(aspNetCorePath, &aspNetCoreNode));
if (aspNetCoreNode != NULL)
{
RETURN_IF_FAILED(webServerNode->removeChild(aspNetCoreNode, &tempNode));
RETURN_IF_FAILED(hr = pXMLDoc->save(CComVariant(customActionData.QueryStr())));
}
return ERROR_SUCCESS;
}
UINT
WINAPI
RegisterANCMCompressionCA(

View File

@ -18,6 +18,8 @@ EXPORTS
ExecuteCleanUpWindowsHotfixCA
ScheduleRebootIfRequiredCA
AddConfigSection
RemoveConfigSection
RegisterANCMCompressionCA
CheckForServicesRunningCA

View File

@ -48,6 +48,9 @@
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup>
<AdditionalIncludeDirectories>$(IIS-Common)version;$(IIS-Common)Include;$(IIS-Setup)iisca\lib;$(WIX)sdk\$(WixPlatformToolset)\inc;$(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>

View File

@ -41,6 +41,9 @@
<IncludePath>$(ProjectDir)..\include;$(IncludePath)</IncludePath>
<TargetName>iiscommon</TargetName>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<SDLCheck>true</SDLCheck>

View File

@ -77,6 +77,9 @@
<PlatformToolset>v141</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<PropertyGroup>
<AdditionalIncludeDirectories>$(IIS-Common)version;$(IIS-Common)Include;$(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PrecompiledHeader>Create</PrecompiledHeader>

Binary file not shown.

View File

@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
private readonly IModelMetadataProvider _modelMetadataProvider;
private readonly ITempDataDictionaryFactory _tempDataFactory;
private readonly MvcOptions _mvcOptions;
private readonly HtmlHelperOptions _htmlHelperOptions;
private readonly MvcViewOptions _mvcViewOptions;
private readonly IPageHandlerMethodSelector _selector;
private readonly DiagnosticListener _diagnosticListener;
private readonly ILogger<PageActionInvoker> _logger;
@ -52,7 +52,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
IModelBinderFactory modelBinderFactory,
ITempDataDictionaryFactory tempDataFactory,
IOptions<MvcOptions> mvcOptions,
IOptions<HtmlHelperOptions> htmlHelperOptions,
IOptions<MvcViewOptions> mvcViewOptions,
IPageHandlerMethodSelector selector,
DiagnosticListener diagnosticListener,
ILoggerFactory loggerFactory,
@ -69,7 +69,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
modelBinderFactory,
tempDataFactory,
mvcOptions,
htmlHelperOptions,
mvcViewOptions,
selector,
diagnosticListener,
loggerFactory,
@ -90,7 +90,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
IModelBinderFactory modelBinderFactory,
ITempDataDictionaryFactory tempDataFactory,
IOptions<MvcOptions> mvcOptions,
IOptions<HtmlHelperOptions> htmlHelperOptions,
IOptions<MvcViewOptions> mvcViewOptions,
IPageHandlerMethodSelector selector,
DiagnosticListener diagnosticListener,
ILoggerFactory loggerFactory,
@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
_modelMetadataProvider = modelMetadataProvider;
_tempDataFactory = tempDataFactory;
_mvcOptions = mvcOptions.Value;
_htmlHelperOptions = htmlHelperOptions.Value;
_mvcViewOptions = mvcViewOptions.Value;
_selector = selector;
_diagnosticListener = diagnosticListener;
_logger = loggerFactory.CreateLogger<PageActionInvoker>();
@ -214,7 +214,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
cacheEntry,
_parameterBinder,
_tempDataFactory,
_htmlHelperOptions);
_mvcViewOptions.HtmlHelperOptions);
}
private PageActionInvokerCacheEntry CreateCacheEntry(

View File

@ -532,7 +532,7 @@ namespace Microsoft.AspNetCore.Mvc.RazorPages.Infrastructure
modelBinderFactory,
tempDataFactory.Object,
Options.Create(mvcOptions),
Options.Create(new HtmlHelperOptions()),
Options.Create(new MvcViewOptions()),
Mock.Of<IPageHandlerMethodSelector>(),
new DiagnosticListener("Microsoft.AspNetCore"),
NullLoggerFactory.Instance,

View File

@ -14,6 +14,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Filters
/// </summary>
internal class SaveTempDataFilter : IResourceFilter, IResultFilter
{
private static readonly Func<object, Task> OnStartingCallback = (state) => OnStarting((HttpContext)state);
// Internal for unit testing
internal static readonly object SaveTempDataFilterContextKey = new object();
@ -43,38 +44,39 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Filters
if (!context.HttpContext.Response.HasStarted)
{
context.HttpContext.Response.OnStarting((state) =>
{
var httpContext = (HttpContext)state;
var saveTempDataContext = GetTempDataContext(context.HttpContext);
if (saveTempDataContext.RequestHasUnhandledException)
{
return Task.CompletedTask;
}
// If temp data was already saved, skip trying to save again as the calls here would potentially fail
// because the session feature might not be available at this point.
// Example: An action returns NoContentResult and since NoContentResult does not write anything to
// the body of the response, this delegate would get executed way late in the pipeline at which point
// the session feature would have been removed.
if (saveTempDataContext.TempDataSaved)
{
return Task.CompletedTask;
}
SaveTempData(
result: null,
factory: saveTempDataContext.TempDataDictionaryFactory,
filters: saveTempDataContext.Filters,
httpContext: httpContext);
return Task.CompletedTask;
},
state: context.HttpContext);
context.HttpContext.Response.OnStarting(
callback: OnStartingCallback,
state: context.HttpContext);
}
}
private static Task OnStarting(HttpContext httpContext)
{
var saveTempDataContext = GetTempDataContext(httpContext);
if (saveTempDataContext.RequestHasUnhandledException)
{
return Task.CompletedTask;
}
// If temp data was already saved, skip trying to save again as the calls here would potentially fail
// because the session feature might not be available at this point.
// Example: An action returns NoContentResult and since NoContentResult does not write anything to
// the body of the response, this delegate would get executed way late in the pipeline at which point
// the session feature would have been removed.
if (saveTempDataContext.TempDataSaved)
{
return Task.CompletedTask;
}
SaveTempData(
result: null,
factory: saveTempDataContext.TempDataDictionaryFactory,
filters: saveTempDataContext.Filters,
httpContext: httpContext);
return Task.CompletedTask;
}
/// <inheritdoc />
public void OnResourceExecuted(ResourceExecutedContext context)
{
@ -115,7 +117,7 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures.Filters
}
}
private SaveTempDataContext GetTempDataContext(HttpContext httpContext)
private static SaveTempDataContext GetTempDataContext(HttpContext httpContext)
{
SaveTempDataContext saveTempDataContext = null;
if (httpContext.Items.TryGetValue(SaveTempDataFilterContextKey, out var value))

View File

@ -146,22 +146,15 @@ namespace Microsoft.AspNetCore.Mvc.ViewFeatures
return;
}
// Because it is not possible to delete while enumerating, a copy of the keys must be taken.
// Use the size of the dictionary as an upper bound to avoid creating more than one copy of the keys.
var removeCount = 0;
var keys = new string[_data.Count];
// In .NET Core 3.0 a Dictionary can have items removed during enumeration
// https://github.com/dotnet/coreclr/pull/18854
foreach (var entry in _data)
{
if (!_initialKeys.Contains(entry.Key) && !_retainedKeys.Contains(entry.Key))
{
keys[removeCount] = entry.Key;
removeCount++;
_data.Remove(entry.Key);
}
}
for (var i = 0; i < removeCount; i++)
{
_data.Remove(keys[i]);
}
_provider.SaveTempData(_context, _data);
}

View File

@ -0,0 +1,34 @@
// 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.Hosting;
using Xunit;
namespace Microsoft.AspNetCore.Mvc.FunctionalTests
{
public class ClientValidationOptionsTests : IClassFixture<MvcTestFixture<RazorPagesWebSite.Startup>>
{
public ClientValidationOptionsTests(MvcTestFixture<RazorPagesWebSite.Startup> fixture) =>
Fixture = fixture;
public MvcTestFixture<RazorPagesWebSite.Startup> Fixture { get; }
[Fact]
public async Task DisablingClientValidation_DisablesItForPagesAndViews()
{
// Arrange
var client = Fixture
.WithWebHostBuilder(whb => whb.UseStartup<RazorPagesWebSite.StartupWithClientValidationDisabled>())
.CreateClient();
// Act
var view = await client.GetStringAsync("Controller/ClientValidationDisabled");
var page = await client.GetStringAsync("ClientvalidationDisabled");
// Assert
Assert.Equal("ClientValidationDisabled", view);
Assert.Equal("ClientValidationDisabled", page);
}
}
}

View File

@ -0,0 +1,13 @@
// 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.Mvc;
namespace RazorPagesWebSite
{
public class ClientValidationDisabledController : Controller
{
[HttpGet("/Controller/ClientValidationDisabled")]
public IActionResult ValidationDisabled() => View();
}
}

View File

@ -0,0 +1,2 @@
@page
@(ViewContext.ClientValidationEnabled ? "ClientValidationEnabled" : "ClientValidationDisabled")

View File

@ -0,0 +1,41 @@
// 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.Authentication.Cookies;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
namespace RazorPagesWebSite
{
public class StartupWithClientValidationDisabled
{
public void ConfigureServices(IServiceCollection services)
{
services.AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
.AddCookie(options => options.LoginPath = "/Login");
services.AddRazorPages(options =>
{
options.Conventions.AuthorizeFolder("/Admin");
})
.SetCompatibilityVersion(CompatibilityVersion.Latest);
services.Configure<MvcViewOptions>(o => o.HtmlHelperOptions.ClientValidationEnabled = false);
}
public void Configure(IApplicationBuilder app)
{
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapRazorPages();
});
}
}
}

View File

@ -0,0 +1 @@
@(ViewContext.ClientValidationEnabled ? "ClientValidationEnabled" : "ClientValidationDisabled")

View File

@ -50,7 +50,5 @@ body {
bottom: 0;
width: 100%;
white-space: nowrap;
/* Set the fixed height of the footer here */
height: 60px;
line-height: 60px; /* Vertically center the text there */
}

View File

@ -50,7 +50,5 @@ body {
bottom: 0;
width: 100%;
white-space: nowrap;
/* Set the fixed height of the footer here */
height: 60px;
line-height: 60px; /* Vertically center the text there */
}

View File

@ -50,7 +50,5 @@ body {
bottom: 0;
width: 100%;
white-space: nowrap;
/* Set the fixed height of the footer here */
height: 60px;
line-height: 60px; /* Vertically center the text there */
}

View File

@ -11,7 +11,7 @@ it('renders without crashing', () => {
dispatch: () => {},
getState: () => ({ ...state })
});
const store = storeFake({});
const store = storeFake({}) as any;
ReactDOM.render(
<Provider store={store}>

View File

@ -27,7 +27,15 @@ namespace Microsoft.AspNetCore.Authentication.MicrosoftAccount
ClaimActions.MapJsonKey(ClaimTypes.Name, "displayName");
ClaimActions.MapJsonKey(ClaimTypes.GivenName, "givenName");
ClaimActions.MapJsonKey(ClaimTypes.Surname, "surname");
ClaimActions.MapCustomJson(ClaimTypes.Email, user => user.GetString("mail") ?? user.GetString("userPrincipalName"));
ClaimActions.MapCustomJson(ClaimTypes.Email, user =>
{
var mail = user.GetString("mail");
if (string.IsNullOrEmpty(mail))
{
mail = user.GetString("userPrincipalName");
}
return mail;
});
}
}
}

View File

@ -203,7 +203,8 @@ namespace Microsoft.AspNetCore.Authentication.Tests.MicrosoftAccount
displayName = "Test Name",
givenName = "Test Given Name",
surname = "Test Family Name",
mail = "Test email"
mail = "",
userPrincipalName = "Test email"
});
}

View File

@ -28,6 +28,9 @@
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>

View File

@ -26,6 +26,9 @@
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>

View File

@ -26,6 +26,9 @@
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />

View File

@ -26,6 +26,9 @@
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>

View File

@ -28,6 +28,9 @@
<ProjectName>InProcessRequestHandler</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>

View File

@ -28,6 +28,9 @@
<ProjectName>OutOfProcessRequestHandler</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>

View File

@ -26,6 +26,9 @@
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>

View File

@ -29,6 +29,9 @@
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration">
<VCToolsVersion />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>

View File

@ -7,6 +7,7 @@ using System.Threading.Tasks;
using Microsoft.AspNetCore.Server.IIS.FunctionalTests.Utilities;
using Microsoft.AspNetCore.Server.IntegrationTesting;
using Microsoft.AspNetCore.Server.IntegrationTesting.IIS;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Xunit;
@ -170,6 +171,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
}
[ConditionalTheory]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2200", FlakyOn.All)]
[MemberData(nameof(TestVariants))]
public async Task CheckUTF8File(TestVariant variant)
{

View File

@ -4,7 +4,7 @@
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildThisFileDirectory)..\</SolutionDir>
<Configuration Condition="'$(Configuration)'==''">Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<OutputPath Condition="'$(OutputPath)' == ''">$(MSBuildProjectDirectory)\bin\$(Configuration)\$(Platform)\</OutputPath>
<OutDir>$(OutputPath)</OutDir>
<AspNetCoreModuleTargetName>aspnetcore</AspNetCoreModuleTargetName>

View File

@ -121,6 +121,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core
public Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal.SchedulingMode ApplicationSchedulingMode { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
public System.IServiceProvider ApplicationServices { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
public Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader ConfigurationLoader { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
public bool DisableStringReuse { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } [System.Runtime.CompilerServices.CompilerGeneratedAttribute]set { } }
public Microsoft.AspNetCore.Server.Kestrel.Core.KestrelServerLimits Limits { [System.Runtime.CompilerServices.CompilerGeneratedAttribute]get { throw null; } }
public Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader Configure() { throw null; }
public Microsoft.AspNetCore.Server.Kestrel.KestrelConfigurationLoader Configure(Microsoft.Extensions.Configuration.IConfiguration config) { throw null; }
@ -251,6 +252,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
public partial interface IHttpHeadersHandler
{
void OnHeader(System.Span<byte> name, System.Span<byte> value);
void OnHeadersComplete();
}
public partial interface IHttpParser<TRequestHandler> where TRequestHandler : Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.IHttpHeadersHandler, Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.IHttpRequestLineHandler
{

View File

@ -19,6 +19,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
private const byte ByteAsterisk = (byte)'*';
private const byte ByteForwardSlash = (byte)'/';
private const string Asterisk = "*";
private const string ForwardSlash = "/";
private readonly HttpConnectionContext _context;
private readonly IHttpParser<Http1ParsingHandler> _parser;
@ -268,16 +269,68 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
_requestTargetForm = HttpRequestTarget.OriginForm;
if (target.Length == 1)
{
// If target.Length == 1 it can only be a forward slash (e.g. home page)
// and we know RawTarget and Path are the same and QueryString is Empty
RawTarget = ForwardSlash;
Path = ForwardSlash;
QueryString = string.Empty;
// Clear parsedData as we won't check it if we come via this path again,
// an setting to null is fast as it doesn't need to use a GC write barrier.
_parsedRawTarget = _parsedPath = _parsedQueryString = null;
return;
}
// URIs are always encoded/escaped to ASCII https://tools.ietf.org/html/rfc3986#page-11
// Multibyte Internationalized Resource Identifiers (IRIs) are first converted to utf8;
// then encoded/escaped to ASCII https://www.ietf.org/rfc/rfc3987.txt "Mapping of IRIs to URIs"
try
{
var disableStringReuse = ServerOptions.DisableStringReuse;
// Read raw target before mutating memory.
RawTarget = target.GetAsciiStringNonNullCharacters();
QueryString = query.GetAsciiStringNonNullCharacters();
Path = PathNormalizer.DecodePath(path, pathEncoded, RawTarget, query.Length);
var previousValue = _parsedRawTarget;
if (disableStringReuse ||
previousValue == null || previousValue.Length != target.Length ||
!StringUtilities.BytesOrdinalEqualsStringAndAscii(previousValue, target))
{
// The previous string does not match what the bytes would convert to,
// so we will need to generate a new string.
RawTarget = _parsedRawTarget = target.GetAsciiStringNonNullCharacters();
previousValue = _parsedQueryString;
if (disableStringReuse ||
previousValue == null || previousValue.Length != query.Length ||
!StringUtilities.BytesOrdinalEqualsStringAndAscii(previousValue, query))
{
// The previous string does not match what the bytes would convert to,
// so we will need to generate a new string.
QueryString = _parsedQueryString = query.GetAsciiStringNonNullCharacters();
}
else
{
// Same as previous
QueryString = _parsedQueryString;
}
if (path.Length == 1)
{
// If path.Length == 1 it can only be a forward slash (e.g. home page)
Path = _parsedPath = ForwardSlash;
}
else
{
Path = _parsedPath = PathNormalizer.DecodePath(path, pathEncoded, RawTarget, query.Length);
}
}
else
{
// As RawTarget is the same we can reuse the previous parsed values.
RawTarget = _parsedRawTarget;
Path = _parsedPath;
QueryString = _parsedQueryString;
}
}
catch (InvalidOperationException)
{
@ -312,9 +365,27 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
//
// Allowed characters in the 'host + port' section of authority.
// See https://tools.ietf.org/html/rfc3986#section-3.2
RawTarget = target.GetAsciiStringNonNullCharacters();
var previousValue = _parsedRawTarget;
if (ServerOptions.DisableStringReuse ||
previousValue == null || previousValue.Length != target.Length ||
!StringUtilities.BytesOrdinalEqualsStringAndAscii(previousValue, target))
{
// The previous string does not match what the bytes would convert to,
// so we will need to generate a new string.
RawTarget = _parsedRawTarget = target.GetAsciiStringNonNullCharacters();
}
else
{
// Reuse previous value
RawTarget = _parsedRawTarget;
}
Path = string.Empty;
QueryString = string.Empty;
// Clear parsedData for path and queryString as we won't check it if we come via this path again,
// an setting to null is fast as it doesn't need to use a GC write barrier.
_parsedPath = _parsedQueryString = null;
}
private void OnAsteriskFormTarget(HttpMethod method)
@ -331,6 +402,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
RawTarget = Asterisk;
Path = string.Empty;
QueryString = string.Empty;
// Clear parsedData as we won't check it if we come via this path again,
// an setting to null is fast as it doesn't need to use a GC write barrier.
_parsedRawTarget = _parsedPath = _parsedQueryString = null;
}
private void OnAbsoluteFormTarget(Span<byte> target, Span<byte> query)
@ -346,21 +420,49 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
// a server MUST accept the absolute-form in requests, even though
// HTTP/1.1 clients will only send them in requests to proxies.
RawTarget = target.GetAsciiStringNonNullCharacters();
// Validation of absolute URIs is slow, but clients
// should not be sending this form anyways, so perf optimization
// not high priority
if (!Uri.TryCreate(RawTarget, UriKind.Absolute, out var uri))
var disableStringReuse = ServerOptions.DisableStringReuse;
var previousValue = _parsedRawTarget;
if (disableStringReuse ||
previousValue == null || previousValue.Length != target.Length ||
!StringUtilities.BytesOrdinalEqualsStringAndAscii(previousValue, target))
{
ThrowRequestTargetRejected(target);
}
// The previous string does not match what the bytes would convert to,
// so we will need to generate a new string.
RawTarget = _parsedRawTarget = target.GetAsciiStringNonNullCharacters();
_absoluteRequestTarget = uri;
Path = uri.LocalPath;
// don't use uri.Query because we need the unescaped version
QueryString = query.GetAsciiStringNonNullCharacters();
// Validation of absolute URIs is slow, but clients
// should not be sending this form anyways, so perf optimization
// not high priority
if (!Uri.TryCreate(RawTarget, UriKind.Absolute, out var uri))
{
ThrowRequestTargetRejected(target);
}
_absoluteRequestTarget = uri;
Path = _parsedPath = uri.LocalPath;
// don't use uri.Query because we need the unescaped version
previousValue = _parsedQueryString;
if (disableStringReuse ||
previousValue == null || previousValue.Length != query.Length ||
!StringUtilities.BytesOrdinalEqualsStringAndAscii(previousValue, query))
{
// The previous string does not match what the bytes would convert to,
// so we will need to generate a new string.
QueryString = _parsedQueryString = query.GetAsciiStringNonNullCharacters();
}
else
{
QueryString = _parsedQueryString;
}
}
else
{
// As RawTarget is the same we can reuse the previous values.
RawTarget = _parsedRawTarget;
Path = _parsedPath;
QueryString = _parsedQueryString;
}
}
internal void EnsureHostHeaderExists()

View File

@ -17,6 +17,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
public void OnHeader(Span<byte> name, Span<byte> value)
=> Connection.OnHeader(name, value);
public void OnHeadersComplete()
=> Connection.OnHeadersComplete();
public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
=> Connection.OnStartLine(method, version, target, path, query, customMethod, pathEncoded);
}

View File

@ -16,6 +16,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
internal abstract class HttpHeaders : IHeaderDictionary
{
protected long _bits = 0;
protected long? _contentLength;
protected bool _isReadOnly;
protected Dictionary<string, StringValues> MaybeUnknown;

View File

@ -241,6 +241,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}
done = true;
handler.OnHeadersComplete();
return true;
}

View File

@ -35,7 +35,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
private Stack<KeyValuePair<Func<object, Task>, object>> _onCompleted;
private object _abortLock = new object();
private volatile bool _requestAborted;
private volatile bool _connectionAborted;
private bool _preventRequestAbortedCancellation;
private CancellationTokenSource _abortedCts;
private CancellationToken? _manuallySetRequestAbortToken;
@ -74,6 +74,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
_context = context;
ServerOptions = ServiceContext.ServerOptions;
HttpRequestHeaders = new HttpRequestHeaders(reuseHeaderValues: !ServerOptions.DisableStringReuse);
HttpResponseControl = this;
}
@ -124,8 +125,14 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
public string Scheme { get; set; }
public HttpMethod Method { get; set; }
public string PathBase { get; set; }
protected string _parsedPath = null;
public string Path { get; set; }
protected string _parsedQueryString = null;
public string QueryString { get; set; }
protected string _parsedRawTarget = null;
public string RawTarget { get; set; }
public string HttpVersion
@ -250,7 +257,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
return new CancellationToken(false);
}
if (_requestAborted)
if (_connectionAborted)
{
return new CancellationToken(true);
}
@ -275,7 +282,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
public bool HasFlushedHeaders => _requestProcessingStatus == RequestProcessingStatus.HeadersFlushed;
protected HttpRequestHeaders HttpRequestHeaders { get; } = new HttpRequestHeaders();
protected HttpRequestHeaders HttpRequestHeaders { get; }
protected HttpResponseHeaders HttpResponseHeaders { get; } = new HttpResponseHeaders();
@ -368,18 +375,19 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
Scheme = _scheme;
_manuallySetRequestAbortToken = null;
_preventRequestAbortedCancellation = false;
// Lock to prevent CancelRequestAbortedToken from attempting to cancel an disposed CTS.
// Lock to prevent CancelRequestAbortedToken from attempting to cancel a disposed CTS.
CancellationTokenSource localAbortCts = null;
lock (_abortLock)
{
if (!_requestAborted)
{
_abortedCts?.Dispose();
_abortedCts = null;
}
_preventRequestAbortedCancellation = false;
localAbortCts = _abortedCts;
_abortedCts = null;
}
localAbortCts?.Dispose();
if (_wrapperObjectsToDispose != null)
{
foreach (var disposable in _wrapperObjectsToDispose)
@ -435,9 +443,20 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
try
{
_abortedCts.Cancel();
_abortedCts.Dispose();
_abortedCts = null;
CancellationTokenSource localAbortCts = null;
lock (_abortLock)
{
if (_abortedCts != null && !_preventRequestAbortedCancellation)
{
localAbortCts = _abortedCts;
_abortedCts = null;
}
}
// If we cancel the cts, we don't dispose as people may still be using
// the cts. It also isn't necessary to dispose a canceled cts.
localAbortCts?.Cancel();
}
catch (Exception ex)
{
@ -447,17 +466,20 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
protected void AbortRequest()
{
var shouldScheduleCancellation = false;
lock (_abortLock)
{
if (_requestAborted)
if (_connectionAborted)
{
return;
}
_requestAborted = true;
shouldScheduleCancellation = _abortedCts != null && !_preventRequestAbortedCancellation;
_connectionAborted = true;
}
if (_abortedCts != null)
if (shouldScheduleCancellation)
{
// Potentially calling user code. CancelRequestAbortedToken logs any exceptions.
ServiceContext.Scheduler.Schedule(state => ((HttpProtocol)state).CancelRequestAbortedToken(), this);
@ -474,14 +496,12 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
lock (_abortLock)
{
if (_requestAborted)
if (_connectionAborted)
{
return;
}
_preventRequestAbortedCancellation = true;
_abortedCts?.Dispose();
_abortedCts = null;
}
}
@ -492,9 +512,13 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
BadHttpRequestException.Throw(RequestRejectionReason.TooManyHeaders);
}
var valueString = value.GetAsciiOrUTF8StringNonNullCharacters();
HttpRequestHeaders.Append(name, valueString);
HttpRequestHeaders.Append(name, value);
}
public void OnHeadersComplete()
{
HttpRequestHeaders.OnHeadersComplete();
}
public async Task ProcessRequestsAsync<TContext>(IHttpApplication<TContext> application)
@ -583,7 +607,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
// Run the application code for this request
await application.ProcessRequestAsync(context);
if (!_requestAborted)
if (!_connectionAborted)
{
VerifyResponseContentLength();
}
@ -619,7 +643,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
// 4XX responses are written by TryProduceInvalidRequestResponse during connection tear down.
if (_requestRejectedException == null)
{
if (!_requestAborted)
if (!_connectionAborted)
{
// Call ProduceEnd() before consuming the rest of the request body to prevent
// delaying clients waiting for the chunk terminator:
@ -651,7 +675,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
application.DisposeContext(context, _applicationException);
// Even for non-keep-alive requests, try to consume the entire body to avoid RSTs.
if (!_requestAborted && _requestRejectedException == null && !messageBody.IsEmpty)
if (!_connectionAborted && _requestRejectedException == null && !messageBody.IsEmpty)
{
await messageBody.ConsumeAsync();
}
@ -953,7 +977,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
protected Task TryProduceInvalidRequestResponse()
{
// If _requestAborted is set, the connection has already been closed.
if (_requestRejectedException != null && !_requestAborted)
if (_requestRejectedException != null && !_connectionAborted)
{
return ProduceEnd();
}

View File

@ -2,6 +2,7 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Buffers.Text;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
@ -13,6 +14,50 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{
internal sealed partial class HttpRequestHeaders : HttpHeaders
{
private readonly bool _reuseHeaderValues;
private long _previousBits = 0;
public HttpRequestHeaders(bool reuseHeaderValues = true)
{
_reuseHeaderValues = reuseHeaderValues;
}
public void OnHeadersComplete()
{
var bitsToClear = _previousBits & ~_bits;
_previousBits = 0;
if (bitsToClear != 0)
{
// Some previous headers were not reused or overwritten.
// While they cannot be accessed by the current request (as they were not supplied by it)
// there is no point in holding on to them, so clear them now,
// to allow them to get collected by the GC.
Clear(bitsToClear);
}
}
protected override void ClearFast()
{
if (!_reuseHeaderValues)
{
// If we aren't reusing headers clear them all
Clear(_bits);
}
else
{
// If we are reusing headers, store the currently set headers for comparison later
_previousBits = _bits;
}
// Mark no headers as currently in use
_bits = 0;
// Clear ContentLength and any unknown headers as we will never reuse them
_contentLength = null;
MaybeUnknown?.Clear();
}
private static long ParseContentLength(string value)
{
if (!HeaderUtilities.TryParseNonNegativeInt64(value, out var parsed))
@ -23,34 +68,45 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
return parsed;
}
[MethodImpl(MethodImplOptions.NoInlining)]
private void AppendContentLength(Span<byte> value)
{
if (_contentLength.HasValue)
{
BadHttpRequestException.Throw(RequestRejectionReason.MultipleContentLengths);
}
if (!Utf8Parser.TryParse(value, out long parsed, out var consumed) ||
parsed < 0 ||
consumed != value.Length)
{
BadHttpRequestException.Throw(RequestRejectionReason.InvalidContentLength, value.GetAsciiOrUTF8StringNonNullCharacters());
}
_contentLength = parsed;
}
[MethodImpl(MethodImplOptions.NoInlining)]
private void SetValueUnknown(string key, StringValues value)
{
Unknown[key] = value;
}
public unsafe void Append(Span<byte> name, string value)
{
fixed (byte* namePtr = name)
{
Append(namePtr, name.Length, value);
}
}
[MethodImpl(MethodImplOptions.NoInlining)]
private unsafe void AppendUnknownHeaders(byte* pKeyBytes, int keyLength, string value)
private unsafe void AppendUnknownHeaders(Span<byte> name, string valueString)
{
string key = new string('\0', keyLength);
string key = new string('\0', name.Length);
fixed (byte* pKeyBytes = name)
fixed (char* keyBuffer = key)
{
if (!StringUtilities.TryGetAsciiString(pKeyBytes, keyBuffer, keyLength))
if (!StringUtilities.TryGetAsciiString(pKeyBytes, keyBuffer, name.Length))
{
BadHttpRequestException.Throw(RequestRejectionReason.InvalidCharactersInHeaderName);
}
}
Unknown.TryGetValue(key, out var existing);
Unknown[key] = AppendValue(existing, value);
Unknown[key] = AppendValue(existing, valueString);
}
public Enumerator GetEnumerator()

View File

@ -8,5 +8,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
public interface IHttpHeadersHandler
{
void OnHeader(Span<byte> name, Span<byte> value);
void OnHeadersComplete();
}
}

View File

@ -1092,6 +1092,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http2
}
}
public void OnHeadersComplete()
=> _currentHeadersStream.OnHeadersComplete();
private void ValidateHeader(Span<byte> name, Span<byte> value)
{
// http://httpwg.org/specs/rfc7540.html#rfc.section.8.1.2.1

View File

@ -2,13 +2,19 @@
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System;
using System.Buffers.Binary;
using System.Diagnostics;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using System.Text;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure
{
internal class StringUtilities
{
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public static unsafe bool TryGetAsciiString(byte* input, char* output, int count)
{
// Calculate end position
@ -109,6 +115,261 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure
return isValid;
}
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public unsafe static bool BytesOrdinalEqualsStringAndAscii(string previousValue, Span<byte> newValue)
{
// previousValue is a previously materialized string which *must* have already passed validation.
Debug.Assert(IsValidHeaderString(previousValue));
// Ascii bytes => Utf-16 chars will be the same length.
// The caller should have already compared lengths before calling this method.
// However; let's double check, and early exit if they are not the same length.
if (previousValue.Length != newValue.Length)
{
// Lengths don't match, so there cannot be an exact ascii conversion between the two.
goto NotEqual;
}
// Use IntPtr values rather than int, to avoid unnecessary 32 -> 64 movs on 64-bit.
// Unfortunately this means we also need to cast to byte* for comparisons as IntPtr doesn't
// support operator comparisons (e.g. <=, >, etc).
//
// Note: Pointer comparison is unsigned, so we use the compare pattern (offset + length <= count)
// rather than (offset <= count - length) which we'd do with signed comparison to avoid overflow.
// This isn't problematic as we know the maximum length is max string length (from test above)
// which is a signed value so half the size of the unsigned pointer value so we can safely add
// a Vector<byte>.Count to it without overflowing.
var count = (IntPtr)newValue.Length;
var offset = (IntPtr)0;
// Get references to the first byte in the span, and the first char in the string.
ref var bytes = ref MemoryMarshal.GetReference(newValue);
ref var str = ref MemoryMarshal.GetReference(previousValue.AsSpan());
do
{
// If Vector not-accelerated or remaining less than vector size
if (!Vector.IsHardwareAccelerated || (byte*)(offset + Vector<byte>.Count) > (byte*)count)
{
if (IntPtr.Size == 8) // Use Intrinsic switch for branch elimination
{
// 64-bit: Loop longs by default
while ((byte*)(offset + sizeof(long)) <= (byte*)count)
{
if (!WidenFourAsciiBytesToUtf16AndCompareToChars(
ref Unsafe.Add(ref str, offset),
Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref bytes, offset))) ||
!WidenFourAsciiBytesToUtf16AndCompareToChars(
ref Unsafe.Add(ref str, offset + 4),
Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref bytes, offset + 4))))
{
goto NotEqual;
}
offset += sizeof(long);
}
if ((byte*)(offset + sizeof(int)) <= (byte*)count)
{
if (!WidenFourAsciiBytesToUtf16AndCompareToChars(
ref Unsafe.Add(ref str, offset),
Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref bytes, offset))))
{
goto NotEqual;
}
offset += sizeof(int);
}
}
else
{
// 32-bit: Loop ints by default
while ((byte*)(offset + sizeof(int)) <= (byte*)count)
{
if (!WidenFourAsciiBytesToUtf16AndCompareToChars(
ref Unsafe.Add(ref str, offset),
Unsafe.ReadUnaligned<uint>(ref Unsafe.Add(ref bytes, offset))))
{
goto NotEqual;
}
offset += sizeof(int);
}
}
if ((byte*)(offset + sizeof(short)) <= (byte*)count)
{
if (!WidenTwoAsciiBytesToUtf16AndCompareToChars(
ref Unsafe.Add(ref str, offset),
Unsafe.ReadUnaligned<ushort>(ref Unsafe.Add(ref bytes, offset))))
{
goto NotEqual;
}
offset += sizeof(short);
}
if ((byte*)offset < (byte*)count)
{
var ch = (char)Unsafe.Add(ref bytes, offset);
if (((ch & 0x80) != 0) || Unsafe.Add(ref str, offset) != ch)
{
goto NotEqual;
}
}
// End of input reached, there are no inequalities via widening; so the input bytes are both ascii
// and a match to the string if it was converted via Encoding.ASCII.GetString(...)
return true;
}
// Create a comparision vector for all bits being equal
var AllTrue = new Vector<short>(-1);
// do/while as entry condition already checked, remaining length must be Vector<byte>.Count or larger.
do
{
// Read a Vector length from the input as bytes
var vector = Unsafe.ReadUnaligned<Vector<sbyte>>(ref Unsafe.Add(ref bytes, offset));
if (!CheckBytesInAsciiRange(vector))
{
goto NotEqual;
}
// Widen the bytes directly to chars (ushort) as if they were ascii.
// As widening doubles the size we get two vectors back.
Vector.Widen(vector, out var vector0, out var vector1);
// Read two char vectors from the string to perform the match.
var compare0 = Unsafe.ReadUnaligned<Vector<short>>(ref Unsafe.As<char, byte>(ref Unsafe.Add(ref str, offset)));
var compare1 = Unsafe.ReadUnaligned<Vector<short>>(ref Unsafe.As<char, byte>(ref Unsafe.Add(ref str, offset + Vector<ushort>.Count)));
// If the string is not ascii, then the widened bytes cannot match
// as each widened byte element as chars will be in the range 0-255
// so cannot match any higher unicode values.
// Compare to our all bits true comparision vector
if (!AllTrue.Equals(
// BitwiseAnd the two equals together
Vector.BitwiseAnd(
// Check equality for the two widened vectors
Vector.Equals(compare0, vector0),
Vector.Equals(compare1, vector1))))
{
goto NotEqual;
}
offset += Vector<byte>.Count;
} while ((byte*)(offset + Vector<byte>.Count) <= (byte*)count);
// Vector path done, loop back to do non-Vector
// If is a exact multiple of vector size, bail now
} while ((byte*)offset < (byte*)count);
// If we get here (input is exactly a multiple of Vector length) then there are no inequalities via widening;
// so the input bytes are both ascii and a match to the string if it was converted via Encoding.ASCII.GetString(...)
return true;
NotEqual:
return false;
}
/// <summary>
/// Given a DWORD which represents a buffer of 4 bytes, widens the buffer into 4 WORDs and
/// compares them to the WORD buffer with machine endianness.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private static bool WidenFourAsciiBytesToUtf16AndCompareToChars(ref char charStart, uint value)
{
if (!AllBytesInUInt32AreAscii(value))
{
return false;
}
if (Bmi2.X64.IsSupported)
{
// BMI2 will work regardless of the processor's endianness.
return Unsafe.ReadUnaligned<ulong>(ref Unsafe.As<char, byte>(ref charStart)) ==
Bmi2.X64.ParallelBitDeposit(value, 0x00FF00FF_00FF00FFul);
}
else
{
if (BitConverter.IsLittleEndian)
{
return charStart == (char)(byte)value &&
Unsafe.Add(ref charStart, 1) == (char)(byte)(value >> 8) &&
Unsafe.Add(ref charStart, 2) == (char)(byte)(value >> 16) &&
Unsafe.Add(ref charStart, 3) == (char)(value >> 24);
}
else
{
return Unsafe.Add(ref charStart, 3) == (char)(byte)value &&
Unsafe.Add(ref charStart, 2) == (char)(byte)(value >> 8) &&
Unsafe.Add(ref charStart, 1) == (char)(byte)(value >> 16) &&
charStart == (char)(value >> 24);
}
}
}
/// <summary>
/// Given a WORD which represents a buffer of 2 bytes, widens the buffer into 2 WORDs and
/// compares them to the WORD buffer with machine endianness.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
private static bool WidenTwoAsciiBytesToUtf16AndCompareToChars(ref char charStart, ushort value)
{
if (!AllBytesInUInt16AreAscii(value))
{
return false;
}
if (Bmi2.IsSupported)
{
// BMI2 will work regardless of the processor's endianness.
return Unsafe.ReadUnaligned<uint>(ref Unsafe.As<char, byte>(ref charStart)) ==
Bmi2.ParallelBitDeposit(value, 0x00FF00FFu);
}
else
{
if (BitConverter.IsLittleEndian)
{
return charStart == (char)(byte)value &&
Unsafe.Add(ref charStart, 1) == (char)(byte)(value >> 8);
}
else
{
return Unsafe.Add(ref charStart, 1) == (char)(byte)value &&
charStart == (char)(byte)(value >> 8);
}
}
}
/// <summary>
/// Returns <see langword="true"/> iff all bytes in <paramref name="value"/> are ASCII.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static bool AllBytesInUInt32AreAscii(uint value)
{
return ((value & 0x80808080u) == 0);
}
/// <summary>
/// Returns <see langword="true"/> iff all bytes in <paramref name="value"/> are ASCII.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static bool AllBytesInUInt16AreAscii(ushort value)
{
return ((value & 0x8080u) == 0);
}
private unsafe static bool IsValidHeaderString(string value)
{
// Method for Debug.Assert to ensure BytesOrdinalEqualsStringAndAscii
// is not called with an unvalidated string comparitor.
try
{
if (value is null) return false;
new UTF8Encoding(encoderShouldEmitUTF8Identifier: false, throwOnInvalidBytes: true).GetByteCount(value);
return !value.Contains('\0');
}
catch (DecoderFallbackException) {
return false;
}
}
private static readonly char[] s_encode16Chars = "0123456789ABCDEF".ToCharArray();
/// <summary>

View File

@ -54,6 +54,15 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core
/// </remarks>
public bool AllowSynchronousIO { get; set; } = false;
/// <summary>
/// Gets or sets a value that controls whether the string values materialized
/// will be reused across requests; if they match, or if the strings will always be reallocated.
/// </summary>
/// <remarks>
/// Defaults to false.
/// </remarks>
public bool DisableStringReuse { get; set; } = false;
/// <summary>
/// Enables the Listen options callback to resolve and use services registered by the application during startup.
/// Typically initialized by UseKestrel()"/>.

View File

@ -24,16 +24,28 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
.Concat(byteRange)
.ToArray();
var s = new Span<byte>(byteArray).GetAsciiStringNonNullCharacters();
var span = new Span<byte>(byteArray);
Assert.Equal(s.Length, byteArray.Length);
for (var i = 1; i < byteArray.Length; i++)
for (var i = 0; i <= byteArray.Length; i++)
{
var sb = (byte)s[i];
var b = byteArray[i];
// Test all the lengths to hit all the different length paths e.g. Vector, long, short, char
Test(span.Slice(i));
}
Assert.Equal(sb, b);
static void Test(Span<byte> asciiBytes)
{
var s = asciiBytes.GetAsciiStringNonNullCharacters();
Assert.True(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, asciiBytes));
Assert.Equal(s.Length, asciiBytes.Length);
for (var i = 0; i < asciiBytes.Length; i++)
{
var sb = (byte)s[i];
var b = asciiBytes[i];
Assert.Equal(sb, b);
}
}
}
@ -59,8 +71,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
{
var byteRange = Enumerable.Range(0, 16384 + 64).Select(x => (byte)((x & 0x7f) | 0x01)).ToArray();
var expectedByteRange = byteRange.Concat(byteRange).ToArray();
var s = new Span<byte>(expectedByteRange).GetAsciiStringNonNullCharacters();
var span = new Span<byte>(expectedByteRange);
var s = span.GetAsciiStringNonNullCharacters();
Assert.Equal(expectedByteRange.Length, s.Length);
@ -68,8 +81,74 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
{
var sb = (byte)((s[i] & 0x7f) | 0x01);
var b = expectedByteRange[i];
}
Assert.Equal(sb, b);
Assert.True(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, span));
}
[Fact]
private void DifferentLengthsAreNotEqual()
{
var byteRange = Enumerable.Range(0, 4096).Select(x => (byte)((x & 0x7f) | 0x01)).ToArray();
var expectedByteRange = byteRange.Concat(byteRange).ToArray();
for (var i = 1; i < byteRange.Length; i++)
{
var span = new Span<byte>(expectedByteRange);
var s = span.GetAsciiStringNonNullCharacters();
Assert.True(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, span));
// One off end
Assert.False(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, span.Slice(0, span.Length - 1)));
Assert.False(StringUtilities.BytesOrdinalEqualsStringAndAscii(s.Substring(0, s.Length - 1), span));
// One off start
Assert.False(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, span.Slice(1, span.Length - 1)));
Assert.False(StringUtilities.BytesOrdinalEqualsStringAndAscii(s.Substring(1, s.Length - 1), span));
}
}
[Fact]
private void AsciiBytesEqualAsciiStrings()
{
var byteRange = Enumerable.Range(1, 127).Select(x => (byte)x);
var byteArray = byteRange
.Concat(byteRange)
.Concat(byteRange)
.Concat(byteRange)
.Concat(byteRange)
.Concat(byteRange)
.ToArray();
var span = new Span<byte>(byteArray);
for (var i = 0; i <= byteArray.Length; i++)
{
// Test all the lengths to hit all the different length paths e.g. Vector, long, short, char
Test(span.Slice(i));
}
static void Test(Span<byte> asciiBytes)
{
var s = asciiBytes.GetAsciiStringNonNullCharacters();
// Should start as equal
Assert.True(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, asciiBytes));
for (var i = 0; i < asciiBytes.Length; i++)
{
var b = asciiBytes[i];
// Change one byte, ensure is not equal
asciiBytes[i] = (byte)(b + 1);
Assert.False(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, asciiBytes));
// Change byte back for next iteration, ensure is equal again
asciiBytes[i] = b;
Assert.True(StringUtilities.BytesOrdinalEqualsStringAndAscii(s, asciiBytes));
}
}
}
}

View File

@ -103,6 +103,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
_decodedHeaders[name.GetAsciiStringNonNullCharacters()] = value.GetAsciiStringNonNullCharacters();
}
void IHttpHeadersHandler.OnHeadersComplete() { }
[Fact]
public void DecodesIndexedHeaderField_StaticTable()
{

View File

@ -729,6 +729,20 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
Assert.False(_http1Connection.RequestAborted.IsCancellationRequested);
}
[Fact]
public void RequestAbortedTokenIsFullyUsableAfterCancellation()
{
var originalToken = _http1Connection.RequestAborted;
var originalRegistration = originalToken.Register(() => { });
_http1Connection.Abort(new ConnectionAbortedException());
Assert.True(originalToken.WaitHandle.WaitOne(TestConstants.DefaultTimeout));
Assert.True(_http1Connection.RequestAborted.WaitHandle.WaitOne(TestConstants.DefaultTimeout));
Assert.Equal(originalToken, originalRegistration.Token);
}
[Fact]
public void RequestAbortedTokenIsUsableAfterCancellation()
{

View File

@ -483,6 +483,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
Headers[name.GetAsciiStringNonNullCharacters()] = value.GetAsciiStringNonNullCharacters();
}
void IHttpHeadersHandler.OnHeadersComplete() { }
public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
{
Method = method != HttpMethod.Custom ? HttpUtilities.MethodToString(method) : customMethod.GetAsciiStringNonNullCharacters();

View File

@ -3,11 +3,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
using Microsoft.Extensions.Primitives;
using Xunit;
using static CodeGenerator.KnownHeaders;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
{
@ -307,8 +309,347 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
var encoding = Encoding.GetEncoding("iso-8859-1");
var exception = Assert.Throws<BadHttpRequestException>(
() => headers.Append(encoding.GetBytes(key), "value"));
() => headers.Append(encoding.GetBytes(key), Encoding.ASCII.GetBytes("value")));
Assert.Equal(StatusCodes.Status400BadRequest, exception.StatusCode);
}
[Theory]
[MemberData(nameof(KnownRequestHeaders))]
public void ValueReuseOnlyWhenAllowed(bool reuseValue, KnownHeader header)
{
const string HeaderValue = "Hello";
var headers = new HttpRequestHeaders(reuseHeaderValues: reuseValue);
for (var i = 0; i < 6; i++)
{
var prevName = ChangeNameCase(header.Name, variant: i);
var nextName = ChangeNameCase(header.Name, variant: i + 1);
var values = GetHeaderValues(headers, prevName, nextName, HeaderValue, HeaderValue);
Assert.Equal(HeaderValue, values.PrevHeaderValue);
Assert.NotSame(HeaderValue, values.PrevHeaderValue);
Assert.Equal(HeaderValue, values.NextHeaderValue);
Assert.NotSame(HeaderValue, values.NextHeaderValue);
Assert.Equal(values.PrevHeaderValue, values.NextHeaderValue);
if (reuseValue)
{
// When materalized string is reused previous and new should be the same object
Assert.Same(values.PrevHeaderValue, values.NextHeaderValue);
}
else
{
// When materalized string is not reused previous and new should be the different objects
Assert.NotSame(values.PrevHeaderValue, values.NextHeaderValue);
}
}
}
[Theory]
[MemberData(nameof(KnownRequestHeaders))]
public void ValueReuseChangedValuesOverwrite(bool reuseValue, KnownHeader header)
{
const string HeaderValue1 = "Hello1";
const string HeaderValue2 = "Hello2";
var headers = new HttpRequestHeaders(reuseHeaderValues: reuseValue);
for (var i = 0; i < 6; i++)
{
var prevName = ChangeNameCase(header.Name, variant: i);
var nextName = ChangeNameCase(header.Name, variant: i + 1);
var values = GetHeaderValues(headers, prevName, nextName, HeaderValue1, HeaderValue2);
Assert.Equal(HeaderValue1, values.PrevHeaderValue);
Assert.NotSame(HeaderValue1, values.PrevHeaderValue);
Assert.Equal(HeaderValue2, values.NextHeaderValue);
Assert.NotSame(HeaderValue2, values.NextHeaderValue);
Assert.NotEqual(values.PrevHeaderValue, values.NextHeaderValue);
}
}
[Theory]
[MemberData(nameof(KnownRequestHeaders))]
public void ValueReuseMissingValuesClear(bool reuseValue, KnownHeader header)
{
const string HeaderValue1 = "Hello1";
var headers = new HttpRequestHeaders(reuseHeaderValues: reuseValue);
for (var i = 0; i < 6; i++)
{
var prevName = ChangeNameCase(header.Name, variant: i);
var nextName = ChangeNameCase(header.Name, variant: i + 1);
var values = GetHeaderValues(headers, prevName, nextName, HeaderValue1, nextValue: null);
Assert.Equal(HeaderValue1, values.PrevHeaderValue);
Assert.NotSame(HeaderValue1, values.PrevHeaderValue);
Assert.Equal(string.Empty, values.NextHeaderValue);
Assert.NotEqual(values.PrevHeaderValue, values.NextHeaderValue);
}
}
[Theory]
[MemberData(nameof(KnownRequestHeaders))]
public void ValueReuseNeverWhenNotAscii(bool reuseValue, KnownHeader header)
{
const string HeaderValue = "Hello \u03a0";
var headers = new HttpRequestHeaders(reuseHeaderValues: reuseValue);
for (var i = 0; i < 6; i++)
{
var prevName = ChangeNameCase(header.Name, variant: i);
var nextName = ChangeNameCase(header.Name, variant: i + 1);
var values = GetHeaderValues(headers, prevName, nextName, HeaderValue, HeaderValue);
Assert.Equal(HeaderValue, values.PrevHeaderValue);
Assert.NotSame(HeaderValue, values.PrevHeaderValue);
Assert.Equal(HeaderValue, values.NextHeaderValue);
Assert.NotSame(HeaderValue, values.NextHeaderValue);
Assert.Equal(values.PrevHeaderValue, values.NextHeaderValue);
Assert.NotSame(values.PrevHeaderValue, values.NextHeaderValue);
}
}
[Theory]
[MemberData(nameof(KnownRequestHeaders))]
public void ValueReuseLatin1NotConfusedForUtf16AndStillRejected(bool reuseValue, KnownHeader header)
{
var headers = new HttpRequestHeaders(reuseHeaderValues: reuseValue);
var headerValue = new char[127]; // 64 + 32 + 16 + 8 + 4 + 2 + 1
for (var i = 0; i < headerValue.Length; i++)
{
headerValue[i] = 'a';
}
for (var i = 0; i < headerValue.Length; i++)
{
// Set non-ascii Latin char that is valid Utf16 when widened; but not a valid utf8 -> utf16 conversion.
headerValue[i] = '\u00a3';
for (var mode = 0; mode <= 1; mode++)
{
string headerValueUtf16Latin1CrossOver;
if (mode == 0)
{
// Full length
headerValueUtf16Latin1CrossOver = new string(headerValue);
}
else
{
// Truncated length (to ensure different paths from changing lengths in matching)
headerValueUtf16Latin1CrossOver = new string(headerValue.AsSpan().Slice(0, i + 1));
}
headers.Reset();
var headerName = Encoding.ASCII.GetBytes(header.Name).AsSpan();
var prevSpan = Encoding.UTF8.GetBytes(headerValueUtf16Latin1CrossOver).AsSpan();
headers.Append(headerName, prevSpan);
headers.OnHeadersComplete();
var prevHeaderValue = ((IHeaderDictionary)headers)[header.Name].ToString();
Assert.Equal(headerValueUtf16Latin1CrossOver, prevHeaderValue);
Assert.NotSame(headerValueUtf16Latin1CrossOver, prevHeaderValue);
headers.Reset();
Assert.Throws<InvalidOperationException>(() =>
{
var headerName = Encoding.ASCII.GetBytes(header.Name).AsSpan();
var nextSpan = Encoding.GetEncoding("iso-8859-1").GetBytes(headerValueUtf16Latin1CrossOver).AsSpan();
Assert.False(nextSpan.SequenceEqual(Encoding.ASCII.GetBytes(headerValueUtf16Latin1CrossOver)));
headers.Append(headerName, nextSpan);
});
}
// Reset back to Ascii
headerValue[i] = 'a';
}
}
[Fact]
public void ValueReuseNeverWhenUnknownHeader()
{
const string HeaderName = "An-Unknown-Header";
const string HeaderValue = "Hello";
var headers = new HttpRequestHeaders(reuseHeaderValues: true);
for (var i = 0; i < 6; i++)
{
var prevName = ChangeNameCase(HeaderName, variant: i);
var nextName = ChangeNameCase(HeaderName, variant: i + 1);
var values = GetHeaderValues(headers, prevName, nextName, HeaderValue, HeaderValue);
Assert.Equal(HeaderValue, values.PrevHeaderValue);
Assert.NotSame(HeaderValue, values.PrevHeaderValue);
Assert.Equal(HeaderValue, values.NextHeaderValue);
Assert.NotSame(HeaderValue, values.NextHeaderValue);
Assert.Equal(values.PrevHeaderValue, values.NextHeaderValue);
Assert.NotSame(values.PrevHeaderValue, values.NextHeaderValue);
}
}
[Theory]
[MemberData(nameof(KnownRequestHeaders))]
public void ValueReuseEmptyAfterReset(bool reuseValue, KnownHeader header)
{
const string HeaderValue = "Hello";
var headers = new HttpRequestHeaders(reuseHeaderValues: reuseValue);
var headerName = Encoding.ASCII.GetBytes(header.Name).AsSpan();
var prevSpan = Encoding.UTF8.GetBytes(HeaderValue).AsSpan();
headers.Append(headerName, prevSpan);
headers.OnHeadersComplete();
var prevHeaderValue = ((IHeaderDictionary)headers)[header.Name].ToString();
Assert.NotNull(prevHeaderValue);
Assert.NotEqual(string.Empty, prevHeaderValue);
Assert.Equal(HeaderValue, prevHeaderValue);
Assert.NotSame(HeaderValue, prevHeaderValue);
Assert.Single(headers);
var count = headers.Count;
Assert.Equal(1, count);
headers.Reset();
// Empty after reset
var nextHeaderValue = ((IHeaderDictionary)headers)[header.Name].ToString();
Assert.NotNull(nextHeaderValue);
Assert.Equal(string.Empty, nextHeaderValue);
Assert.NotEqual(HeaderValue, nextHeaderValue);
Assert.Empty(headers);
count = headers.Count;
Assert.Equal(0, count);
headers.OnHeadersComplete();
// Still empty after complete
nextHeaderValue = ((IHeaderDictionary)headers)[header.Name].ToString();
Assert.NotNull(nextHeaderValue);
Assert.Equal(string.Empty, nextHeaderValue);
Assert.NotEqual(HeaderValue, nextHeaderValue);
Assert.Empty(headers);
count = headers.Count;
Assert.Equal(0, count);
}
[Theory]
[MemberData(nameof(KnownRequestHeaders))]
public void MultiValueReuseEmptyAfterReset(bool reuseValue, KnownHeader header)
{
const string HeaderValue1 = "Hello1";
const string HeaderValue2 = "Hello2";
var headers = new HttpRequestHeaders(reuseHeaderValues: reuseValue);
var headerName = Encoding.ASCII.GetBytes(header.Name).AsSpan();
var prevSpan1 = Encoding.UTF8.GetBytes(HeaderValue1).AsSpan();
var prevSpan2 = Encoding.UTF8.GetBytes(HeaderValue2).AsSpan();
headers.Append(headerName, prevSpan1);
headers.Append(headerName, prevSpan2);
headers.OnHeadersComplete();
var prevHeaderValue = ((IHeaderDictionary)headers)[header.Name];
Assert.Equal(2, prevHeaderValue.Count);
Assert.NotEqual(string.Empty, prevHeaderValue.ToString());
Assert.Single(headers);
var count = headers.Count;
Assert.Equal(1, count);
headers.Reset();
// Empty after reset
var nextHeaderValue = ((IHeaderDictionary)headers)[header.Name].ToString();
Assert.NotNull(nextHeaderValue);
Assert.Equal(string.Empty, nextHeaderValue);
Assert.Empty(headers);
count = headers.Count;
Assert.Equal(0, count);
headers.OnHeadersComplete();
// Still empty after complete
nextHeaderValue = ((IHeaderDictionary)headers)[header.Name].ToString();
Assert.NotNull(nextHeaderValue);
Assert.Equal(string.Empty, nextHeaderValue);
Assert.Empty(headers);
count = headers.Count;
Assert.Equal(0, count);
}
private static (string PrevHeaderValue, string NextHeaderValue) GetHeaderValues(HttpRequestHeaders headers, string prevName, string nextName, string prevValue, string nextValue)
{
headers.Reset();
var headerName = Encoding.ASCII.GetBytes(prevName).AsSpan();
var prevSpan = Encoding.UTF8.GetBytes(prevValue).AsSpan();
headers.Append(headerName, prevSpan);
headers.OnHeadersComplete();
var prevHeaderValue = ((IHeaderDictionary)headers)[prevName].ToString();
headers.Reset();
if (nextValue != null)
{
headerName = Encoding.ASCII.GetBytes(prevName).AsSpan();
var nextSpan = Encoding.UTF8.GetBytes(nextValue).AsSpan();
headers.Append(headerName, nextSpan);
}
headers.OnHeadersComplete();
var newHeaderValue = ((IHeaderDictionary)headers)[nextName].ToString();
return (prevHeaderValue, newHeaderValue);
}
private static string ChangeNameCase(string name, int variant)
{
switch ((variant / 2) % 3)
{
case 0:
return name;
case 1:
return name.ToLowerInvariant();
case 2:
return name.ToUpperInvariant();
}
// Never reached
Assert.False(true);
return name;
}
// Content-Length is numeric not a string, so we exclude it from the string reuse tests
public static IEnumerable<object[]> KnownRequestHeaders =>
RequestHeaders.Where(h => h.Name != "Content-Length").Select(h => new object[] { true, h }).Concat(
RequestHeaders.Where(h => h.Name != "Content-Length").Select(h => new object[] { false, h }));
}
}

View File

@ -10,6 +10,7 @@
<Compile Include="$(SharedSourceRoot)NullScope.cs" />
<Compile Include="$(SharedSourceRoot)Buffers.Testing\*.cs" />
<Compile Include="$(KestrelSharedSourceRoot)test\*.cs" LinkBase="shared" />
<Compile Include="$(KestrelSharedSourceRoot)KnownHeaders.cs" LinkBase="shared" />
<Content Include="$(KestrelSharedSourceRoot)test\TestCertificates\*.pfx" LinkBase="shared\TestCertificates" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

View File

@ -0,0 +1,536 @@
// 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.Buffers;
using System.IO.Pipelines;
using System.Text;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
using Microsoft.AspNetCore.Server.Kestrel.Transport.Abstractions.Internal;
using Moq;
using Xunit;
namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
{
public class StartLineTests : IDisposable
{
private readonly static IKestrelTrace _trace = Mock.Of<IKestrelTrace>();
private IDuplexPipe Transport { get; }
private MemoryPool<byte> MemoryPool { get; }
private Http1Connection Http1Connection { get; }
private Http1ParsingHandler ParsingHandler {get;}
private IHttpParser<Http1ParsingHandler> Parser { get; }
[Fact]
public void InOriginForm()
{
var rawTarget = "/path%20with%20spaces?q=123&w=xyzw1";
var path = "/path with spaces";
var query = "?q=123&w=xyzw1";
Http1Connection.Reset();
// RawTarget, Path, QueryString are null after reset
Assert.Null(Http1Connection.RawTarget);
Assert.Null(Http1Connection.Path);
Assert.Null(Http1Connection.QueryString);
var ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"POST {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
Assert.NotSame(path, Http1Connection.Path);
Assert.NotSame(query, Http1Connection.QueryString);
}
[Fact]
public void InAuthorityForm()
{
var rawTarget = "example.com:1234";
var path = string.Empty;
var query = string.Empty;
Http1Connection.Reset();
// RawTarget, Path, QueryString are null after reset
Assert.Null(Http1Connection.RawTarget);
Assert.Null(Http1Connection.Path);
Assert.Null(Http1Connection.QueryString);
var ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"CONNECT {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
// Empty strings, so interned and the same.
Assert.Same(path, Http1Connection.Path);
Assert.Same(query, Http1Connection.QueryString);
}
[Fact]
public void InAbsoluteForm()
{
var rawTarget = "http://localhost/path1?q=123&w=xyzw";
var path = "/path1";
var query = "?q=123&w=xyzw";
Http1Connection.Reset();
// RawTarget, Path, QueryString are null after reset
Assert.Null(Http1Connection.RawTarget);
Assert.Null(Http1Connection.Path);
Assert.Null(Http1Connection.QueryString);
var ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"CONNECT {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
Assert.NotSame(path, Http1Connection.Path);
Assert.NotSame(query, Http1Connection.QueryString);
}
[Fact]
public void InAsteriskForm()
{
var rawTarget = "*";
var path = string.Empty;
var query = string.Empty;
Http1Connection.Reset();
// RawTarget, Path, QueryString are null after reset
Assert.Null(Http1Connection.RawTarget);
Assert.Null(Http1Connection.Path);
Assert.Null(Http1Connection.QueryString);
var ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"OPTIONS {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// Asterisk is interned string, so the same.
Assert.Same(rawTarget, Http1Connection.RawTarget);
// Empty strings, so interned and the same.
Assert.Same(path, Http1Connection.Path);
Assert.Same(query, Http1Connection.QueryString);
}
[Fact]
public void DifferentFormsWorkTogether()
{
// InOriginForm
var rawTarget = "/a%20path%20with%20spaces?q=123&w=xyzw12";
var path = "/a path with spaces";
var query = "?q=123&w=xyzw12";
Http1Connection.Reset();
var ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"POST {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
Assert.NotSame(path, Http1Connection.Path);
Assert.NotSame(query, Http1Connection.QueryString);
InAuthorityForm();
InOriginForm();
InAbsoluteForm();
InOriginForm();
InAsteriskForm();
InAuthorityForm();
InAsteriskForm();
InAbsoluteForm();
InAuthorityForm();
InAbsoluteForm();
InAsteriskForm();
InAbsoluteForm();
InAuthorityForm();
}
[Theory]
[InlineData("/abs/path", "/abs/path", "")]
[InlineData("/", "/", "")]
[InlineData("/path", "/path", "")]
[InlineData("/?q=123&w=xyz", "/", "?q=123&w=xyz")]
[InlineData("/path?q=123&w=xyz", "/path", "?q=123&w=xyz")]
[InlineData("/path%20with%20space?q=abc%20123", "/path with space", "?q=abc%20123")]
public void OriginForms(string rawTarget, string path, string query)
{
Http1Connection.Reset();
var ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"GET {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
var prevRequestUrl = Http1Connection.RawTarget;
var prevPath = Http1Connection.Path;
var prevQuery = Http1Connection.QueryString;
// Identical requests keep same materialized string values
for (var i = 0; i < 5; i++)
{
Http1Connection.Reset();
// RawTarget, Path, QueryString are null after reset
Assert.Null(Http1Connection.RawTarget);
Assert.Null(Http1Connection.Path);
Assert.Null(Http1Connection.QueryString);
// Parser decodes % encoding in place, so we need to recreate the ROS
ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"GET {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
Assert.NotSame(path, Http1Connection.Path);
// string.Empty is used for empty strings, so should be the same.
Assert.True(query.Length == 0 || !ReferenceEquals(query, Http1Connection.QueryString));
// However, materalized strings are reused if generated for previous requests.
Assert.Same(prevRequestUrl, Http1Connection.RawTarget);
Assert.Same(prevPath, Http1Connection.Path);
Assert.Same(prevQuery, Http1Connection.QueryString);
prevRequestUrl = Http1Connection.RawTarget;
prevPath = Http1Connection.Path;
prevQuery = Http1Connection.QueryString;
}
// Different OriginForm request changes values
rawTarget = "/path1?q=123&w=xyzw";
path = "/path1";
query = "?q=123&w=xyzw";
Http1Connection.Reset();
ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"GET {rawTarget} HTTP/1.1\r\n"));
Parser.ParseRequestLine(ParsingHandler, ros, out _, out _);
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
Assert.NotSame(path, Http1Connection.Path);
Assert.NotSame(query, Http1Connection.QueryString);
// Not equal previous request.
Assert.NotEqual(prevRequestUrl, Http1Connection.RawTarget);
Assert.NotEqual(prevPath, Http1Connection.Path);
Assert.NotEqual(prevQuery, Http1Connection.QueryString);
DifferentFormsWorkTogether();
}
[Theory]
[InlineData("http://localhost/abs/path", "/abs/path", "")]
[InlineData("https://localhost/abs/path", "/abs/path", "")] // handles mismatch scheme
[InlineData("https://localhost:22/abs/path", "/abs/path", "")] // handles mismatched ports
[InlineData("https://differenthost/abs/path", "/abs/path", "")] // handles mismatched hostname
[InlineData("http://localhost/", "/", "")]
[InlineData("http://root@contoso.com/path", "/path", "")]
[InlineData("http://root:password@contoso.com/path", "/path", "")]
[InlineData("https://localhost/", "/", "")]
[InlineData("http://localhost", "/", "")]
[InlineData("http://127.0.0.1/", "/", "")]
[InlineData("http://[::1]/", "/", "")]
[InlineData("http://[::1]:8080/", "/", "")]
[InlineData("http://localhost?q=123&w=xyz", "/", "?q=123&w=xyz")]
[InlineData("http://localhost/?q=123&w=xyz", "/", "?q=123&w=xyz")]
[InlineData("http://localhost/path?q=123&w=xyz", "/path", "?q=123&w=xyz")]
[InlineData("http://localhost/path%20with%20space?q=abc%20123", "/path with space", "?q=abc%20123")]
public void AbsoluteForms(string rawTarget, string path, string query)
{
Http1Connection.Reset();
var ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"GET {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
var prevRequestUrl = Http1Connection.RawTarget;
var prevPath = Http1Connection.Path;
var prevQuery = Http1Connection.QueryString;
// Identical requests keep same materialized string values
for (var i = 0; i < 5; i++)
{
Http1Connection.Reset();
// RawTarget, Path, QueryString are null after reset
Assert.Null(Http1Connection.RawTarget);
Assert.Null(Http1Connection.Path);
Assert.Null(Http1Connection.QueryString);
ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"GET {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
Assert.NotSame(path, Http1Connection.Path);
// string.Empty is used for empty strings, so should be the same.
Assert.True(query.Length == 0 || !ReferenceEquals(query, Http1Connection.QueryString));
// However, materalized strings are reused if generated for previous requests.
Assert.Same(prevRequestUrl, Http1Connection.RawTarget);
Assert.Same(prevPath, Http1Connection.Path);
Assert.Same(prevQuery, Http1Connection.QueryString);
prevRequestUrl = Http1Connection.RawTarget;
prevPath = Http1Connection.Path;
prevQuery = Http1Connection.QueryString;
}
// Different Absolute Form request changes values
rawTarget = "http://localhost/path1?q=123&w=xyzw";
path = "/path1";
query = "?q=123&w=xyzw";
Http1Connection.Reset();
ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"GET {rawTarget} HTTP/1.1\r\n"));
Parser.ParseRequestLine(ParsingHandler, ros, out _, out _);
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
Assert.NotSame(path, Http1Connection.Path);
Assert.NotSame(query, Http1Connection.QueryString);
// Not equal previous request.
Assert.NotEqual(prevRequestUrl, Http1Connection.RawTarget);
Assert.NotEqual(prevPath, Http1Connection.Path);
Assert.NotEqual(prevQuery, Http1Connection.QueryString);
DifferentFormsWorkTogether();
}
[Fact]
public void AsteriskForms()
{
var rawTarget = "*";
var path = string.Empty;
var query = string.Empty;
Http1Connection.Reset();
var ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"OPTIONS {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
var prevRequestUrl = Http1Connection.RawTarget;
var prevPath = Http1Connection.Path;
var prevQuery = Http1Connection.QueryString;
// Identical requests keep same materialized string values
for (var i = 0; i < 5; i++)
{
Http1Connection.Reset();
// RawTarget, Path, QueryString are null after reset
Assert.Null(Http1Connection.RawTarget);
Assert.Null(Http1Connection.Path);
Assert.Null(Http1Connection.QueryString);
ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"OPTIONS {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// Also same as the inputs (interned strings).
Assert.Same(rawTarget, Http1Connection.RawTarget);
Assert.Same(path, Http1Connection.Path);
Assert.Same(query, Http1Connection.QueryString);
// Materalized strings are reused if generated for previous requests.
Assert.Same(prevRequestUrl, Http1Connection.RawTarget);
Assert.Same(prevPath, Http1Connection.Path);
Assert.Same(prevQuery, Http1Connection.QueryString);
prevRequestUrl = Http1Connection.RawTarget;
prevPath = Http1Connection.Path;
prevQuery = Http1Connection.QueryString;
}
// Different request changes values (can't be Astrisk Form as all the same)
rawTarget = "http://localhost/path1?q=123&w=xyzw";
path = "/path1";
query = "?q=123&w=xyzw";
Http1Connection.Reset();
ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"GET {rawTarget} HTTP/1.1\r\n"));
Parser.ParseRequestLine(ParsingHandler, ros, out _, out _);
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
Assert.NotSame(path, Http1Connection.Path);
Assert.NotSame(query, Http1Connection.QueryString);
// Not equal previous request.
Assert.NotEqual(prevRequestUrl, Http1Connection.RawTarget);
Assert.NotEqual(prevPath, Http1Connection.Path);
Assert.NotEqual(prevQuery, Http1Connection.QueryString);
DifferentFormsWorkTogether();
}
[Theory]
[InlineData("localhost", "", "")]
[InlineData("localhost:22", "", "")] // handles mismatched ports
[InlineData("differenthost", "", "")] // handles mismatched hostname
[InlineData("127.0.0.1", "", "")]
[InlineData("[::1]", "", "")]
[InlineData("[::1]:8080", "", "")]
public void AuthorityForms(string rawTarget, string path, string query)
{
Http1Connection.Reset();
var ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"CONNECT {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
var prevRequestUrl = Http1Connection.RawTarget;
var prevPath = Http1Connection.Path;
var prevQuery = Http1Connection.QueryString;
// Identical requests keep same materialized string values
for (var i = 0; i < 5; i++)
{
Http1Connection.Reset();
// RawTarget, Path, QueryString are null after reset
Assert.Null(Http1Connection.RawTarget);
Assert.Null(Http1Connection.Path);
Assert.Null(Http1Connection.QueryString);
ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"CONNECT {rawTarget} HTTP/1.1\r\n"));
Assert.True(Parser.ParseRequestLine(ParsingHandler, ros, out _, out _));
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// RawTarget not the same as the input.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
// Others same as the inputs, empty strings.
Assert.Same(path, Http1Connection.Path);
Assert.Same(query, Http1Connection.QueryString);
// However, materalized strings are reused if generated for previous requests.
Assert.Same(prevRequestUrl, Http1Connection.RawTarget);
Assert.Same(prevPath, Http1Connection.Path);
Assert.Same(prevQuery, Http1Connection.QueryString);
prevRequestUrl = Http1Connection.RawTarget;
prevPath = Http1Connection.Path;
prevQuery = Http1Connection.QueryString;
}
// Different Authority Form request changes values
rawTarget = "example.org:2345";
path = "";
query = "";
Http1Connection.Reset();
ros = new ReadOnlySequence<byte>(Encoding.ASCII.GetBytes($"CONNECT {rawTarget} HTTP/1.1\r\n"));
Parser.ParseRequestLine(ParsingHandler, ros, out _, out _);
// Equal the inputs.
Assert.Equal(rawTarget, Http1Connection.RawTarget);
Assert.Equal(path, Http1Connection.Path);
Assert.Equal(query, Http1Connection.QueryString);
// But not the same as the inputs.
Assert.NotSame(rawTarget, Http1Connection.RawTarget);
// Empty interned strings
Assert.Same(path, Http1Connection.Path);
Assert.Same(query, Http1Connection.QueryString);
// Not equal previous request.
Assert.NotEqual(prevRequestUrl, Http1Connection.RawTarget);
DifferentFormsWorkTogether();
}
public StartLineTests()
{
MemoryPool = KestrelMemoryPool.Create();
var options = new PipeOptions(MemoryPool, readerScheduler: PipeScheduler.Inline, writerScheduler: PipeScheduler.Inline, useSynchronizationContext: false);
var pair = DuplexPipe.CreateConnectionPair(options, options);
Transport = pair.Transport;
var serviceContext = new ServiceContext
{
ServerOptions = new KestrelServerOptions(),
Log = _trace,
HttpParser = new HttpParser<Http1ParsingHandler>()
};
Http1Connection = new Http1Connection(context: new HttpConnectionContext
{
ServiceContext = serviceContext,
ConnectionFeatures = new FeatureCollection(),
MemoryPool = MemoryPool,
Transport = Transport,
TimeoutControl = new TimeoutControl(timeoutHandler: null)
});
Parser = new HttpParser<Http1ParsingHandler>(showErrorDetails: true);
ParsingHandler = new Http1ParsingHandler(Http1Connection);
}
public void Dispose()
{
Transport.Input.Complete();
Transport.Output.Complete();
MemoryPool.Dispose();
}
}
}

View File

@ -107,6 +107,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance
public void OnHeader(Span<byte> name, Span<byte> value)
=> RequestHandler.Connection.OnHeader(name, value);
public void OnHeadersComplete()
=> RequestHandler.Connection.OnHeadersComplete();
public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
=> RequestHandler.Connection.OnStartLine(method, version, target, path, query, customMethod, pathEncoded);
}

View File

@ -72,6 +72,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance
{
}
public void OnHeadersComplete()
{
}
private struct Adapter : IHttpRequestLineHandler, IHttpHeadersHandler
{
public HttpParserBenchmark RequestHandler;
@ -84,6 +88,9 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance
public void OnHeader(Span<byte> name, Span<byte> value)
=> RequestHandler.OnHeader(name, value);
public void OnHeadersComplete()
=> RequestHandler.OnHeadersComplete();
public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
=> RequestHandler.OnStartLine(method, version, target, path, query, customMethod, pathEncoded);
}

View File

@ -26,6 +26,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Performance
handler.OnHeader(new Span<byte>(_hostHeaderName), new Span<byte>(_hostHeaderValue));
handler.OnHeader(new Span<byte>(_acceptHeaderName), new Span<byte>(_acceptHeaderValue));
handler.OnHeader(new Span<byte>(_connectionHeaderName), new Span<byte>(_connectionHeaderValue));
handler.OnHeadersComplete();
consumedBytes = 0;
consumed = buffer.Start;

View File

@ -125,6 +125,12 @@ namespace PlatformBenchmarks
{
}
#if NETCOREAPP3_0
public void OnHeadersComplete()
{
}
#endif
public async ValueTask OnReadCompletedAsync()
{
await Writer.FlushAsync();
@ -175,6 +181,11 @@ namespace PlatformBenchmarks
public void OnStartLine(HttpMethod method, HttpVersion version, Span<byte> target, Span<byte> path, Span<byte> query, Span<byte> customMethod, bool pathEncoded)
=> RequestHandler.OnStartLine(method, version, target, path, query, customMethod, pathEncoded);
#if NETCOREAPP3_0
public void OnHeadersComplete()
=> RequestHandler.OnHeadersComplete();
#endif
}
}

View File

@ -11,114 +11,11 @@ namespace CodeGenerator
{
public class KnownHeaders
{
static string Each<T>(IEnumerable<T> values, Func<T, string> formatter)
{
return values.Any() ? values.Select(formatter).Aggregate((a, b) => a + b) : "";
}
public readonly static KnownHeader[] RequestHeaders;
public readonly static KnownHeader[] ResponseHeaders;
public readonly static KnownHeader[] ResponseTrailers;
static string AppendSwitch(IEnumerable<IGrouping<int, KnownHeader>> values, string className) =>
$@"var pUL = (ulong*)pUB;
var pUI = (uint*)pUB;
var pUS = (ushort*)pUB;
var stringValue = new StringValues(value);
switch (keyLength)
{{{Each(values, byLength => $@"
case {byLength.Key}:
{{{Each(byLength, header => $@"
if ({header.EqualIgnoreCaseBytes()})
{{{(header.Identifier == "ContentLength" ? $@"
if (_contentLength.HasValue)
{{
BadHttpRequestException.Throw(RequestRejectionReason.MultipleContentLengths);
}}
else
{{
_contentLength = ParseContentLength(value);
}}
return;" : $@"
if ({header.TestBit()})
{{
_headers._{header.Identifier} = AppendValue(_headers._{header.Identifier}, value);
}}
else
{{
{header.SetBit()};
_headers._{header.Identifier} = stringValue;{(header.EnhancedSetter == false ? "" : $@"
_headers._raw{header.Identifier} = null;")}
}}
return;")}
}}
")}}}
break;
")}}}";
class KnownHeader
{
public string Name { get; set; }
public int Index { get; set; }
public string Identifier => Name.Replace("-", "");
public byte[] Bytes => Encoding.ASCII.GetBytes($"\r\n{Name}: ");
public int BytesOffset { get; set; }
public int BytesCount { get; set; }
public bool ExistenceCheck { get; set; }
public bool FastCount { get; set; }
public bool EnhancedSetter { get; set; }
public bool PrimaryHeader { get; set; }
public string TestBit() => $"(_bits & {"0x" + (1L << Index).ToString("x")}L) != 0";
public string TestTempBit() => $"(tempBits & {"0x" + (1L << Index).ToString("x")}L) != 0";
public string TestNotTempBit() => $"(tempBits & ~{"0x" + (1L << Index).ToString("x")}L) == 0";
public string TestNotBit() => $"(_bits & {"0x" + (1L << Index).ToString("x")}L) == 0";
public string SetBit() => $"_bits |= {"0x" + (1L << Index).ToString("x")}L";
public string ClearBit() => $"_bits &= ~{"0x" + (1L << Index).ToString("x")}L";
public string EqualIgnoreCaseBytes()
{
var result = "";
var delim = "";
var index = 0;
while (index != Name.Length)
{
if (Name.Length - index >= 8)
{
result += delim + Term(Name, index, 8, "pUL", "uL");
index += 8;
}
else if (Name.Length - index >= 4)
{
result += delim + Term(Name, index, 4, "pUI", "u");
index += 4;
}
else if (Name.Length - index >= 2)
{
result += delim + Term(Name, index, 2, "pUS", "u");
index += 2;
}
else
{
result += delim + Term(Name, index, 1, "pUB", "u");
index += 1;
}
delim = " && ";
}
return $"({result})";
}
protected string Term(string name, int offset, int count, string array, string suffix)
{
ulong mask = 0;
ulong comp = 0;
for (var scan = 0; scan < count; scan++)
{
var ch = (byte)name[offset + count - scan - 1];
var isAlpha = (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
comp = (comp << 8) + (ch & (isAlpha ? 0xdfu : 0xffu));
mask = (mask << 8) + (isAlpha ? 0xdfu : 0xffu);
}
return $"(({array}[{offset / count}] & {mask}{suffix}) == {comp}{suffix})";
}
}
public static string GeneratedFile()
static KnownHeaders()
{
var requestPrimaryHeaders = new[]
{
@ -173,7 +70,7 @@ namespace CodeGenerator
{
"Host"
};
var requestHeaders = commonHeaders.Concat(new[]
RequestHeaders = commonHeaders.Concat(new[]
{
"Accept",
"Accept-Charset",
@ -196,6 +93,8 @@ namespace CodeGenerator
"TE",
"Translate",
"User-Agent",
"DNT",
"Upgrade-Insecure-Requests"
})
.Concat(corsRequestHeaders)
.Select((header, index) => new KnownHeader
@ -213,8 +112,6 @@ namespace CodeGenerator
PrimaryHeader = requestPrimaryHeaders.Contains("Content-Length")
}})
.ToArray();
Debug.Assert(requestHeaders.Length <= 64);
Debug.Assert(requestHeaders.Max(x => x.Index) <= 62);
var responseHeadersExistence = new[]
{
@ -240,7 +137,7 @@ namespace CodeGenerator
"Access-Control-Expose-Headers",
"Access-Control-Max-Age",
};
var responseHeaders = commonHeaders.Concat(new[]
ResponseHeaders = commonHeaders.Concat(new[]
{
"Accept-Ranges",
"Age",
@ -271,7 +168,7 @@ namespace CodeGenerator
}})
.ToArray();
var responseTrailers = new[]
ResponseTrailers = new[]
{
"ETag",
}
@ -284,11 +181,359 @@ namespace CodeGenerator
PrimaryHeader = responsePrimaryHeaders.Contains(header)
})
.ToArray();
}
static string Each<T>(IEnumerable<T> values, Func<T, string> formatter)
{
return values.Any() ? values.Select(formatter).Aggregate((a, b) => a + b) : "";
}
static string Each<T>(IEnumerable<T> values, Func<T, int, string> formatter)
{
return values.Any() ? values.Select(formatter).Aggregate((a, b) => a + b) : "";
}
static string AppendSwitch(IEnumerable<IGrouping<int, KnownHeader>> values) =>
$@"switch (name.Length)
{{{Each(values, byLength => $@"
case {byLength.Key}:{AppendSwitchSection(byLength.Key, byLength.OrderBy(h => (h.PrimaryHeader ? "_" : "") + h.Name))}
break;")}
}}";
static string AppendSwitchSection(int length, IOrderedEnumerable<KnownHeader> values)
{
var useVarForFirstTerm = values.Count() > 1 && values.Select(h => h.FirstNameIgnoreCaseSegment()).Distinct().Count() == 1;
var firstTermVarExpression = values.Select(h => h.FirstNameIgnoreCaseSegment()).FirstOrDefault();
var firstTermVar = $"firstTerm{length}";
var start = "";
if (useVarForFirstTerm)
{
start = $@"
var {firstTermVar} = {firstTermVarExpression};";
}
else
{
firstTermVar = "";
}
var groups = values.GroupBy(header => header.EqualIgnoreCaseBytesFirstTerm());
return start + $@"{Each(groups, (byFirstTerm, i) => $@"{(byFirstTerm.Count() == 1 ? $@"{Each(byFirstTerm, header => $@"
{(i > 0 ? "else " : "")}if ({header.EqualIgnoreCaseBytes(firstTermVar)})
{{{(header.Identifier == "ContentLength" ? $@"
AppendContentLength(value);
return;" : $@"
flag = {header.FlagBit()};
values = ref _headers._{header.Identifier};")}
}}")}" : $@"
if ({byFirstTerm.Key.Replace(firstTermVarExpression, firstTermVar)})
{{{Each(byFirstTerm, (header, i) => $@"
{(i > 0 ? "else " : "")}if ({header.EqualIgnoreCaseBytesSecondTermOnwards()})
{{{(header.Identifier == "ContentLength" ? $@"
AppendContentLength(value);
return;" : $@"
flag = {header.FlagBit()};
values = ref _headers._{header.Identifier};")}
}}")}
}}")}")}";
}
public class KnownHeader
{
public string Name { get; set; }
public int Index { get; set; }
public string Identifier => Name.Replace("-", "");
public byte[] Bytes => Encoding.ASCII.GetBytes($"\r\n{Name}: ");
public int BytesOffset { get; set; }
public int BytesCount { get; set; }
public bool ExistenceCheck { get; set; }
public bool FastCount { get; set; }
public bool EnhancedSetter { get; set; }
public bool PrimaryHeader { get; set; }
public string FlagBit() => $"{"0x" + (1L << Index).ToString("x")}L";
public string TestBit() => $"(_bits & {"0x" + (1L << Index).ToString("x")}L) != 0";
public string TestTempBit() => $"(tempBits & {"0x" + (1L << Index).ToString("x")}L) != 0";
public string TestNotTempBit() => $"(tempBits & ~{"0x" + (1L << Index).ToString("x")}L) == 0";
public string TestNotBit() => $"(_bits & {"0x" + (1L << Index).ToString("x")}L) == 0";
public string SetBit() => $"_bits |= {"0x" + (1L << Index).ToString("x")}L";
public string ClearBit() => $"_bits &= ~{"0x" + (1L << Index).ToString("x")}L";
private void GetMaskAndComp(string name, int offset, int count, out ulong mask, out ulong comp)
{
mask = 0;
comp = 0;
for (var scan = 0; scan < count; scan++)
{
var ch = (byte)name[offset + count - scan - 1];
var isAlpha = (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z');
comp = (comp << 8) + (ch & (isAlpha ? 0xdfu : 0xffu));
mask = (mask << 8) + (isAlpha ? 0xdfu : 0xffu);
}
}
private string NameTerm(string name, int offset, int count, string type, string suffix)
{
GetMaskAndComp(name, offset, count, out var mask, out var comp);
if (offset == 0)
{
if (type == "byte")
{
return $"(nameStart & 0x{mask:x}{suffix})";
}
else
{
return $"(Unsafe.ReadUnaligned<{type}>(ref nameStart) & 0x{mask:x}{suffix})";
}
}
else
{
if (type == "byte")
{
return $"(Unsafe.AddByteOffset(ref nameStart, (IntPtr){offset / count}) & 0x{mask:x}{suffix})";
}
else if ((offset / count) == 1)
{
return $"(Unsafe.ReadUnaligned<{type}>(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)sizeof({type}))) & 0x{mask:x}{suffix})";
}
else
{
return $"(Unsafe.ReadUnaligned<{type}>(ref Unsafe.AddByteOffset(ref nameStart, (IntPtr)({offset / count} * sizeof({type})))) & 0x{mask:x}{suffix})";
}
}
}
private string EqualityTerm(string name, int offset, int count, string type, string suffix)
{
GetMaskAndComp(name, offset, count, out var mask, out var comp);
return $"0x{comp:x}{suffix}";
}
private string Term(string name, int offset, int count, string type, string suffix)
{
GetMaskAndComp(name, offset, count, out var mask, out var comp);
return $"({NameTerm(name, offset, count, type, suffix)} == {EqualityTerm(name, offset, count, type, suffix)})";
}
public string FirstNameIgnoreCaseSegment()
{
var result = "";
if (Name.Length >= 8)
{
result = NameTerm(Name, 0, 8, "ulong", "uL");
}
else if (Name.Length >= 4)
{
result = NameTerm(Name, 0, 4, "uint", "u");
}
else if (Name.Length >= 2)
{
result = NameTerm(Name, 0, 2, "ushort", "u");
}
else
{
result = NameTerm(Name, 0, 1, "byte", "u");
}
return result;
}
public string EqualIgnoreCaseBytes(string firstTermVar = "")
{
if (!string.IsNullOrEmpty(firstTermVar))
{
return EqualIgnoreCaseBytesWithVar(firstTermVar);
}
var result = "";
var delim = "";
var index = 0;
while (index != Name.Length)
{
if (Name.Length - index >= 8)
{
result += delim + Term(Name, index, 8, "ulong", "uL");
index += 8;
}
else if (Name.Length - index >= 4)
{
result += delim + Term(Name, index, 4, "uint", "u");
index += 4;
}
else if (Name.Length - index >= 2)
{
result += delim + Term(Name, index, 2, "ushort", "u");
index += 2;
}
else
{
result += delim + Term(Name, index, 1, "byte", "u");
index += 1;
}
delim = " && ";
}
return result;
string EqualIgnoreCaseBytesWithVar(string firstTermVar)
{
var result = "";
var delim = " && ";
var index = 0;
var isFirst = true;
while (index != Name.Length)
{
if (Name.Length - index >= 8)
{
if (isFirst)
{
result = $"({firstTermVar} == {EqualityTerm(Name, index, 8, "ulong", "uL")})";
}
else
{
result += delim + Term(Name, index, 8, "ulong", "uL");
}
index += 8;
}
else if (Name.Length - index >= 4)
{
if (isFirst)
{
result = $"({firstTermVar} == {EqualityTerm(Name, index, 4, "uint", "u")})";
}
else
{
result += delim + Term(Name, index, 4, "uint", "u");
}
index += 4;
}
else if (Name.Length - index >= 2)
{
if (isFirst)
{
result = $"({firstTermVar} == {EqualityTerm(Name, index, 2, "ushort", "u")})";
}
else
{
result += delim + Term(Name, index, 2, "ushort", "u");
}
index += 2;
}
else
{
if (isFirst)
{
result = $"({firstTermVar} == {EqualityTerm(Name, index, 1, "byte", "u")})";
}
else
{
result += delim + Term(Name, index, 1, "byte", "u");
}
index += 1;
}
isFirst = false;
}
return result;
}
}
public string EqualIgnoreCaseBytesFirstTerm()
{
var result = "";
if (Name.Length >= 8)
{
result = Term(Name, 0, 8, "ulong", "uL");
}
else if (Name.Length >= 4)
{
result = Term(Name, 0, 4, "uint", "u");
}
else if (Name.Length >= 2)
{
result = Term(Name, 0, 2, "ushort", "u");
}
else
{
result = Term(Name, 0, 1, "byte", "u");
}
return result;
}
public string EqualIgnoreCaseBytesSecondTermOnwards()
{
var result = "";
var delim = "";
var index = 0;
var isFirst = true;
while (index != Name.Length)
{
if (Name.Length - index >= 8)
{
if (!isFirst)
{
result += delim + Term(Name, index, 8, "ulong", "uL");
}
index += 8;
}
else if (Name.Length - index >= 4)
{
if (!isFirst)
{
result += delim + Term(Name, index, 4, "uint", "u");
}
index += 4;
}
else if (Name.Length - index >= 2)
{
if (!isFirst)
{
result += delim + Term(Name, index, 2, "ushort", "u");
}
index += 2;
}
else
{
if (!isFirst)
{
result += delim + Term(Name, index, 1, "byte", "u");
}
index += 1;
}
if (isFirst)
{
isFirst = false;
}
else
{
delim = " && ";
}
}
return result;
}
}
public static string GeneratedFile()
{
var requestHeaders = RequestHeaders;
Debug.Assert(requestHeaders.Length <= 64);
Debug.Assert(requestHeaders.Max(x => x.Index) <= 62);
// 63 for responseHeaders as it steals one bit for Content-Length in CopyTo(ref MemoryPoolIterator output)
var responseHeaders = ResponseHeaders;
Debug.Assert(responseHeaders.Length <= 63);
Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
var responseTrailers = ResponseTrailers;
var loops = new[]
{
new
@ -331,8 +576,10 @@ using System.Collections.Generic;
using System.Buffers;
using System.IO.Pipelines;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Microsoft.Extensions.Primitives;
using Microsoft.Net.Http.Headers;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{{
@ -345,8 +592,6 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
{Each(loop.Bytes, b => $"{b},")}
}};"
: "")}
private long _bits = 0;
private HeaderReferences _headers;
{Each(loop.Headers.Where(header => header.ExistenceCheck), header => $@"
public bool Has{header.Identifier} => {header.TestBit()};")}
@ -510,8 +755,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
return MaybeUnknown?.Remove(key) ?? false;
}}
protected override void ClearFast()
{(loop.ClassName != "HttpRequestHeaders" ?
$@" protected override void ClearFast()
{{
MaybeUnknown?.Clear();
_contentLength = null;
@ -534,7 +779,23 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}}
")}
}}
" :
$@" private void Clear(long bitsToClear)
{{
var tempBits = bitsToClear;
{Each(loop.Headers.Where(header => header.Identifier != "ContentLength").OrderBy(h => !h.PrimaryHeader), header => $@"
if ({header.TestTempBit()})
{{
_headers._{header.Identifier} = default(StringValues);
if({header.TestNotTempBit()})
{{
return;
}}
tempBits &= ~{"0x" + (1L << header.Index).ToString("x")}L;
}}
")}
}}
")}
protected override bool CopyToFast(KeyValuePair<string, StringValues>[] array, int arrayIndex)
{{
if (arrayIndex < 0)
@ -625,22 +886,63 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http
}}
}}
}} while (tempBits != 0);
}}" : "")}
{(loop.ClassName == "HttpRequestHeaders" ? $@"
public unsafe void Append(byte* pKeyBytes, int keyLength, string value)
}}" : "")}{(loop.ClassName == "HttpRequestHeaders" ? $@"
[MethodImpl(MethodImplOptions.AggressiveOptimization)]
public unsafe void Append(Span<byte> name, Span<byte> value)
{{
var pUB = pKeyBytes;
{AppendSwitch(loop.Headers.Where(h => h.PrimaryHeader).GroupBy(x => x.Name.Length), loop.ClassName)}
ref byte nameStart = ref MemoryMarshal.GetReference(name);
ref StringValues values = ref Unsafe.AsRef<StringValues>(null);
var flag = 0L;
AppendNonPrimaryHeaders(pKeyBytes, keyLength, value);
}}
// Does the name matched any ""known"" headers
{AppendSwitch(loop.Headers.GroupBy(x => x.Name.Length).OrderBy(x => x.Key))}
private unsafe void AppendNonPrimaryHeaders(byte* pKeyBytes, int keyLength, string value)
{{
var pUB = pKeyBytes;
{AppendSwitch(loop.Headers.Where(h => !h.PrimaryHeader).GroupBy(x => x.Name.Length), loop.ClassName)}
if (flag != 0)
{{
// Matched a known header
if ((_previousBits & flag) != 0)
{{
// Had a previous string for this header, mark it as used so we don't clear it OnHeadersComplete or consider it if we get a second header
_previousBits ^= flag;
AppendUnknownHeaders(pKeyBytes, keyLength, value);
// We will only reuse this header if there was only one previous header
if (values.Count == 1)
{{
var previousValue = values.ToString();
// Check lengths are the same, then if the bytes were converted to an ascii string if they would be the same.
// We do not consider Utf8 headers for reuse.
if (previousValue.Length == value.Length &&
StringUtilities.BytesOrdinalEqualsStringAndAscii(previousValue, value))
{{
// The previous string matches what the bytes would convert to, so we will just use that one.
_bits |= flag;
return;
}}
}}
}}
// We didn't have a previous matching header value, or have already added a header, so get the string for this value.
var valueStr = value.GetAsciiOrUTF8StringNonNullCharacters();
if ((_bits & flag) == 0)
{{
// We didn't already have a header set, so add a new one.
_bits |= flag;
values = new StringValues(valueStr);
}}
else
{{
// We already had a header set, so concatenate the new one.
values = AppendValue(values, valueStr);
}}
}}
else
{{
// The header was not one of the ""known"" headers.
// Convert value to string first, because passing two spans causes 8 bytes stack zeroing in
// this method with rep stosd, which is slower than necessary.
var valueStr = value.GetAsciiOrUTF8StringNonNullCharacters();
AppendUnknownHeaders(name, valueStr);
}}
}}" : "")}
private struct HeaderReferences

View File

@ -154,6 +154,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
}
[ConditionalTheory]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2179", FlakyOn.Helix.All)]
[MemberData(nameof(AddressRegistrationDataIPv6ScopeId))]
[IPv6SupportedCondition]
[IPv6ScopeIdPresentCondition]
@ -589,6 +590,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
}
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2178", FlakyOn.All)]
public async Task DoesNotOverrideDirectConfigurationWithIServerAddressesFeature_IfPreferHostingUrlsFalse()
{
var useUrlsAddress = $"http://127.0.0.1:0";

View File

@ -108,16 +108,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
};
}
}
private bool LargeUploadRetryPredicate(Exception e)
=> e is IOException && e.Message.Contains("Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request");
[Theory]
[Flaky("https://github.com/aspnet/AspNetCore/issues/8054", FlakyOn.AzP.Windows)]
[RetryTest(nameof(LargeUploadRetryPredicate),
"Active investigation into potential corefx sockets bug: https://github.com/dotnet/corefx/issues/30691",
OperatingSystems.Windows,
5)]
[MemberData(nameof(LargeUploadData))]
public async Task LargeUpload(long? maxRequestBufferSize, bool connectionAdapter, bool expectPause)
{

View File

@ -542,6 +542,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
}
[Theory]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2181", FlakyOn.Helix.All)]
[MemberData(nameof(ConnectionAdapterData))]
public async Task ConnectionClosedTokenFiresOnServerFIN(ListenOptions listenOptions)
{

View File

@ -810,10 +810,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.FunctionalTests
=> e is IOException && e.Message.Contains("Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request");
[Fact]
[RetryTest(nameof(ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseHeadersRetryPredicate),
"Active investigation into potential corefx sockets bug: https://github.com/dotnet/corefx/issues/30691",
OperatingSystems.Windows,
5)]
[Flaky("https://github.com/dotnet/corefx/issues/30691", FlakyOn.AzP.Windows)]
public async Task ConnectionNotClosedWhenClientSatisfiesMinimumDataRateGivenLargeResponseHeaders()
{
var headerSize = 1024 * 1024; // 1 MB for each header value

View File

@ -146,6 +146,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
var serviceContext = new TestServiceContext(LoggerFactory);
TestApplicationErrorLogger.ThrowOnUngracefulShutdown = false;
var stopTask = Task.CompletedTask;
await using (var server = new TestServer(requestDelegate, serviceContext, listenOptions))
using (var shutdownCts = new CancellationTokenSource(TestConstants.DefaultTimeout))

View File

@ -406,6 +406,8 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
_decodedHeaders[name.GetAsciiStringNonNullCharacters()] = value.GetAsciiOrUTF8StringNonNullCharacters();
}
void IHttpHeadersHandler.OnHeadersComplete() { }
protected void CreateConnection()
{
var limits = _serviceContext.ServerOptions.Limits;

View File

@ -492,7 +492,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.Core.Tests
_mockConnectionContext.VerifyNoOtherCalls();
}
[Fact]
[Fact(Skip = "https://github.com/aspnet/AspNetCore-Internal/issues/2197")]
public async Task DATA_Sent_TooSlowlyDueToOutputFlowControlOnMultipleStreams_AbortsConnectionAfterAdditiveRateTimeout()
{
var mockSystemClock = _serviceContext.MockSystemClock;

View File

@ -484,7 +484,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
}
}
[Theory]
[ConditionalTheory]
[SkipOnHelix]
[InlineData(ClientCertificateMode.AllowCertificate)]
[InlineData(ClientCertificateMode.RequireCertificate)]

View File

@ -217,6 +217,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
}
[Fact]
[Repeat(20)]
public async Task DoesNotThrowObjectDisposedExceptionFromWriteAsyncAfterConnectionIsAborted()
{
var tcs = new TaskCompletionSource<object>(TaskCreationOptions.RunContinuationsAsynchronously);

View File

@ -6,6 +6,7 @@ using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests.TestTransport;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.Extensions.Logging.Testing;
using Xunit;
@ -14,6 +15,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
public class LoggingConnectionAdapterTests : LoggedTest
{
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/1753", FlakyOn.Helix.All)]
public async Task LoggingConnectionAdapterCanBeAddedBeforeAndAfterHttpsAdapter()
{
await using (var server = new TestServer(context =>

View File

@ -17,6 +17,7 @@ using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http;
using Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Infrastructure;
using Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests.TestTransport;
using Microsoft.AspNetCore.Testing;
using Microsoft.AspNetCore.Testing.xunit;
using Microsoft.Extensions.Logging.Testing;
using Xunit;
@ -781,6 +782,7 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
}
[Fact]
[Flaky("https://github.com/aspnet/AspNetCore-Internal/issues/2176", FlakyOn.All)]
public async Task ContentLengthReadAsyncSingleBytesAtATime()
{
var testContext = new TestServiceContext(LoggerFactory);
@ -811,10 +813,10 @@ namespace Microsoft.AspNetCore.Server.Kestrel.InMemory.FunctionalTests
"Content-Length: 5",
"",
"fun");
await tcs.Task;
await tcs.Task.DefaultTimeout();
await connection.Send(
"n");
await tcs2.Task;
await tcs2.Task.DefaultTimeout();
await connection.Send(
"y");
await connection.ReceiveEnd(

View File

@ -7,6 +7,10 @@
<IsTestAssetProject>true</IsTestAssetProject>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(KestrelSharedSourceRoot)KnownHeaders.cs" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.AspNetCore.Hosting" />
<Reference Include="Microsoft.AspNetCore.Http.Features" />

Some files were not shown because too many files have changed in this diff Show More