diff --git a/build/buildorder.props b/build/buildorder.props
index 2338a88d73..937df0f56a 100644
--- a/build/buildorder.props
+++ b/build/buildorder.props
@@ -11,7 +11,6 @@
-
diff --git a/build/dependencies.props b/build/dependencies.props
index 6b0d8fcf9b..6f676dc4b9 100644
--- a/build/dependencies.props
+++ b/build/dependencies.props
@@ -36,14 +36,12 @@
2.2.0
2.2.0
2.2.0
- 2.2.0
2.2.0
2.2.0
2.2.0
2.2.0
2.2.0
2.2.0
- 2.2.0
2.2.0
2.2.0
2.2.0
@@ -57,7 +55,6 @@
2.2.0
2.2.0
2.2.0
- 2.2.0
2.2.0
2.2.0
2.2.0
@@ -85,23 +82,15 @@
2.2.0
2.2.0
2.2.0
- 2.2.0
2.2.0
2.2.0
2.2.0
2.2.0
2.2.0
2.2.0
- 2.2.0
- 2.2.0
- 2.2.0
- 2.2.0
- 2.2.0
- 2.2.0
2.2.0
2.2.0
2.2.0
- 2.2.0
2.2.0
diff --git a/build/external-dependencies.props b/build/external-dependencies.props
index 04c60ff7a3..37b2379b42 100644
--- a/build/external-dependencies.props
+++ b/build/external-dependencies.props
@@ -13,15 +13,12 @@
-
-
-
@@ -35,7 +32,6 @@
-
@@ -63,22 +59,14 @@
-
-
-
-
-
-
-
-
diff --git a/build/repo.props b/build/repo.props
index e96da8c9f4..887da3ee09 100644
--- a/build/repo.props
+++ b/build/repo.props
@@ -78,6 +78,7 @@
$(MSBuildThisFileDirectory)..\eng\ProjectReferences.props
+
@(_ProjectReferenceProvider->'', '%0A ')
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000000..98fe46e403
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,5 @@
+Contributor documentation
+=========================
+
+The primary audience for documentation in this folder is contributors to ASP.NET Core.
+If you are looking for documentation on to *use* ASP.NET Core, go to .
diff --git a/docs/ReferenceResolution.md b/docs/ReferenceResolution.md
new file mode 100644
index 0000000000..e0c3dbf6f4
--- /dev/null
+++ b/docs/ReferenceResolution.md
@@ -0,0 +1,34 @@
+`` resolution
+========================
+
+Most project files in this repo should use `` instead of `` or ``.
+This was done to enable ASP.NET Core's unique requirements without requiring most ASP.NET Core contributors
+to understand the complex rules for how versions and references should work. The build system will resolve
+Reference items to the correct type and version of references based on our servicing and update rules.
+
+See [ResolveReferences.targets](/eng/targets/ResolveReferences.targets) for the exact implementation of custom
+`` resolutions.
+
+The requirements that led to this system are:
+
+* Versions of external dependencies should be consistent.
+* Servicing updates of ASP.NET Core should minimize the number of assemblies which need to re-build and re-ship.
+* Newer versions of packages should not have lower dependency versions than previous releases.
+* Minimize the cascading effect of servicing updates where possible by keeping a consistent baseline of dependencies.
+
+## Recommendations for writing a .csproj
+
+* Use ``
+* Do not use ``
+* Only use `` in test projects
+* Name the .csproj file to match the assembly name.
+* Run `build.cmd /t:GenerateProjectList` when adding new projects
+* Use [eng/tools/BaseLineGenerator/](/eng/tools/BaselineGenerator/README.md) if you need to update baselines.
+
+## Important files
+
+* [eng/Baseline.xml](/eng/Baseline.xml) - this contains the 'baseline' of the latest servicing release for this branch. It should be modified and used to update the generated file, Baseline.Designer.props.
+* [eng/Dependencies.props](/eng/Dependencies.props) - contains a list of all package references that might be used in the repo.
+* [eng/PatchConfig.props](/eng/PatchConfig.props) - lists which assemblies or packages are patching in the current build.
+* [eng/ProjectReferences.props](/eng/ProjectReferences.props) - lists which assemblies or packages might be available to be referenced as a local project
+* [eng/Versions.props](/eng/Versions.props) - contains a list of versions which may be updated by automation.
diff --git a/eng/Baseline.Designer.props b/eng/Baseline.Designer.props
index 1a501d89e7..e8fc6321d9 100644
--- a/eng/Baseline.Designer.props
+++ b/eng/Baseline.Designer.props
@@ -20,14 +20,6 @@
2.2.0
-
-
- 2.2.0
-
-
-
- 2.2.0
-
2.2.0
@@ -39,6 +31,14 @@
+
+
+ 2.2.0
+
+
+
+ 2.2.0
+
2.2.0
@@ -445,6 +445,17 @@
+
+
+ 2.2.0
+
+
+
+
+
+
+
+
2.2.0
@@ -464,17 +475,6 @@
-
-
- 2.2.0
-
-
-
-
-
-
-
-
2.2.0
@@ -611,6 +611,30 @@
+
+
+ 2.2.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
2.2.0
diff --git a/eng/Baseline.xml b/eng/Baseline.xml
index cce6ce895c..78c6bb7e7e 100644
--- a/eng/Baseline.xml
+++ b/eng/Baseline.xml
@@ -1,11 +1,17 @@
+
+
-
@@ -48,8 +54,8 @@
-
+
@@ -61,6 +67,7 @@
+
diff --git a/eng/Dependencies.props b/eng/Dependencies.props
index 789d0e20f3..086e54069a 100644
--- a/eng/Dependencies.props
+++ b/eng/Dependencies.props
@@ -1,14 +1,27 @@
-
+
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+
+
+
+
+
+
+
+
-
-
@@ -19,14 +32,12 @@
-
-
@@ -41,12 +52,7 @@
-
-
-
-
-
@@ -60,6 +66,7 @@
+
@@ -69,6 +76,7 @@
+
@@ -89,13 +97,4 @@
-
-
-
-
-
-
-
-
-
diff --git a/eng/PatchConfig.props b/eng/PatchConfig.props
index 62e4561ae5..b804cb9c45 100644
--- a/eng/PatchConfig.props
+++ b/eng/PatchConfig.props
@@ -1,3 +1,13 @@
+
$(MSBuildAllProjects);$(MSBuildThisFileFullPath)
diff --git a/eng/ProjectReferences.props b/eng/ProjectReferences.props
index 230f8a5417..f244f4666e 100644
--- a/eng/ProjectReferences.props
+++ b/eng/ProjectReferences.props
@@ -1,7 +1,11 @@
-
+
-
+
@@ -13,6 +17,7 @@
+
@@ -44,12 +49,12 @@
-
+
@@ -61,12 +66,12 @@
+
+
-
-
-
-
+
+
diff --git a/eng/Versions.props b/eng/Versions.props
new file mode 100644
index 0000000000..8adc6dcbbd
--- /dev/null
+++ b/eng/Versions.props
@@ -0,0 +1,8 @@
+
+
diff --git a/eng/targets/CSharp.Common.props b/eng/targets/CSharp.Common.props
index fe72087c07..29c167c722 100644
--- a/eng/targets/CSharp.Common.props
+++ b/eng/targets/CSharp.Common.props
@@ -15,4 +15,13 @@
+
+
+
+
+
+
+
+
+
diff --git a/eng/targets/ResolveReferences.targets b/eng/targets/ResolveReferences.targets
index 675b0efa18..965da850bc 100644
--- a/eng/targets/ResolveReferences.targets
+++ b/eng/targets/ResolveReferences.targets
@@ -1,3 +1,21 @@
+
@@ -31,17 +49,23 @@
+
<_ImplicitPackageReference Include="@(PackageReference->WithMetadataValue('IsImplicitlyDefined', 'true'))" />
+
<_ExplicitPackageReference Include="@(PackageReference)" Exclude="@(_ImplicitPackageReference)" />
+
<_ExplicitPackageReference Remove="Internal.AspNetCore.Sdk" />
<_ExplicitPackageReference Remove="Microsoft.NETFramework.ReferenceAssemblies" />
-
+ <_UnusedProjectReferenceProvider Include="@(ProjectReferenceProvider)" Exclude="@(Reference)" />
-
+
<_ProjectReferenceByAssemblyName Condition="'$(UseProjectReferences)' == 'true'"
Include="@(ProjectReferenceProvider)"
- Exclude="@(UnusedProjectReferenceProvider)" />
+ Exclude="@(_UnusedProjectReferenceProvider)" />
@@ -52,12 +76,18 @@
+
<_ReferenceTemp Remove="@(_ReferenceTemp)" />
+
+
@@ -118,6 +149,7 @@
Text="Could not resolve this reference. Could not locate the package or project for "%(Reference.Identity)"" />
+
<_TargetFramework Remove="@(_TargetFramework)" />
diff --git a/src/AuthSamples/build/dependencies.props b/src/AuthSamples/build/dependencies.props
index 83cb185cd8..8385592af4 100644
--- a/src/AuthSamples/build/dependencies.props
+++ b/src/AuthSamples/build/dependencies.props
@@ -54,8 +54,6 @@
2.2.0-preview3-35425
2.2.0-preview3-35425
2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
3.14.2
5.2.0
2.0.9
diff --git a/src/AzureIntegration/Directory.Build.props b/src/AzureIntegration/Directory.Build.props
index cf33763ee4..f1021ec41a 100644
--- a/src/AzureIntegration/Directory.Build.props
+++ b/src/AzureIntegration/Directory.Build.props
@@ -15,6 +15,7 @@
$(MSBuildThisFileDirectory)..\..\eng\AspNetCore.snk
true
true
+ $(MSBuildThisFileDirectory)..\Shared\
diff --git a/src/AzureIntegration/build/dependencies.props b/src/AzureIntegration/build/dependencies.props
index 4825e01b5e..78f9cabac4 100644
--- a/src/AzureIntegration/build/dependencies.props
+++ b/src/AzureIntegration/build/dependencies.props
@@ -1,51 +1,50 @@
-
-
- $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
-
-
- 2.2.0-preview2-20181004.6
- 2.2.0-preview2-20181004.6
- 2.1.1
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.1.0-preview2-30187
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 0.6.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 1.1.3
- 1.0.1
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.0.9
- 2.1.3
- 2.2.0-preview3-27001-02
- 2.2.0-preview3-35425
- 15.6.1
- 1.4.0
- 4.7.49
- 2.0.3
- 11.0.2
- 1.6.0
- 8.1.4
- 2.3.1
- 2.4.0
-
-
-
-
+
+
+ $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+
+
+ 2.2.0-preview2-20181004.6
+ 2.2.0-preview2-20181004.6
+ 2.1.1
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.1.0-preview2-30187
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 0.6.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 1.1.3
+ 1.0.1
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.2.0-preview3-35425
+ 2.0.9
+ 2.1.3
+ 2.2.0-preview3-27001-02
+ 2.2.0-preview3-35425
+ 15.6.1
+ 1.4.0
+ 4.7.49
+ 2.0.3
+ 11.0.2
+ 1.6.0
+ 8.1.4
+ 2.3.1
+ 2.4.0
+
+
+
+
diff --git a/src/AzureIntegration/test/Microsoft.AspNetCore.AzureAppServices.FunctionalTests/Microsoft.AspNetCore.AzureAppServices.FunctionalTests.csproj b/src/AzureIntegration/test/Microsoft.AspNetCore.AzureAppServices.FunctionalTests/Microsoft.AspNetCore.AzureAppServices.FunctionalTests.csproj
index 6bf10bc884..dd2aa41bb2 100644
--- a/src/AzureIntegration/test/Microsoft.AspNetCore.AzureAppServices.FunctionalTests/Microsoft.AspNetCore.AzureAppServices.FunctionalTests.csproj
+++ b/src/AzureIntegration/test/Microsoft.AspNetCore.AzureAppServices.FunctionalTests/Microsoft.AspNetCore.AzureAppServices.FunctionalTests.csproj
@@ -9,13 +9,13 @@
+
-
diff --git a/src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj b/src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj
index 021b3fde2c..e1c44678f6 100644
--- a/src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj
+++ b/src/DataProtection/Abstractions/src/Microsoft.AspNetCore.DataProtection.Abstractions.csproj
@@ -12,10 +12,7 @@ Microsoft.AspNetCore.DataProtection.IDataProtector
-
-
-
-
+
diff --git a/src/DefaultBuilder/DefaultBuilder.sln b/src/DefaultBuilder/DefaultBuilder.sln
new file mode 100644
index 0000000000..30d7765447
--- /dev/null
+++ b/src/DefaultBuilder/DefaultBuilder.sln
@@ -0,0 +1,205 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.26124.0
+MinimumVisualStudioVersion = 15.0.26124.0
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleApp", "samples\SampleApp\SampleApp.csproj", "{C19108F8-667B-4CF9-B227-CDD2290224BC}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Tests", "test\Microsoft.AspNetCore.Tests\Microsoft.AspNetCore.Tests.csproj", "{1CD49F15-D381-4C7E-8E12-A85E7753B110}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.FunctionalTests", "test\Microsoft.AspNetCore.FunctionalTests\Microsoft.AspNetCore.FunctionalTests.csproj", "{766C394B-ABBB-4624-A071-C806C0A2CD3E}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "testassets", "testassets", "{3C38AE63-E4F4-4BCA-97C1-F0A96A06BA88}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CreateDefaultBuilderApp", "testassets\CreateDefaultBuilderApp\CreateDefaultBuilderApp.csproj", "{BE8D7353-692B-4B5B-ADFD-32632AE758E3}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CreateDefaultBuilderOfTApp", "testassets\CreateDefaultBuilderOfTApp\CreateDefaultBuilderOfTApp.csproj", "{AE1F0124-996E-476A-9331-FB789F3D0577}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyInjectionApp", "testassets\DependencyInjectionApp\DependencyInjectionApp.csproj", "{03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StartRequestDelegateUrlApp", "testassets\StartRequestDelegateUrlApp\StartRequestDelegateUrlApp.csproj", "{4B69520E-CB30-4B20-BCA7-9378EAC322A6}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StartRouteBuilderUrlApp", "testassets\StartRouteBuilderUrlApp\StartRouteBuilderUrlApp.csproj", "{AC847245-BFC3-4BEB-915C-FCD932359A5F}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StartWithIApplicationBuilderUrlApp", "testassets\StartWithIApplicationBuilderUrlApp\StartWithIApplicationBuilderUrlApp.csproj", "{92F27C24-44CA-4C2B-867E-1A4D776B03E0}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore", "src\Microsoft.AspNetCore.csproj", "{BEB88AF7-67EB-4754-A5CD-89C0388974C9}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_dependencies", "_dependencies", "{31D4AC03-410F-476C-A0C8-E9E9490289B1}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Server.IntegrationTesting", "..\Hosting\Server.IntegrationTesting\src\Microsoft.AspNetCore.Server.IntegrationTesting.csproj", "{BF5885C7-F975-4652-9C11-093781FC16C5}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.StaticFiles", "..\Middleware\StaticFiles\src\Microsoft.AspNetCore.StaticFiles.csproj", "{D46E4E5D-0846-4574-A8BA-30D040A6254D}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Debug|x64.Build.0 = Debug|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Debug|x86.Build.0 = Debug|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Release|x64.ActiveCfg = Release|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Release|x64.Build.0 = Release|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Release|x86.ActiveCfg = Release|Any CPU
+ {C19108F8-667B-4CF9-B227-CDD2290224BC}.Release|x86.Build.0 = Release|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Debug|x64.Build.0 = Debug|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Debug|x86.Build.0 = Debug|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Release|x64.ActiveCfg = Release|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Release|x64.Build.0 = Release|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Release|x86.ActiveCfg = Release|Any CPU
+ {1CD49F15-D381-4C7E-8E12-A85E7753B110}.Release|x86.Build.0 = Release|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Debug|x64.Build.0 = Debug|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Debug|x86.Build.0 = Debug|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Release|x64.ActiveCfg = Release|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Release|x64.Build.0 = Release|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Release|x86.ActiveCfg = Release|Any CPU
+ {766C394B-ABBB-4624-A071-C806C0A2CD3E}.Release|x86.Build.0 = Release|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Debug|x64.Build.0 = Debug|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Debug|x86.Build.0 = Debug|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Release|x64.ActiveCfg = Release|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Release|x64.Build.0 = Release|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Release|x86.ActiveCfg = Release|Any CPU
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3}.Release|x86.Build.0 = Release|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Debug|x64.Build.0 = Debug|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Debug|x86.Build.0 = Debug|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Release|x64.ActiveCfg = Release|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Release|x64.Build.0 = Release|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Release|x86.ActiveCfg = Release|Any CPU
+ {AE1F0124-996E-476A-9331-FB789F3D0577}.Release|x86.Build.0 = Release|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Debug|x64.Build.0 = Debug|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Debug|x86.Build.0 = Debug|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Release|x64.ActiveCfg = Release|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Release|x64.Build.0 = Release|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Release|x86.ActiveCfg = Release|Any CPU
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6}.Release|x86.Build.0 = Release|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Debug|x64.Build.0 = Debug|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Debug|x86.Build.0 = Debug|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Release|x64.ActiveCfg = Release|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Release|x64.Build.0 = Release|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Release|x86.ActiveCfg = Release|Any CPU
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6}.Release|x86.Build.0 = Release|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Debug|x64.Build.0 = Debug|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Debug|x86.Build.0 = Debug|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Release|x64.ActiveCfg = Release|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Release|x64.Build.0 = Release|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Release|x86.ActiveCfg = Release|Any CPU
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F}.Release|x86.Build.0 = Release|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Debug|x64.Build.0 = Debug|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Debug|x86.Build.0 = Debug|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Release|Any CPU.Build.0 = Release|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Release|x64.ActiveCfg = Release|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Release|x64.Build.0 = Release|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Release|x86.ActiveCfg = Release|Any CPU
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0}.Release|x86.Build.0 = Release|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Debug|x64.Build.0 = Debug|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Debug|x86.Build.0 = Debug|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Release|x64.ActiveCfg = Release|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Release|x64.Build.0 = Release|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Release|x86.ActiveCfg = Release|Any CPU
+ {BEB88AF7-67EB-4754-A5CD-89C0388974C9}.Release|x86.Build.0 = Release|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Debug|x64.Build.0 = Debug|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Debug|x86.Build.0 = Debug|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Release|x64.ActiveCfg = Release|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Release|x64.Build.0 = Release|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Release|x86.ActiveCfg = Release|Any CPU
+ {BF5885C7-F975-4652-9C11-093781FC16C5}.Release|x86.Build.0 = Release|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Debug|x64.Build.0 = Debug|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Debug|x86.Build.0 = Debug|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Release|x64.ActiveCfg = Release|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Release|x64.Build.0 = Release|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Release|x86.ActiveCfg = Release|Any CPU
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {BE8D7353-692B-4B5B-ADFD-32632AE758E3} = {3C38AE63-E4F4-4BCA-97C1-F0A96A06BA88}
+ {AE1F0124-996E-476A-9331-FB789F3D0577} = {3C38AE63-E4F4-4BCA-97C1-F0A96A06BA88}
+ {03C1BD3F-6F6D-4D8F-9BD9-205D059723B6} = {3C38AE63-E4F4-4BCA-97C1-F0A96A06BA88}
+ {4B69520E-CB30-4B20-BCA7-9378EAC322A6} = {3C38AE63-E4F4-4BCA-97C1-F0A96A06BA88}
+ {AC847245-BFC3-4BEB-915C-FCD932359A5F} = {3C38AE63-E4F4-4BCA-97C1-F0A96A06BA88}
+ {92F27C24-44CA-4C2B-867E-1A4D776B03E0} = {3C38AE63-E4F4-4BCA-97C1-F0A96A06BA88}
+ {BF5885C7-F975-4652-9C11-093781FC16C5} = {31D4AC03-410F-476C-A0C8-E9E9490289B1}
+ {D46E4E5D-0846-4574-A8BA-30D040A6254D} = {31D4AC03-410F-476C-A0C8-E9E9490289B1}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {3A0191FF-7538-4406-BD4A-4883C0E1B72C}
+ EndGlobalSection
+EndGlobal
diff --git a/src/MetaPackages/build/Key.snk b/src/DefaultBuilder/build/Key.snk
similarity index 100%
rename from src/MetaPackages/build/Key.snk
rename to src/DefaultBuilder/build/Key.snk
diff --git a/src/MetaPackages/samples/SampleApp/Program.cs b/src/DefaultBuilder/samples/SampleApp/Program.cs
similarity index 100%
rename from src/MetaPackages/samples/SampleApp/Program.cs
rename to src/DefaultBuilder/samples/SampleApp/Program.cs
diff --git a/src/MetaPackages/samples/SampleApp/SampleApp.csproj b/src/DefaultBuilder/samples/SampleApp/SampleApp.csproj
similarity index 52%
rename from src/MetaPackages/samples/SampleApp/SampleApp.csproj
rename to src/DefaultBuilder/samples/SampleApp/SampleApp.csproj
index 64ab5e297e..682f5ae029 100644
--- a/src/MetaPackages/samples/SampleApp/SampleApp.csproj
+++ b/src/DefaultBuilder/samples/SampleApp/SampleApp.csproj
@@ -1,4 +1,4 @@
-
+
netcoreapp2.2;net461
@@ -10,7 +10,7 @@
-
-
+
+
diff --git a/src/MetaPackages/samples/SampleApp/Startup.cs b/src/DefaultBuilder/samples/SampleApp/Startup.cs
similarity index 100%
rename from src/MetaPackages/samples/SampleApp/Startup.cs
rename to src/DefaultBuilder/samples/SampleApp/Startup.cs
diff --git a/src/MetaPackages/samples/SampleApp/appsettings.json b/src/DefaultBuilder/samples/SampleApp/appsettings.json
similarity index 100%
rename from src/MetaPackages/samples/SampleApp/appsettings.json
rename to src/DefaultBuilder/samples/SampleApp/appsettings.json
diff --git a/src/MetaPackages/samples/SampleApp/wwwroot/htmlpage.html b/src/DefaultBuilder/samples/SampleApp/wwwroot/htmlpage.html
similarity index 100%
rename from src/MetaPackages/samples/SampleApp/wwwroot/htmlpage.html
rename to src/DefaultBuilder/samples/SampleApp/wwwroot/htmlpage.html
diff --git a/src/MetaPackages/src/Microsoft.AspNetCore/HostFilteringStartupFilter.cs b/src/DefaultBuilder/src/HostFilteringStartupFilter.cs
similarity index 100%
rename from src/MetaPackages/src/Microsoft.AspNetCore/HostFilteringStartupFilter.cs
rename to src/DefaultBuilder/src/HostFilteringStartupFilter.cs
diff --git a/src/DefaultBuilder/src/Microsoft.AspNetCore.csproj b/src/DefaultBuilder/src/Microsoft.AspNetCore.csproj
new file mode 100644
index 0000000000..6fd6d7b704
--- /dev/null
+++ b/src/DefaultBuilder/src/Microsoft.AspNetCore.csproj
@@ -0,0 +1,32 @@
+
+
+
+ netstandard2.0
+ aspnetcore
+ Microsoft.AspNetCore
+ true
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/MetaPackages/src/Microsoft.AspNetCore/WebHost.cs b/src/DefaultBuilder/src/WebHost.cs
similarity index 100%
rename from src/MetaPackages/src/Microsoft.AspNetCore/WebHost.cs
rename to src/DefaultBuilder/src/WebHost.cs
diff --git a/src/MetaPackages/src/Microsoft.AspNetCore/baseline.netcore.json b/src/DefaultBuilder/src/baseline.netcore.json
similarity index 100%
rename from src/MetaPackages/src/Microsoft.AspNetCore/baseline.netcore.json
rename to src/DefaultBuilder/src/baseline.netcore.json
diff --git a/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj b/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj
new file mode 100644
index 0000000000..a6bf62fe99
--- /dev/null
+++ b/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj
@@ -0,0 +1,22 @@
+
+
+
+ $(StandardTestTfms)
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/MetaPackages/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs b/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs
similarity index 99%
rename from src/MetaPackages/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs
rename to src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs
index d2e71f5778..68ffd317a6 100644
--- a/src/MetaPackages/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs
+++ b/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs
@@ -240,10 +240,10 @@ namespace Microsoft.AspNetCore.Tests
var directoryInfo = new DirectoryInfo(applicationBasePath);
do
{
- var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "MetaPackages.sln"));
+ var solutionFileInfo = new FileInfo(Path.Combine(directoryInfo.FullName, "DefaultBuilder.sln"));
if (solutionFileInfo.Exists)
{
- return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "test", "TestSites"));
+ return Path.GetFullPath(Path.Combine(directoryInfo.FullName, "testassets"));
}
directoryInfo = directoryInfo.Parent;
diff --git a/src/MetaPackages/test/Microsoft.AspNetCore.FunctionalTests/testCert.pfx b/src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/testCert.pfx
similarity index 100%
rename from src/MetaPackages/test/Microsoft.AspNetCore.FunctionalTests/testCert.pfx
rename to src/DefaultBuilder/test/Microsoft.AspNetCore.FunctionalTests/testCert.pfx
diff --git a/src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/Microsoft.AspNetCore.Tests.csproj b/src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/Microsoft.AspNetCore.Tests.csproj
new file mode 100644
index 0000000000..9fe73037b0
--- /dev/null
+++ b/src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/Microsoft.AspNetCore.Tests.csproj
@@ -0,0 +1,11 @@
+
+
+
+ $(StandardTestTfms)
+
+
+
+
+
+
+
diff --git a/src/MetaPackages/test/Microsoft.AspNetCore.Tests/WebHostTests.cs b/src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/WebHostTests.cs
similarity index 100%
rename from src/MetaPackages/test/Microsoft.AspNetCore.Tests/WebHostTests.cs
rename to src/DefaultBuilder/test/Microsoft.AspNetCore.Tests/WebHostTests.cs
diff --git a/src/MetaPackages/test/TestSites/CreateDefaultBuilderApp/CreateDefaultBuilderApp.csproj b/src/DefaultBuilder/testassets/CreateDefaultBuilderApp/CreateDefaultBuilderApp.csproj
similarity index 74%
rename from src/MetaPackages/test/TestSites/CreateDefaultBuilderApp/CreateDefaultBuilderApp.csproj
rename to src/DefaultBuilder/testassets/CreateDefaultBuilderApp/CreateDefaultBuilderApp.csproj
index 9fc88e0995..1d4a68ab59 100644
--- a/src/MetaPackages/test/TestSites/CreateDefaultBuilderApp/CreateDefaultBuilderApp.csproj
+++ b/src/DefaultBuilder/testassets/CreateDefaultBuilderApp/CreateDefaultBuilderApp.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/src/MetaPackages/test/TestSites/CreateDefaultBuilderApp/Program.cs b/src/DefaultBuilder/testassets/CreateDefaultBuilderApp/Program.cs
similarity index 100%
rename from src/MetaPackages/test/TestSites/CreateDefaultBuilderApp/Program.cs
rename to src/DefaultBuilder/testassets/CreateDefaultBuilderApp/Program.cs
diff --git a/src/MetaPackages/test/TestSites/CreateDefaultBuilderApp/appsettings.Development.json b/src/DefaultBuilder/testassets/CreateDefaultBuilderApp/appsettings.Development.json
similarity index 100%
rename from src/MetaPackages/test/TestSites/CreateDefaultBuilderApp/appsettings.Development.json
rename to src/DefaultBuilder/testassets/CreateDefaultBuilderApp/appsettings.Development.json
diff --git a/src/MetaPackages/test/TestSites/CreateDefaultBuilderApp/appsettings.json b/src/DefaultBuilder/testassets/CreateDefaultBuilderApp/appsettings.json
similarity index 100%
rename from src/MetaPackages/test/TestSites/CreateDefaultBuilderApp/appsettings.json
rename to src/DefaultBuilder/testassets/CreateDefaultBuilderApp/appsettings.json
diff --git a/src/MetaPackages/test/TestSites/CreateDefaultBuilderOfTApp/CreateDefaultBuilderOfTApp.csproj b/src/DefaultBuilder/testassets/CreateDefaultBuilderOfTApp/CreateDefaultBuilderOfTApp.csproj
similarity index 74%
rename from src/MetaPackages/test/TestSites/CreateDefaultBuilderOfTApp/CreateDefaultBuilderOfTApp.csproj
rename to src/DefaultBuilder/testassets/CreateDefaultBuilderOfTApp/CreateDefaultBuilderOfTApp.csproj
index beca85599c..0ff43da236 100644
--- a/src/MetaPackages/test/TestSites/CreateDefaultBuilderOfTApp/CreateDefaultBuilderOfTApp.csproj
+++ b/src/DefaultBuilder/testassets/CreateDefaultBuilderOfTApp/CreateDefaultBuilderOfTApp.csproj
@@ -7,7 +7,7 @@
-
+
diff --git a/src/MetaPackages/test/TestSites/CreateDefaultBuilderOfTApp/Program.cs b/src/DefaultBuilder/testassets/CreateDefaultBuilderOfTApp/Program.cs
similarity index 100%
rename from src/MetaPackages/test/TestSites/CreateDefaultBuilderOfTApp/Program.cs
rename to src/DefaultBuilder/testassets/CreateDefaultBuilderOfTApp/Program.cs
diff --git a/src/MetaPackages/test/TestSites/CreateDefaultBuilderOfTApp/appsettings.Development.json b/src/DefaultBuilder/testassets/CreateDefaultBuilderOfTApp/appsettings.Development.json
similarity index 100%
rename from src/MetaPackages/test/TestSites/CreateDefaultBuilderOfTApp/appsettings.Development.json
rename to src/DefaultBuilder/testassets/CreateDefaultBuilderOfTApp/appsettings.Development.json
diff --git a/src/MetaPackages/test/TestSites/CreateDefaultBuilderOfTApp/appsettings.json b/src/DefaultBuilder/testassets/CreateDefaultBuilderOfTApp/appsettings.json
similarity index 100%
rename from src/MetaPackages/test/TestSites/CreateDefaultBuilderOfTApp/appsettings.json
rename to src/DefaultBuilder/testassets/CreateDefaultBuilderOfTApp/appsettings.json
diff --git a/src/MetaPackages/test/TestSites/DependencyInjectionApp/DependencyInjectionApp.csproj b/src/DefaultBuilder/testassets/DependencyInjectionApp/DependencyInjectionApp.csproj
similarity index 67%
rename from src/MetaPackages/test/TestSites/DependencyInjectionApp/DependencyInjectionApp.csproj
rename to src/DefaultBuilder/testassets/DependencyInjectionApp/DependencyInjectionApp.csproj
index f52140e4d0..ad14446c68 100644
--- a/src/MetaPackages/test/TestSites/DependencyInjectionApp/DependencyInjectionApp.csproj
+++ b/src/DefaultBuilder/testassets/DependencyInjectionApp/DependencyInjectionApp.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/src/MetaPackages/test/TestSites/DependencyInjectionApp/Program.cs b/src/DefaultBuilder/testassets/DependencyInjectionApp/Program.cs
similarity index 100%
rename from src/MetaPackages/test/TestSites/DependencyInjectionApp/Program.cs
rename to src/DefaultBuilder/testassets/DependencyInjectionApp/Program.cs
diff --git a/src/MetaPackages/test/TestSites/StartRequestDelegateUrlApp/Program.cs b/src/DefaultBuilder/testassets/StartRequestDelegateUrlApp/Program.cs
similarity index 100%
rename from src/MetaPackages/test/TestSites/StartRequestDelegateUrlApp/Program.cs
rename to src/DefaultBuilder/testassets/StartRequestDelegateUrlApp/Program.cs
diff --git a/src/MetaPackages/test/TestSites/StartRequestDelegateUrlApp/StartRequestDelegateUrlApp.csproj b/src/DefaultBuilder/testassets/StartRequestDelegateUrlApp/StartRequestDelegateUrlApp.csproj
similarity index 67%
rename from src/MetaPackages/test/TestSites/StartRequestDelegateUrlApp/StartRequestDelegateUrlApp.csproj
rename to src/DefaultBuilder/testassets/StartRequestDelegateUrlApp/StartRequestDelegateUrlApp.csproj
index f52140e4d0..ad14446c68 100644
--- a/src/MetaPackages/test/TestSites/StartRequestDelegateUrlApp/StartRequestDelegateUrlApp.csproj
+++ b/src/DefaultBuilder/testassets/StartRequestDelegateUrlApp/StartRequestDelegateUrlApp.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/src/MetaPackages/test/TestSites/StartRouteBuilderUrlApp/Program.cs b/src/DefaultBuilder/testassets/StartRouteBuilderUrlApp/Program.cs
similarity index 100%
rename from src/MetaPackages/test/TestSites/StartRouteBuilderUrlApp/Program.cs
rename to src/DefaultBuilder/testassets/StartRouteBuilderUrlApp/Program.cs
diff --git a/src/MetaPackages/test/TestSites/StartRouteBuilderUrlApp/StartRouteBuilderUrlApp.csproj b/src/DefaultBuilder/testassets/StartRouteBuilderUrlApp/StartRouteBuilderUrlApp.csproj
similarity index 67%
rename from src/MetaPackages/test/TestSites/StartRouteBuilderUrlApp/StartRouteBuilderUrlApp.csproj
rename to src/DefaultBuilder/testassets/StartRouteBuilderUrlApp/StartRouteBuilderUrlApp.csproj
index f52140e4d0..ad14446c68 100644
--- a/src/MetaPackages/test/TestSites/StartRouteBuilderUrlApp/StartRouteBuilderUrlApp.csproj
+++ b/src/DefaultBuilder/testassets/StartRouteBuilderUrlApp/StartRouteBuilderUrlApp.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/src/MetaPackages/test/TestSites/StartWithIApplicationBuilderUrlApp/Program.cs b/src/DefaultBuilder/testassets/StartWithIApplicationBuilderUrlApp/Program.cs
similarity index 100%
rename from src/MetaPackages/test/TestSites/StartWithIApplicationBuilderUrlApp/Program.cs
rename to src/DefaultBuilder/testassets/StartWithIApplicationBuilderUrlApp/Program.cs
diff --git a/src/MetaPackages/test/TestSites/StartWithIApplicationBuilderUrlApp/StartWithIApplicationBuilderUrlApp.csproj b/src/DefaultBuilder/testassets/StartWithIApplicationBuilderUrlApp/StartWithIApplicationBuilderUrlApp.csproj
similarity index 67%
rename from src/MetaPackages/test/TestSites/StartWithIApplicationBuilderUrlApp/StartWithIApplicationBuilderUrlApp.csproj
rename to src/DefaultBuilder/testassets/StartWithIApplicationBuilderUrlApp/StartWithIApplicationBuilderUrlApp.csproj
index f52140e4d0..ad14446c68 100644
--- a/src/MetaPackages/test/TestSites/StartWithIApplicationBuilderUrlApp/StartWithIApplicationBuilderUrlApp.csproj
+++ b/src/DefaultBuilder/testassets/StartWithIApplicationBuilderUrlApp/StartWithIApplicationBuilderUrlApp.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/src/Features/JsonPatch/src/Microsoft.AspNetCore.JsonPatch.csproj b/src/Features/JsonPatch/src/Microsoft.AspNetCore.JsonPatch.csproj
index 3708e92927..f6f11fd3b3 100644
--- a/src/Features/JsonPatch/src/Microsoft.AspNetCore.JsonPatch.csproj
+++ b/src/Features/JsonPatch/src/Microsoft.AspNetCore.JsonPatch.csproj
@@ -8,10 +8,13 @@
aspnetcore;json;jsonpatch
+
+
+
+
-
diff --git a/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj b/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj
index 627b36bbc2..fbefc75eef 100644
--- a/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj
+++ b/src/Hosting/Hosting/src/Microsoft.AspNetCore.Hosting.csproj
@@ -8,6 +8,11 @@
aspnetcore;hosting
+
+
+
+
+
@@ -20,8 +25,6 @@
-
-
diff --git a/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj b/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj
index 50970c8d86..1fa4ce9d7a 100644
--- a/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj
+++ b/src/Hosting/Server.IntegrationTesting/src/Microsoft.AspNetCore.Server.IntegrationTesting.csproj
@@ -17,10 +17,8 @@
+
-
-
-
@@ -31,7 +29,6 @@
-
diff --git a/src/Http/Http/src/Microsoft.AspNetCore.Http.csproj b/src/Http/Http/src/Microsoft.AspNetCore.Http.csproj
index 4344d0ae8e..e9d04e1ebc 100644
--- a/src/Http/Http/src/Microsoft.AspNetCore.Http.csproj
+++ b/src/Http/Http/src/Microsoft.AspNetCore.Http.csproj
@@ -9,10 +9,13 @@
aspnetcore
+
+
+
+
-
diff --git a/src/Http/Routing.Abstractions/src/Microsoft.AspNetCore.Routing.Abstractions.csproj b/src/Http/Routing.Abstractions/src/Microsoft.AspNetCore.Routing.Abstractions.csproj
index edb292bb22..ff154fe535 100644
--- a/src/Http/Routing.Abstractions/src/Microsoft.AspNetCore.Routing.Abstractions.csproj
+++ b/src/Http/Routing.Abstractions/src/Microsoft.AspNetCore.Routing.Abstractions.csproj
@@ -11,8 +11,11 @@ Microsoft.AspNetCore.Routing.RouteData
aspnetcore;routing
+
+
+
+
-
diff --git a/src/Http/Routing/src/Microsoft.AspNetCore.Routing.csproj b/src/Http/Routing/src/Microsoft.AspNetCore.Routing.csproj
index 1e297bdf93..99717d310b 100644
--- a/src/Http/Routing/src/Microsoft.AspNetCore.Routing.csproj
+++ b/src/Http/Routing/src/Microsoft.AspNetCore.Routing.csproj
@@ -24,6 +24,10 @@ Microsoft.AspNetCore.Routing.RouteCollection
IL_EMIT_SAVE_ASSEMBLIES;$(DefineConstants)
+
+
+
+
@@ -31,7 +35,6 @@ Microsoft.AspNetCore.Routing.RouteCollection
-
diff --git a/src/Http/WebUtilities/src/Microsoft.AspNetCore.WebUtilities.csproj b/src/Http/WebUtilities/src/Microsoft.AspNetCore.WebUtilities.csproj
index 3c7d2d8255..fdc9592cc8 100644
--- a/src/Http/WebUtilities/src/Microsoft.AspNetCore.WebUtilities.csproj
+++ b/src/Http/WebUtilities/src/Microsoft.AspNetCore.WebUtilities.csproj
@@ -10,7 +10,10 @@
-
+
+
+
+
diff --git a/src/Identity/Directory.Build.props b/src/Identity/Directory.Build.props
index 1c9369f941..5a4e9d7eef 100644
--- a/src/Identity/Directory.Build.props
+++ b/src/Identity/Directory.Build.props
@@ -17,6 +17,7 @@
true
false
+ $(MSBuildThisFileDirectory)..\Shared\
diff --git a/src/Identity/build/dependencies.props b/src/Identity/build/dependencies.props
index e9b3e6f8bc..de5fbc39ce 100644
--- a/src/Identity/build/dependencies.props
+++ b/src/Identity/build/dependencies.props
@@ -58,8 +58,6 @@
2.2.0-preview3-35425
2.2.0-preview3-35425
2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
2.0.9
2.1.3
2.2.0-preview3-27001-02
diff --git a/src/MetaPackages/.gitignore b/src/MetaPackages/.gitignore
deleted file mode 100644
index 3af0091ea3..0000000000
--- a/src/MetaPackages/.gitignore
+++ /dev/null
@@ -1,37 +0,0 @@
-[Oo]bj/
-[Bb]in/
-TestResults/
-.nuget/
-_ReSharper.*/
-packages/
-artifacts/
-PublishProfiles/
-*.user
-*.suo
-*.cache
-*.docstates
-_ReSharper.*
-nuget.exe
-*net45.csproj
-*net451.csproj
-*k10.csproj
-*.psess
-*.vsp
-*.pidb
-*.userprefs
-*DS_Store
-*.ncrunchsolution
-*.*sdf
-*.ipch
-*.sln.ide
-project.lock.json
-.vs
-.vscode/
-.build/
-.testPublish/
-global.json
-
-# Dependencies from pre-requisite builds
-.deps/
-.rw/
-.ro/
diff --git a/src/MetaPackages/Directory.Build.props b/src/MetaPackages/Directory.Build.props
deleted file mode 100644
index 7c614d7224..0000000000
--- a/src/MetaPackages/Directory.Build.props
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
- Microsoft ASP.NET Core
- https://github.com/aspnet/AspnetCore
- git
- $(MSBuildThisFileDirectory)
- false
- $(MSBuildThisFileDirectory)..\..\eng\AspNetCore.snk
- true
- true
-
-
diff --git a/src/MetaPackages/Directory.Build.targets b/src/MetaPackages/Directory.Build.targets
deleted file mode 100644
index 78626b773e..0000000000
--- a/src/MetaPackages/Directory.Build.targets
+++ /dev/null
@@ -1,10 +0,0 @@
-
-
- $(MicrosoftNETCoreApp20PackageVersion)
- $(MicrosoftNETCoreApp21PackageVersion)
- $(MicrosoftNETCoreApp22PackageVersion)
- $(NETStandardLibrary20PackageVersion)
-
- 99.9
-
-
diff --git a/src/MetaPackages/MetaPackages.sln b/src/MetaPackages/MetaPackages.sln
deleted file mode 100644
index 659427dfcb..0000000000
--- a/src/MetaPackages/MetaPackages.sln
+++ /dev/null
@@ -1,116 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 15
-VisualStudioVersion = 15.0.27005.2
-MinimumVisualStudioVersion = 15.0.26730.03
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED834E68-51C3-4ADE-ACC8-6BA6D4207C09}"
- ProjectSection(SolutionItems) = preProject
- src\Directory.Build.props = src\Directory.Build.props
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore", "src\Microsoft.AspNetCore\Microsoft.AspNetCore.csproj", "{6F3D43F7-9546-4B41-AF04-CF4708B62051}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{97D53BEB-A511-4FBE-B784-AB407D9A219F}"
- ProjectSection(SolutionItems) = preProject
- Directory.Build.props = Directory.Build.props
- Directory.Build.targets = Directory.Build.targets
- NuGet.config = NuGet.config
- version.xml = version.xml
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{F92CB7A1-C38E-408C-A7EC-A5C040D041E1}"
- ProjectSection(SolutionItems) = preProject
- build\dependencies.props = build\dependencies.props
- build\repo.targets = build\repo.targets
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{192F583C-C4CA-43E5-B31C-D21B7806E274}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SampleApp", "samples\SampleApp\SampleApp.csproj", "{AF5BB04E-92F7-4737-8B98-F86F6244FAB2}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{9E49B5B9-9E72-42FB-B684-90CA1B1BCF9C}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.FunctionalTests", "test\Microsoft.AspNetCore.FunctionalTests\Microsoft.AspNetCore.FunctionalTests.csproj", "{C72A756A-D29D-44C7-83D4-821DBE82DBCA}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestSites", "TestSites", "{EC22261D-0DE1-47DE-8F7C-072675D6F5B4}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StartRouteBuilderUrlApp", "test\TestSites\StartRouteBuilderUrlApp\StartRouteBuilderUrlApp.csproj", "{AB42054B-1801-4FEE-B5C3-8529C6D7BFDA}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StartWithIApplicationBuilderUrlApp", "test\TestSites\StartWithIApplicationBuilderUrlApp\StartWithIApplicationBuilderUrlApp.csproj", "{3A85FA52-F601-422E-A42E-9F187DB28492}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StartRequestDelegateUrlApp", "test\TestSites\StartRequestDelegateUrlApp\StartRequestDelegateUrlApp.csproj", "{401C741B-6C7C-4E08-9F09-C3D43D22C0DE}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CreateDefaultBuilderApp", "test\TestSites\CreateDefaultBuilderApp\CreateDefaultBuilderApp.csproj", "{79CF58CE-B020-45D8-BDB5-2D8036BEAD14}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyInjectionApp", "test\TestSites\DependencyInjectionApp\DependencyInjectionApp.csproj", "{65FE2E38-4529-4C93-A7B0-CF12DD7A70C3}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CreateDefaultBuilderOfTApp", "test\TestSites\CreateDefaultBuilderOfTApp\CreateDefaultBuilderOfTApp.csproj", "{A922B5AC-836B-44F4-83F1-3CB9EB08A3F8}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNetCore.Tests", "test\Microsoft.AspNetCore.Tests\Microsoft.AspNetCore.Tests.csproj", "{BD08F027-3BB9-427B-9367-19534B7376B3}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {6F3D43F7-9546-4B41-AF04-CF4708B62051}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6F3D43F7-9546-4B41-AF04-CF4708B62051}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6F3D43F7-9546-4B41-AF04-CF4708B62051}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6F3D43F7-9546-4B41-AF04-CF4708B62051}.Release|Any CPU.Build.0 = Release|Any CPU
- {AF5BB04E-92F7-4737-8B98-F86F6244FAB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AF5BB04E-92F7-4737-8B98-F86F6244FAB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AF5BB04E-92F7-4737-8B98-F86F6244FAB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AF5BB04E-92F7-4737-8B98-F86F6244FAB2}.Release|Any CPU.Build.0 = Release|Any CPU
- {C72A756A-D29D-44C7-83D4-821DBE82DBCA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {C72A756A-D29D-44C7-83D4-821DBE82DBCA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {C72A756A-D29D-44C7-83D4-821DBE82DBCA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {C72A756A-D29D-44C7-83D4-821DBE82DBCA}.Release|Any CPU.Build.0 = Release|Any CPU
- {AB42054B-1801-4FEE-B5C3-8529C6D7BFDA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AB42054B-1801-4FEE-B5C3-8529C6D7BFDA}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AB42054B-1801-4FEE-B5C3-8529C6D7BFDA}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AB42054B-1801-4FEE-B5C3-8529C6D7BFDA}.Release|Any CPU.Build.0 = Release|Any CPU
- {3A85FA52-F601-422E-A42E-9F187DB28492}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {3A85FA52-F601-422E-A42E-9F187DB28492}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {3A85FA52-F601-422E-A42E-9F187DB28492}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {3A85FA52-F601-422E-A42E-9F187DB28492}.Release|Any CPU.Build.0 = Release|Any CPU
- {401C741B-6C7C-4E08-9F09-C3D43D22C0DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {401C741B-6C7C-4E08-9F09-C3D43D22C0DE}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {401C741B-6C7C-4E08-9F09-C3D43D22C0DE}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {401C741B-6C7C-4E08-9F09-C3D43D22C0DE}.Release|Any CPU.Build.0 = Release|Any CPU
- {79CF58CE-B020-45D8-BDB5-2D8036BEAD14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {79CF58CE-B020-45D8-BDB5-2D8036BEAD14}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {79CF58CE-B020-45D8-BDB5-2D8036BEAD14}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {79CF58CE-B020-45D8-BDB5-2D8036BEAD14}.Release|Any CPU.Build.0 = Release|Any CPU
- {65FE2E38-4529-4C93-A7B0-CF12DD7A70C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {65FE2E38-4529-4C93-A7B0-CF12DD7A70C3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {65FE2E38-4529-4C93-A7B0-CF12DD7A70C3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {65FE2E38-4529-4C93-A7B0-CF12DD7A70C3}.Release|Any CPU.Build.0 = Release|Any CPU
- {A922B5AC-836B-44F4-83F1-3CB9EB08A3F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A922B5AC-836B-44F4-83F1-3CB9EB08A3F8}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A922B5AC-836B-44F4-83F1-3CB9EB08A3F8}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A922B5AC-836B-44F4-83F1-3CB9EB08A3F8}.Release|Any CPU.Build.0 = Release|Any CPU
- {BD08F027-3BB9-427B-9367-19534B7376B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {BD08F027-3BB9-427B-9367-19534B7376B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {BD08F027-3BB9-427B-9367-19534B7376B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {BD08F027-3BB9-427B-9367-19534B7376B3}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {6F3D43F7-9546-4B41-AF04-CF4708B62051} = {ED834E68-51C3-4ADE-ACC8-6BA6D4207C09}
- {AF5BB04E-92F7-4737-8B98-F86F6244FAB2} = {192F583C-C4CA-43E5-B31C-D21B7806E274}
- {C72A756A-D29D-44C7-83D4-821DBE82DBCA} = {9E49B5B9-9E72-42FB-B684-90CA1B1BCF9C}
- {EC22261D-0DE1-47DE-8F7C-072675D6F5B4} = {9E49B5B9-9E72-42FB-B684-90CA1B1BCF9C}
- {AB42054B-1801-4FEE-B5C3-8529C6D7BFDA} = {EC22261D-0DE1-47DE-8F7C-072675D6F5B4}
- {3A85FA52-F601-422E-A42E-9F187DB28492} = {EC22261D-0DE1-47DE-8F7C-072675D6F5B4}
- {401C741B-6C7C-4E08-9F09-C3D43D22C0DE} = {EC22261D-0DE1-47DE-8F7C-072675D6F5B4}
- {79CF58CE-B020-45D8-BDB5-2D8036BEAD14} = {EC22261D-0DE1-47DE-8F7C-072675D6F5B4}
- {65FE2E38-4529-4C93-A7B0-CF12DD7A70C3} = {EC22261D-0DE1-47DE-8F7C-072675D6F5B4}
- {A922B5AC-836B-44F4-83F1-3CB9EB08A3F8} = {EC22261D-0DE1-47DE-8F7C-072675D6F5B4}
- {BD08F027-3BB9-427B-9367-19534B7376B3} = {9E49B5B9-9E72-42FB-B684-90CA1B1BCF9C}
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {A666E9B0-125B-4975-B35B-09A6D68A5047}
- EndGlobalSection
-EndGlobal
diff --git a/src/MetaPackages/NuGetPackageVerifier.json b/src/MetaPackages/NuGetPackageVerifier.json
deleted file mode 100644
index b153ab1515..0000000000
--- a/src/MetaPackages/NuGetPackageVerifier.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "Default": {
- "rules": [
- "DefaultCompositeRule"
- ]
- }
-}
\ No newline at end of file
diff --git a/src/MetaPackages/README.md b/src/MetaPackages/README.md
deleted file mode 100644
index d35e5f0866..0000000000
--- a/src/MetaPackages/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-Meta packages
-========
-
-This repo contains NuGet meta packages that help quickly reference sets of common packages.
-
-This project is part of ASP.NET Core. You can find samples, documentation and getting started instructions for ASP.NET Core at the [Home](https://github.com/aspnet/home) repo.
-
diff --git a/src/MetaPackages/build/dependencies.props b/src/MetaPackages/build/dependencies.props
deleted file mode 100644
index 8d12964ca3..0000000000
--- a/src/MetaPackages/build/dependencies.props
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
- $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
-
-
- 2.2.0-preview2-20181004.6
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 0.6.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.2.0-preview3-35425
- 2.0.9
- 2.1.3
- 2.2.0-preview3-27001-02
- 15.6.1
- 4.7.49
- 2.0.3
- 2.3.1
- 2.4.0
-
-
-
-
diff --git a/src/MetaPackages/build/repo.props b/src/MetaPackages/build/repo.props
deleted file mode 100644
index e3e0fa123b..0000000000
--- a/src/MetaPackages/build/repo.props
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/MetaPackages/build/sources.props b/src/MetaPackages/build/sources.props
deleted file mode 100644
index 9215df9751..0000000000
--- a/src/MetaPackages/build/sources.props
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
-
-
- $(DotNetRestoreSources)
-
- $(RestoreSources);
- https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
- https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
- https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json;
-
-
- $(RestoreSources);
- https://api.nuget.org/v3/index.json;
-
-
-
diff --git a/src/MetaPackages/samples/SampleApp/Properties/launchSettings.json b/src/MetaPackages/samples/SampleApp/Properties/launchSettings.json
deleted file mode 100644
index f0370cf22b..0000000000
--- a/src/MetaPackages/samples/SampleApp/Properties/launchSettings.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:53432/",
- "sslPort": 0
- }
- },
- "profiles": {
- "IIS Express": {
- "commandName": "IISExpress",
- "launchBrowser": true,
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- },
- "SampleApp": {
- "commandName": "Project",
- "launchBrowser": true,
- "environmentVariables": {
- "ASPNETCORE_ENVIRONMENT": "Development"
- },
- "applicationUrl": "http://localhost:53433"
- }
- }
-}
diff --git a/src/MetaPackages/src/Directory.Build.props b/src/MetaPackages/src/Directory.Build.props
deleted file mode 100644
index 410f24daa9..0000000000
--- a/src/MetaPackages/src/Directory.Build.props
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
-
-
-
diff --git a/src/MetaPackages/src/Microsoft.AspNetCore/Microsoft.AspNetCore.csproj b/src/MetaPackages/src/Microsoft.AspNetCore/Microsoft.AspNetCore.csproj
deleted file mode 100644
index ea9a676d87..0000000000
--- a/src/MetaPackages/src/Microsoft.AspNetCore/Microsoft.AspNetCore.csproj
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
- netstandard2.0
- aspnetcore
- Microsoft.AspNetCore
- true
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/MetaPackages/test/Directory.Build.props b/src/MetaPackages/test/Directory.Build.props
deleted file mode 100644
index b8557e9f98..0000000000
--- a/src/MetaPackages/test/Directory.Build.props
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
- netcoreapp2.2
- $(DeveloperBuildTestTfms)
-
- $(StandardTestTfms);net461
-
-
-
-
-
-
diff --git a/src/MetaPackages/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj b/src/MetaPackages/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj
deleted file mode 100644
index 67422e13d6..0000000000
--- a/src/MetaPackages/test/Microsoft.AspNetCore.FunctionalTests/Microsoft.AspNetCore.FunctionalTests.csproj
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
- $(StandardTestTfms)
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/MetaPackages/test/Microsoft.AspNetCore.Tests/Microsoft.AspNetCore.Tests.csproj b/src/MetaPackages/test/Microsoft.AspNetCore.Tests/Microsoft.AspNetCore.Tests.csproj
deleted file mode 100644
index 1b8156a1ca..0000000000
--- a/src/MetaPackages/test/Microsoft.AspNetCore.Tests/Microsoft.AspNetCore.Tests.csproj
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-
- $(StandardTestTfms)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/MetaPackages/version.props b/src/MetaPackages/version.props
deleted file mode 100644
index 9b41b556d7..0000000000
--- a/src/MetaPackages/version.props
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- 2.2.0
- rtm
- $(VersionPrefix)
- $(VersionPrefix)-$(VersionSuffix)-final
- t000
- a-
- $(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-'))
- $(VersionSuffix)-$(BuildNumber)
-
-
diff --git a/src/Middleware/Diagnostics.EntityFrameworkCore/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj
index f418a50148..23e9b782f1 100644
--- a/src/Middleware/Diagnostics.EntityFrameworkCore/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj
+++ b/src/Middleware/Diagnostics.EntityFrameworkCore/src/Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore.csproj
@@ -10,12 +10,12 @@
+
-
diff --git a/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj b/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj
index a5ae405dcd..9bdc1cea77 100644
--- a/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj
+++ b/src/Middleware/Diagnostics/src/Microsoft.AspNetCore.Diagnostics.csproj
@@ -10,6 +10,8 @@
+
+
@@ -20,8 +22,6 @@
-
-
diff --git a/src/Mvc/Directory.Build.props b/src/Mvc/Directory.Build.props
index 6c951ddaca..83f51a1fe7 100644
--- a/src/Mvc/Directory.Build.props
+++ b/src/Mvc/Directory.Build.props
@@ -16,6 +16,7 @@
true
true
true
+ $(MSBuildThisFileDirectory)..\Shared\
diff --git a/src/Mvc/build/dependencies.props b/src/Mvc/build/dependencies.props
index 063add026b..89f7f61250 100644
--- a/src/Mvc/build/dependencies.props
+++ b/src/Mvc/build/dependencies.props
@@ -7,7 +7,7 @@
is not otherwise referenced. They avoid unnecessary changes to the Universe build graph or to product
dependencies. Do not use these properties elsewhere.
-->
-
+
0.9.9
0.10.13
2.1.1
@@ -64,11 +64,9 @@
2.2.0-rtm-35519
1.7.0
2.2.0-rtm-35519
- 2.2.0-rtm-35519
2.2.0-rtm-35519
2.2.0-rtm-35519
2.2.0-rtm-35519
- 2.2.0-rtm-35519
2.2.0-rtm-35519
2.1.0
2.2.0-rtm-35519
@@ -83,16 +81,11 @@
2.2.0-rtm-35519
2.2.0-rtm-35519
2.2.0-rtm-35519
- 2.2.0-rtm-35519
2.2.0-rtm-35519
2.2.0-rtm-35519
2.2.0-rtm-35519
- 2.2.0-rtm-35519
- 2.2.0-rtm-35519
- 2.2.0-rtm-35519
2.2.0-rtm-35519
2.2.0-rtm-35519
- 2.2.0-rtm-35519
2.0.9
2.1.3
2.2.0-preview3-27014-02
diff --git a/src/Mvc/src/Microsoft.AspNetCore.Mvc.Abstractions/Microsoft.AspNetCore.Mvc.Abstractions.csproj b/src/Mvc/src/Microsoft.AspNetCore.Mvc.Abstractions/Microsoft.AspNetCore.Mvc.Abstractions.csproj
index 34f0f5e6a1..1b3f5091ad 100644
--- a/src/Mvc/src/Microsoft.AspNetCore.Mvc.Abstractions/Microsoft.AspNetCore.Mvc.Abstractions.csproj
+++ b/src/Mvc/src/Microsoft.AspNetCore.Mvc.Abstractions/Microsoft.AspNetCore.Mvc.Abstractions.csproj
@@ -10,13 +10,16 @@ Microsoft.AspNetCore.Mvc.IActionResult
aspnetcore;aspnetcoremvc
+
+
+
+
-
diff --git a/src/Mvc/src/Microsoft.AspNetCore.Mvc.Core/Microsoft.AspNetCore.Mvc.Core.csproj b/src/Mvc/src/Microsoft.AspNetCore.Mvc.Core/Microsoft.AspNetCore.Mvc.Core.csproj
index 7fe1a42493..161671b41e 100644
--- a/src/Mvc/src/Microsoft.AspNetCore.Mvc.Core/Microsoft.AspNetCore.Mvc.Core.csproj
+++ b/src/Mvc/src/Microsoft.AspNetCore.Mvc.Core/Microsoft.AspNetCore.Mvc.Core.csproj
@@ -17,7 +17,12 @@ Microsoft.AspNetCore.Mvc.RouteAttribute
-
+
+
+
+
+
+
@@ -41,12 +46,7 @@ Microsoft.AspNetCore.Mvc.RouteAttribute
-
-
-
-
-
diff --git a/src/Mvc/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Microsoft.AspNetCore.Mvc.Formatters.Json.csproj b/src/Mvc/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Microsoft.AspNetCore.Mvc.Formatters.Json.csproj
index 45749b70ec..b203286a9b 100644
--- a/src/Mvc/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Microsoft.AspNetCore.Mvc.Formatters.Json.csproj
+++ b/src/Mvc/src/Microsoft.AspNetCore.Mvc.Formatters.Json/Microsoft.AspNetCore.Mvc.Formatters.Json.csproj
@@ -8,10 +8,13 @@
aspnetcore;aspnetcoremvc;json
+
+
+
+
-
diff --git a/src/Mvc/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Microsoft.AspNetCore.Mvc.WebApiCompatShim.csproj b/src/Mvc/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Microsoft.AspNetCore.Mvc.WebApiCompatShim.csproj
index 72cb71f8c2..f6b6300835 100644
--- a/src/Mvc/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Microsoft.AspNetCore.Mvc.WebApiCompatShim.csproj
+++ b/src/Mvc/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Microsoft.AspNetCore.Mvc.WebApiCompatShim.csproj
@@ -10,13 +10,16 @@ System.Web.Http.ApiController
aspnetcore;aspnetcoremvc;aspnetwebapi
+
+
+
+
-
diff --git a/src/Razor/build/dependencies.props b/src/Razor/build/dependencies.props
index b76ea87d30..683fa6e686 100644
--- a/src/Razor/build/dependencies.props
+++ b/src/Razor/build/dependencies.props
@@ -14,7 +14,6 @@
2.8.0
2.8.0
2.2.0-rtm-181106-13
- 2.2.0-rtm-181106-13
2.1.0
2.2.0-rtm-181106-13
2.2.0-rtm-181106-13
@@ -62,7 +61,6 @@
2.3.1
2.4.0
-
-
+
diff --git a/src/Razor/src/Microsoft.AspNetCore.Razor.Runtime/Microsoft.AspNetCore.Razor.Runtime.csproj b/src/Razor/src/Microsoft.AspNetCore.Razor.Runtime/Microsoft.AspNetCore.Razor.Runtime.csproj
index b58a7f9c3f..40cb287307 100644
--- a/src/Razor/src/Microsoft.AspNetCore.Razor.Runtime/Microsoft.AspNetCore.Razor.Runtime.csproj
+++ b/src/Razor/src/Microsoft.AspNetCore.Razor.Runtime/Microsoft.AspNetCore.Razor.Runtime.csproj
@@ -6,13 +6,16 @@
$(PackageTags);taghelper;taghelpers
+
+
+
+
-
diff --git a/src/Security/build/dependencies.props b/src/Security/build/dependencies.props
index 0d1a80ebb6..a732028250 100644
--- a/src/Security/build/dependencies.props
+++ b/src/Security/build/dependencies.props
@@ -28,7 +28,6 @@
2.2.0-preview3-35425
2.2.0-preview3-35425
2.2.0-preview3-35425
- 2.2.0-preview3-35425
2.2.0-preview3-35425
3.14.2
5.2.0
diff --git a/src/Security/src/Microsoft.AspNetCore.Authentication/Microsoft.AspNetCore.Authentication.csproj b/src/Security/src/Microsoft.AspNetCore.Authentication/Microsoft.AspNetCore.Authentication.csproj
index 7e3ce4eb39..ce5b4c6f93 100644
--- a/src/Security/src/Microsoft.AspNetCore.Authentication/Microsoft.AspNetCore.Authentication.csproj
+++ b/src/Security/src/Microsoft.AspNetCore.Authentication/Microsoft.AspNetCore.Authentication.csproj
@@ -8,6 +8,10 @@
aspnetcore;authentication;security
+
+
+
+
@@ -15,7 +19,6 @@
-
diff --git a/src/Security/src/Microsoft.AspNetCore.Authorization.Policy/Microsoft.AspNetCore.Authorization.Policy.csproj b/src/Security/src/Microsoft.AspNetCore.Authorization.Policy/Microsoft.AspNetCore.Authorization.Policy.csproj
index 16e4aa2622..9516b08388 100644
--- a/src/Security/src/Microsoft.AspNetCore.Authorization.Policy/Microsoft.AspNetCore.Authorization.Policy.csproj
+++ b/src/Security/src/Microsoft.AspNetCore.Authorization.Policy/Microsoft.AspNetCore.Authorization.Policy.csproj
@@ -8,13 +8,16 @@
aspnetcore;authorization
+
+
+
+
-
diff --git a/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs b/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs
index 6f63d5ca22..7333a1ce71 100644
--- a/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs
+++ b/src/Servers/HttpSys/test/FunctionalTests/ResponseCachingTests.cs
@@ -21,7 +21,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.FunctionalTests
public ResponseCachingTests()
{
- _absoluteFilePath = Directory.GetFiles(Directory.GetCurrentDirectory()).First();
+ _absoluteFilePath = Path.Combine(Directory.GetCurrentDirectory(), "Microsoft.AspNetCore.Server.HttpSys.dll");
_fileLength = new FileInfo(_absoluteFilePath).Length;
}
diff --git a/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj b/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj
index 0eeffec460..e612ba5cc8 100644
--- a/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj
+++ b/src/Servers/Kestrel/Core/src/Microsoft.AspNetCore.Server.Kestrel.Core.csproj
@@ -11,10 +11,10 @@
+
-
diff --git a/src/Shared/CertificateGeneration/CertificateManager.cs b/src/Shared/CertificateGeneration/CertificateManager.cs
new file mode 100644
index 0000000000..952cf7c36d
--- /dev/null
+++ b/src/Shared/CertificateGeneration/CertificateManager.cs
@@ -0,0 +1,951 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Security.Cryptography;
+using System.Security.Cryptography.X509Certificates;
+using System.Text;
+using System.Text.RegularExpressions;
+
+namespace Microsoft.AspNetCore.Certificates.Generation
+{
+ internal class CertificateManager
+ {
+ public const string AspNetHttpsOid = "1.3.6.1.4.1.311.84.1.1";
+ public const string AspNetHttpsOidFriendlyName = "ASP.NET Core HTTPS development certificate";
+
+ private const string ServerAuthenticationEnhancedKeyUsageOid = "1.3.6.1.5.5.7.3.1";
+ private const string ServerAuthenticationEnhancedKeyUsageOidFriendlyName = "Server Authentication";
+
+ private const string LocalhostHttpsDnsName = "localhost";
+ private const string LocalhostHttpsDistinguishedName = "CN=" + LocalhostHttpsDnsName;
+
+ public const int RSAMinimumKeySizeInBits = 2048;
+
+ private static readonly TimeSpan MaxRegexTimeout = TimeSpan.FromMinutes(1);
+ private const string CertificateSubjectRegex = "CN=(.*[^,]+).*";
+ private const string MacOSSystemKeyChain = "/Library/Keychains/System.keychain";
+ private static readonly string MacOSUserKeyChain = Environment.GetEnvironmentVariable("HOME") + "/Library/Keychains/login.keychain-db";
+ private const string MacOSFindCertificateCommandLine = "security";
+#if NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2
+ private static readonly string MacOSFindCertificateCommandLineArgumentsFormat = "find-certificate -c {0} -a -Z -p " + MacOSSystemKeyChain;
+#endif
+ private const string MacOSFindCertificateOutputRegex = "SHA-1 hash: ([0-9A-Z]+)";
+ private const string MacOSRemoveCertificateTrustCommandLine = "sudo";
+ private const string MacOSRemoveCertificateTrustCommandLineArgumentsFormat = "security remove-trusted-cert -d {0}";
+ private const string MacOSDeleteCertificateCommandLine = "sudo";
+ private const string MacOSDeleteCertificateCommandLineArgumentsFormat = "security delete-certificate -Z {0} {1}";
+ private const string MacOSTrustCertificateCommandLine = "sudo";
+#if NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2
+ private static readonly string MacOSTrustCertificateCommandLineArguments = "security add-trusted-cert -d -r trustRoot -k " + MacOSSystemKeyChain + " ";
+#endif
+ private const int UserCancelledErrorCode = 1223;
+
+ public IList ListCertificates(
+ CertificatePurpose purpose,
+ StoreName storeName,
+ StoreLocation location,
+ bool isValid,
+ bool requireExportable = true,
+ DiagnosticInformation diagnostics = null)
+ {
+ diagnostics?.Debug($"Listing '{purpose.ToString()}' certificates on '{location}\\{storeName}'.");
+ var certificates = new List();
+ try
+ {
+ using (var store = new X509Store(storeName, location))
+ {
+ store.Open(OpenFlags.ReadOnly);
+ certificates.AddRange(store.Certificates.OfType());
+ IEnumerable matchingCertificates = certificates;
+ switch (purpose)
+ {
+ case CertificatePurpose.All:
+ matchingCertificates = matchingCertificates
+ .Where(c => HasOid(c, AspNetHttpsOid));
+ break;
+ case CertificatePurpose.HTTPS:
+ matchingCertificates = matchingCertificates
+ .Where(c => HasOid(c, AspNetHttpsOid));
+ break;
+ default:
+ break;
+ }
+
+ diagnostics?.Debug(diagnostics.DescribeCertificates(matchingCertificates));
+ if (isValid)
+ {
+ // Ensure the certificate hasn't expired, has a private key and its exportable
+ // (for container/unix scenarios).
+ diagnostics?.Debug("Checking certificates for validity.");
+ var now = DateTimeOffset.Now;
+ var validCertificates = matchingCertificates
+ .Where(c => c.NotBefore <= now &&
+ now <= c.NotAfter &&
+ (!requireExportable || !RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || IsExportable(c)))
+ .ToArray();
+
+ var invalidCertificates = matchingCertificates.Except(validCertificates);
+
+ diagnostics?.Debug("Listing valid certificates");
+ diagnostics?.Debug(diagnostics.DescribeCertificates(validCertificates));
+ diagnostics?.Debug("Listing invalid certificates");
+ diagnostics?.Debug(diagnostics.DescribeCertificates(invalidCertificates));
+
+ matchingCertificates = validCertificates;
+ }
+
+ // We need to enumerate the certificates early to prevent dispoisng issues.
+ matchingCertificates = matchingCertificates.ToList();
+
+ var certificatesToDispose = certificates.Except(matchingCertificates);
+ DisposeCertificates(certificatesToDispose);
+
+ store.Close();
+
+ return (IList)matchingCertificates;
+ }
+ }
+ catch
+ {
+ DisposeCertificates(certificates);
+ certificates.Clear();
+ return certificates;
+ }
+
+ bool HasOid(X509Certificate2 certificate, string oid) =>
+ certificate.Extensions.OfType()
+ .Any(e => string.Equals(oid, e.Oid.Value, StringComparison.Ordinal));
+#if !XPLAT
+ bool IsExportable(X509Certificate2 c) =>
+ ((c.GetRSAPrivateKey() is RSACryptoServiceProvider rsaPrivateKey &&
+ rsaPrivateKey.CspKeyContainerInfo.Exportable) ||
+ (c.GetRSAPrivateKey() is RSACng cngPrivateKey &&
+ cngPrivateKey.Key.ExportPolicy == CngExportPolicies.AllowExport));
+#else
+ // Only check for RSA CryptoServiceProvider and do not fail in XPlat tooling as
+ // System.Security.Cryptography.Cng is not part of the shared framework and we don't
+ // want to bring the dependency in on CLI scenarios. This functionality will be used
+ // on CLI scenarios as part of the first run experience, so checking the exportability
+ // of the certificate is not important.
+ bool IsExportable(X509Certificate2 c) =>
+ ((c.GetRSAPrivateKey() is RSACryptoServiceProvider rsaPrivateKey &&
+ rsaPrivateKey.CspKeyContainerInfo.Exportable) || !(c.GetRSAPrivateKey() is RSACryptoServiceProvider));
+#endif
+ }
+
+ private static void DisposeCertificates(IEnumerable disposables)
+ {
+ foreach (var disposable in disposables)
+ {
+ try
+ {
+ disposable.Dispose();
+ }
+ catch
+ {
+ }
+ }
+ }
+
+#if NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2
+
+ public X509Certificate2 CreateAspNetCoreHttpsDevelopmentCertificate(DateTimeOffset notBefore, DateTimeOffset notAfter, string subjectOverride, DiagnosticInformation diagnostics = null)
+ {
+ var subject = new X500DistinguishedName(subjectOverride ?? LocalhostHttpsDistinguishedName);
+ var extensions = new List();
+ var sanBuilder = new SubjectAlternativeNameBuilder();
+ sanBuilder.AddDnsName(LocalhostHttpsDnsName);
+
+ var keyUsage = new X509KeyUsageExtension(X509KeyUsageFlags.KeyEncipherment, critical: true);
+ var enhancedKeyUsage = new X509EnhancedKeyUsageExtension(
+ new OidCollection() {
+ new Oid(
+ ServerAuthenticationEnhancedKeyUsageOid,
+ ServerAuthenticationEnhancedKeyUsageOidFriendlyName)
+ },
+ critical: true);
+
+ var basicConstraints = new X509BasicConstraintsExtension(
+ certificateAuthority: false,
+ hasPathLengthConstraint: false,
+ pathLengthConstraint: 0,
+ critical: true);
+
+ var aspNetHttpsExtension = new X509Extension(
+ new AsnEncodedData(
+ new Oid(AspNetHttpsOid, AspNetHttpsOidFriendlyName),
+ Encoding.ASCII.GetBytes(AspNetHttpsOidFriendlyName)),
+ critical: false);
+
+ extensions.Add(basicConstraints);
+ extensions.Add(keyUsage);
+ extensions.Add(enhancedKeyUsage);
+ extensions.Add(sanBuilder.Build(critical: true));
+ extensions.Add(aspNetHttpsExtension);
+
+ var certificate = CreateSelfSignedCertificate(subject, extensions, notBefore, notAfter);
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ certificate.FriendlyName = AspNetHttpsOidFriendlyName;
+ }
+
+ return certificate;
+ }
+
+ public X509Certificate2 CreateSelfSignedCertificate(
+ X500DistinguishedName subject,
+ IEnumerable extensions,
+ DateTimeOffset notBefore,
+ DateTimeOffset notAfter)
+ {
+ var key = CreateKeyMaterial(RSAMinimumKeySizeInBits);
+
+ var request = new CertificateRequest(subject, key, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
+ foreach (var extension in extensions)
+ {
+ request.CertificateExtensions.Add(extension);
+ }
+
+ return request.CreateSelfSigned(notBefore, notAfter);
+
+ RSA CreateKeyMaterial(int minimumKeySize)
+ {
+ var rsa = RSA.Create(minimumKeySize);
+ if (rsa.KeySize < minimumKeySize)
+ {
+ throw new InvalidOperationException($"Failed to create a key with a size of {minimumKeySize} bits");
+ }
+
+ return rsa;
+ }
+ }
+
+ public X509Certificate2 SaveCertificateInStore(X509Certificate2 certificate, StoreName name, StoreLocation location, DiagnosticInformation diagnostics = null)
+ {
+ diagnostics?.Debug("Saving the certificate into the certificate store.");
+ var imported = certificate;
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ // On non OSX systems we need to export the certificate and import it so that the transient
+ // key that we generated gets persisted.
+ var export = certificate.Export(X509ContentType.Pkcs12, "");
+ imported = new X509Certificate2(export, "", X509KeyStorageFlags.PersistKeySet | X509KeyStorageFlags.Exportable);
+ Array.Clear(export, 0, export.Length);
+ }
+
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ imported.FriendlyName = certificate.FriendlyName;
+ }
+
+ using (var store = new X509Store(name, location))
+ {
+ store.Open(OpenFlags.ReadWrite);
+ store.Add(imported);
+ store.Close();
+ };
+
+ return imported;
+ }
+
+ public void ExportCertificate(X509Certificate2 certificate, string path, bool includePrivateKey, string password, DiagnosticInformation diagnostics = null)
+ {
+ diagnostics?.Debug(
+ $"Exporting certificate to '{path}'",
+ includePrivateKey ? "The certificate will contain the private key" : "The certificate will not contain the private key");
+ if (includePrivateKey && password == null)
+ {
+ diagnostics?.Debug("No password was provided for the certificate.");
+ }
+
+ var targetDirectoryPath = Path.GetDirectoryName(path);
+ if (targetDirectoryPath != "")
+ {
+ diagnostics?.Debug($"Ensuring that the directory for the target exported certificate path exists '{targetDirectoryPath}'");
+ Directory.CreateDirectory(targetDirectoryPath);
+ }
+
+ byte[] bytes;
+ if (includePrivateKey)
+ {
+ try
+ {
+ diagnostics?.Debug($"Exporting the certificate including the private key.");
+ bytes = certificate.Export(X509ContentType.Pkcs12, password);
+ }
+ catch (Exception e)
+ {
+ diagnostics?.Error($"Failed to export the certificate with the private key", e);
+ throw;
+ }
+ }
+ else
+ {
+ try
+ {
+ diagnostics?.Debug($"Exporting the certificate without the private key.");
+ bytes = certificate.Export(X509ContentType.Cert);
+ }
+ catch (Exception ex)
+ {
+ diagnostics?.Error($"Failed to export the certificate without the private key", ex);
+ throw;
+ }
+ }
+ try
+ {
+ diagnostics?.Debug($"Writing exported certificate to path '{path}'.");
+ File.WriteAllBytes(path, bytes);
+ }
+ catch (Exception ex)
+ {
+ diagnostics?.Error("Failed writing the certificate to the target path", ex);
+ throw;
+ }
+ finally
+ {
+ Array.Clear(bytes, 0, bytes.Length);
+ }
+ }
+
+ public void TrustCertificate(X509Certificate2 certificate, DiagnosticInformation diagnostics = null)
+ {
+ // Strip certificate of the private key if any.
+ var publicCertificate = new X509Certificate2(certificate.Export(X509ContentType.Cert));
+
+ if (!IsTrusted(publicCertificate))
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ diagnostics?.Debug("Trusting the certificate on Windows.");
+ TrustCertificateOnWindows(certificate, publicCertificate, diagnostics);
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ diagnostics?.Debug("Trusting the certificate on MAC.");
+ TrustCertificateOnMac(publicCertificate, diagnostics);
+ }
+ }
+ }
+
+ private void TrustCertificateOnMac(X509Certificate2 publicCertificate, DiagnosticInformation diagnostics)
+ {
+ var tmpFile = Path.GetTempFileName();
+ try
+ {
+ ExportCertificate(publicCertificate, tmpFile, includePrivateKey: false, password: null);
+ diagnostics?.Debug("Running the trust command on Mac OS");
+ using (var process = Process.Start(MacOSTrustCertificateCommandLine, MacOSTrustCertificateCommandLineArguments + tmpFile))
+ {
+ process.WaitForExit();
+ if (process.ExitCode != 0)
+ {
+ throw new InvalidOperationException("There was an error trusting the certificate.");
+ }
+ }
+ }
+ finally
+ {
+ try
+ {
+ if (File.Exists(tmpFile))
+ {
+ File.Delete(tmpFile);
+ }
+ }
+ catch
+ {
+ // We don't care if we can't delete the temp file.
+ }
+ }
+ }
+
+ private static void TrustCertificateOnWindows(X509Certificate2 certificate, X509Certificate2 publicCertificate, DiagnosticInformation diagnostics = null)
+ {
+ publicCertificate.FriendlyName = certificate.FriendlyName;
+
+ using (var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser))
+ {
+ store.Open(OpenFlags.ReadWrite);
+ var existing = store.Certificates.Find(X509FindType.FindByThumbprint, publicCertificate.Thumbprint, validOnly: false);
+ if (existing.Count > 0)
+ {
+ diagnostics?.Debug("Certificate already trusted. Skipping trust step.");
+ DisposeCertificates(existing.OfType());
+ return;
+ }
+
+ try
+ {
+ diagnostics?.Debug("Adding certificate to the store.");
+ store.Add(publicCertificate);
+ }
+ catch (CryptographicException exception) when (exception.HResult == UserCancelledErrorCode)
+ {
+ diagnostics?.Debug("User cancelled the trust prompt.");
+ throw new UserCancelledTrustException();
+ }
+ store.Close();
+ };
+ }
+
+ public bool IsTrusted(X509Certificate2 certificate)
+ {
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ return ListCertificates(CertificatePurpose.HTTPS, StoreName.Root, StoreLocation.CurrentUser, isValid: true, requireExportable: false)
+ .Any(c => c.Thumbprint == certificate.Thumbprint);
+ }
+ else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
+ {
+ var subjectMatch = Regex.Match(certificate.Subject, CertificateSubjectRegex, RegexOptions.Singleline, MaxRegexTimeout);
+ if (!subjectMatch.Success)
+ {
+ throw new InvalidOperationException($"Can't determine the subject for the certificate with subject '{certificate.Subject}'.");
+ }
+ var subject = subjectMatch.Groups[1].Value;
+ using (var checkTrustProcess = Process.Start(new ProcessStartInfo(
+ MacOSFindCertificateCommandLine,
+ string.Format(MacOSFindCertificateCommandLineArgumentsFormat, subject))
+ {
+ RedirectStandardOutput = true
+ }))
+ {
+ var output = checkTrustProcess.StandardOutput.ReadToEnd();
+ checkTrustProcess.WaitForExit();
+ var matches = Regex.Matches(output, MacOSFindCertificateOutputRegex, RegexOptions.Multiline, MaxRegexTimeout);
+ var hashes = matches.OfType().Select(m => m.Groups[1].Value).ToList();
+ return hashes.Any(h => string.Equals(h, certificate.Thumbprint, StringComparison.Ordinal));
+ }
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ public void CleanupHttpsCertificates(string subject = LocalhostHttpsDistinguishedName)
+ {
+ CleanupCertificates(CertificatePurpose.HTTPS, subject);
+ }
+
+ public void CleanupCertificates(CertificatePurpose purpose, string subject)
+ {
+ // On OS X we don't have a good way to manage trusted certificates in the system keychain
+ // so we do everything by invoking the native toolchain.
+ // This has some limitations, like for example not being able to identify our custom OID extension. For that
+ // matter, when we are cleaning up certificates on the machine, we start by removing the trusted certificates.
+ // To do this, we list the certificates that we can identify on the current user personal store and we invoke
+ // the native toolchain to remove them from the sytem keychain. Once we have removed the trusted certificates,
+ // we remove the certificates from the local user store to finish up the cleanup.
+ var certificates = ListCertificates(purpose, StoreName.My, StoreLocation.CurrentUser, isValid: false);
+ foreach (var certificate in certificates)
+ {
+ RemoveCertificate(certificate, RemoveLocations.All);
+ }
+ }
+
+ public DiagnosticInformation CleanupHttpsCertificates2(string subject = LocalhostHttpsDistinguishedName)
+ {
+ return CleanupCertificates2(CertificatePurpose.HTTPS, subject);
+ }
+
+ public DiagnosticInformation CleanupCertificates2(CertificatePurpose purpose, string subject)
+ {
+ var diagnostics = new DiagnosticInformation();
+ // On OS X we don't have a good way to manage trusted certificates in the system keychain
+ // so we do everything by invoking the native toolchain.
+ // This has some limitations, like for example not being able to identify our custom OID extension. For that
+ // matter, when we are cleaning up certificates on the machine, we start by removing the trusted certificates.
+ // To do this, we list the certificates that we can identify on the current user personal store and we invoke
+ // the native toolchain to remove them from the sytem keychain. Once we have removed the trusted certificates,
+ // we remove the certificates from the local user store to finish up the cleanup.
+ var certificates = ListCertificates(purpose, StoreName.My, StoreLocation.CurrentUser, isValid: false, requireExportable: true, diagnostics);
+ foreach (var certificate in certificates)
+ {
+ RemoveCertificate(certificate, RemoveLocations.All, diagnostics);
+ }
+
+ return diagnostics;
+ }
+
+ public void RemoveAllCertificates(CertificatePurpose purpose, StoreName storeName, StoreLocation storeLocation, string subject = null)
+ {
+ var certificates = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ?
+ ListCertificates(purpose, StoreName.My, StoreLocation.CurrentUser, isValid: false) :
+ ListCertificates(purpose, storeName, storeLocation, isValid: false);
+ var certificatesWithName = subject == null ? certificates : certificates.Where(c => c.Subject == subject);
+
+ var removeLocation = storeName == StoreName.My ? RemoveLocations.Local : RemoveLocations.Trusted;
+
+ foreach (var certificate in certificates)
+ {
+ RemoveCertificate(certificate, removeLocation);
+ }
+
+ DisposeCertificates(certificates);
+ }
+
+ private void RemoveCertificate(X509Certificate2 certificate, RemoveLocations locations, DiagnosticInformation diagnostics = null)
+ {
+ switch (locations)
+ {
+ case RemoveLocations.Undefined:
+ throw new InvalidOperationException($"'{nameof(RemoveLocations.Undefined)}' is not a valid location.");
+ case RemoveLocations.Local:
+ RemoveCertificateFromUserStore(certificate, diagnostics);
+ break;
+ case RemoveLocations.Trusted when !RuntimeInformation.IsOSPlatform(OSPlatform.Linux):
+ RemoveCertificateFromTrustedRoots(certificate, diagnostics);
+ break;
+ case RemoveLocations.All:
+ if (!RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
+ {
+ RemoveCertificateFromTrustedRoots(certificate, diagnostics);
+ }
+ RemoveCertificateFromUserStore(certificate, diagnostics);
+ break;
+ default:
+ throw new InvalidOperationException("Invalid location.");
+ }
+ }
+
+ private static void RemoveCertificateFromUserStore(X509Certificate2 certificate, DiagnosticInformation diagnostics)
+ {
+ diagnostics?.Debug($"Trying to remove certificate with thumbprint '{certificate.Thumbprint}' from certificate store '{StoreLocation.CurrentUser}\\{StoreName.My}'.");
+ using (var store = new X509Store(StoreName.My, StoreLocation.CurrentUser))
+ {
+ store.Open(OpenFlags.ReadWrite);
+ var matching = store.Certificates
+ .OfType()
+ .Single(c => c.SerialNumber == certificate.SerialNumber);
+
+ store.Remove(matching);
+ store.Close();
+ }
+ }
+
+ private void RemoveCertificateFromTrustedRoots(X509Certificate2 certificate, DiagnosticInformation diagnostics)
+ {
+ diagnostics?.Debug($"Trying to remove certificate with thumbprint '{certificate.Thumbprint}' from certificate store '{StoreLocation.CurrentUser}\\{StoreName.Root}'.");
+ if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
+ {
+ using (var store = new X509Store(StoreName.Root, StoreLocation.CurrentUser))
+ {
+ store.Open(OpenFlags.ReadWrite);
+ var matching = store.Certificates
+ .OfType()
+ .SingleOrDefault(c => c.SerialNumber == certificate.SerialNumber);
+
+ if (matching != null)
+ {
+ store.Remove(matching);
+ }
+
+ store.Close();
+ }
+ }
+ else
+ {
+ if (IsTrusted(certificate)) // On OSX this check just ensures its on the system keychain
+ {
+ try
+ {
+ diagnostics?.Debug("Trying to remove the certificate trust rule.");
+ RemoveCertificateTrustRule(certificate);
+ }
+ catch
+ {
+ diagnostics?.Debug("Failed to remove the certificate trust rule.");
+ // We don't care if we fail to remove the trust rule if
+ // for some reason the certificate became untrusted.
+ // The delete command will fail if the certificate is
+ // trusted.
+ }
+ RemoveCertificateFromKeyChain(MacOSSystemKeyChain, certificate);
+ }
+ else
+ {
+ diagnostics?.Debug("The certificate was not trusted.");
+ }
+ }
+ }
+
+ private static void RemoveCertificateTrustRule(X509Certificate2 certificate)
+ {
+ var certificatePath = Path.GetTempFileName();
+ try
+ {
+ var certBytes = certificate.Export(X509ContentType.Cert);
+ File.WriteAllBytes(certificatePath, certBytes);
+ var processInfo = new ProcessStartInfo(
+ MacOSRemoveCertificateTrustCommandLine,
+ string.Format(
+ MacOSRemoveCertificateTrustCommandLineArgumentsFormat,
+ certificatePath
+ ));
+ using (var process = Process.Start(processInfo))
+ {
+ process.WaitForExit();
+ }
+ }
+ finally
+ {
+ try
+ {
+ if (File.Exists(certificatePath))
+ {
+ File.Delete(certificatePath);
+ }
+ }
+ catch
+ {
+ // We don't care about failing to do clean-up on a temp file.
+ }
+ }
+ }
+
+ private static void RemoveCertificateFromKeyChain(string keyChain, X509Certificate2 certificate)
+ {
+ var processInfo = new ProcessStartInfo(
+ MacOSDeleteCertificateCommandLine,
+ string.Format(
+ MacOSDeleteCertificateCommandLineArgumentsFormat,
+ certificate.Thumbprint.ToUpperInvariant(),
+ keyChain
+ ))
+ {
+ RedirectStandardOutput = true,
+ RedirectStandardError = true
+ };
+
+ using (var process = Process.Start(processInfo))
+ {
+ var output = process.StandardOutput.ReadToEnd() + process.StandardError.ReadToEnd();
+ process.WaitForExit();
+
+ if (process.ExitCode != 0)
+ {
+ throw new InvalidOperationException($@"There was an error removing the certificate with thumbprint '{certificate.Thumbprint}'.
+
+{output}");
+ }
+ }
+ }
+
+ public EnsureCertificateResult EnsureAspNetCoreHttpsDevelopmentCertificate(
+ DateTimeOffset notBefore,
+ DateTimeOffset notAfter,
+ string path = null,
+ bool trust = false,
+ bool includePrivateKey = false,
+ string password = null,
+ string subject = LocalhostHttpsDistinguishedName)
+ {
+ return EnsureValidCertificateExists(notBefore, notAfter, CertificatePurpose.HTTPS, path, trust, includePrivateKey, password, subject);
+ }
+
+ public EnsureCertificateResult EnsureValidCertificateExists(
+ DateTimeOffset notBefore,
+ DateTimeOffset notAfter,
+ CertificatePurpose purpose,
+ string path = null,
+ bool trust = false,
+ bool includePrivateKey = false,
+ string password = null,
+ string subjectOverride = null)
+ {
+ if (purpose == CertificatePurpose.All)
+ {
+ throw new ArgumentException("The certificate must have a specific purpose.");
+ }
+
+ var certificates = ListCertificates(purpose, StoreName.My, StoreLocation.CurrentUser, isValid: true).Concat(
+ ListCertificates(purpose, StoreName.My, StoreLocation.LocalMachine, isValid: true));
+
+ certificates = subjectOverride == null ? certificates : certificates.Where(c => c.Subject == subjectOverride);
+
+ var result = EnsureCertificateResult.Succeeded;
+
+ X509Certificate2 certificate = null;
+ if (certificates.Count() > 0)
+ {
+ certificate = certificates.FirstOrDefault();
+ result = EnsureCertificateResult.ValidCertificatePresent;
+ }
+ else
+ {
+ try
+ {
+ switch (purpose)
+ {
+ case CertificatePurpose.All:
+ throw new InvalidOperationException("The certificate must have a specific purpose.");
+ case CertificatePurpose.HTTPS:
+ certificate = CreateAspNetCoreHttpsDevelopmentCertificate(notBefore, notAfter, subjectOverride);
+ break;
+ default:
+ throw new InvalidOperationException("The certificate must have a purpose.");
+ }
+ }
+ catch
+ {
+ return EnsureCertificateResult.ErrorCreatingTheCertificate;
+ }
+
+ try
+ {
+ certificate = SaveCertificateInStore(certificate, StoreName.My, StoreLocation.CurrentUser);
+ }
+ catch
+ {
+ return EnsureCertificateResult.ErrorSavingTheCertificateIntoTheCurrentUserPersonalStore;
+ }
+ }
+ if (path != null)
+ {
+ try
+ {
+ ExportCertificate(certificate, path, includePrivateKey, password);
+ }
+ catch
+ {
+ return EnsureCertificateResult.ErrorExportingTheCertificate;
+ }
+ }
+
+ if ((RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) && trust)
+ {
+ try
+ {
+ TrustCertificate(certificate);
+ }
+ catch (UserCancelledTrustException)
+ {
+ return EnsureCertificateResult.UserCancelledTrustStep;
+ }
+ catch
+ {
+ return EnsureCertificateResult.FailedToTrustTheCertificate;
+ }
+ }
+
+ return result;
+ }
+
+ // This is just to avoid breaking changes across repos.
+ // Will be renamed back to EnsureAspNetCoreHttpsDevelopmentCertificate once updates are made elsewhere.
+ public DetailedEnsureCertificateResult EnsureAspNetCoreHttpsDevelopmentCertificate2(
+ DateTimeOffset notBefore,
+ DateTimeOffset notAfter,
+ string path = null,
+ bool trust = false,
+ bool includePrivateKey = false,
+ string password = null,
+ string subject = LocalhostHttpsDistinguishedName)
+ {
+ return EnsureValidCertificateExists2(notBefore, notAfter, CertificatePurpose.HTTPS, path, trust, includePrivateKey, password, subject);
+ }
+
+ public DetailedEnsureCertificateResult EnsureValidCertificateExists2(
+ DateTimeOffset notBefore,
+ DateTimeOffset notAfter,
+ CertificatePurpose purpose,
+ string path,
+ bool trust,
+ bool includePrivateKey,
+ string password,
+ string subject)
+ {
+ if (purpose == CertificatePurpose.All)
+ {
+ throw new ArgumentException("The certificate must have a specific purpose.");
+ }
+
+ var result = new DetailedEnsureCertificateResult();
+
+ var certificates = ListCertificates(purpose, StoreName.My, StoreLocation.CurrentUser, isValid: true, requireExportable: true, result.Diagnostics).Concat(
+ ListCertificates(purpose, StoreName.My, StoreLocation.LocalMachine, isValid: true, requireExportable: true, result.Diagnostics));
+
+ var filteredCertificates = subject == null ? certificates : certificates.Where(c => c.Subject == subject);
+ if (subject != null)
+ {
+ var excludedCertificates = certificates.Except(filteredCertificates);
+
+ result.Diagnostics.Debug($"Filtering found certificates to those with a subject equal to '{subject}'");
+ result.Diagnostics.Debug(result.Diagnostics.DescribeCertificates(filteredCertificates));
+ result.Diagnostics.Debug($"Listing certificates excluded from consideration.");
+ result.Diagnostics.Debug(result.Diagnostics.DescribeCertificates(excludedCertificates));
+ }
+ else
+ {
+ result.Diagnostics.Debug("Skipped filtering certificates by subject.");
+ }
+
+ certificates = filteredCertificates;
+
+ result.ResultCode = EnsureCertificateResult.Succeeded;
+
+ X509Certificate2 certificate = null;
+ if (certificates.Count() > 0)
+ {
+ result.Diagnostics.Debug("Found valid certificates present on the machine.");
+ result.Diagnostics.Debug(result.Diagnostics.DescribeCertificates(certificates));
+ certificate = certificates.First();
+ result.Diagnostics.Debug("Selected certificate");
+ result.Diagnostics.Debug(result.Diagnostics.DescribeCertificates(certificate));
+ result.ResultCode = EnsureCertificateResult.ValidCertificatePresent;
+ }
+ else
+ {
+ result.Diagnostics.Debug("No valid certificates present on this machine. Trying to create one.");
+ try
+ {
+ switch (purpose)
+ {
+ case CertificatePurpose.All:
+ throw new InvalidOperationException("The certificate must have a specific purpose.");
+ case CertificatePurpose.HTTPS:
+ certificate = CreateAspNetCoreHttpsDevelopmentCertificate(notBefore, notAfter, subject, result.Diagnostics);
+ break;
+ default:
+ throw new InvalidOperationException("The certificate must have a purpose.");
+ }
+ }
+ catch (Exception e)
+ {
+ result.Diagnostics.Error("Error creating the certificate.", e);
+ result.ResultCode = EnsureCertificateResult.ErrorCreatingTheCertificate;
+ return result;
+ }
+
+ try
+ {
+ certificate = SaveCertificateInStore(certificate, StoreName.My, StoreLocation.CurrentUser, result.Diagnostics);
+ }
+ catch (Exception e)
+ {
+ result.Diagnostics.Error($"Error saving the certificate in the certificate store '{StoreLocation.CurrentUser}\\{StoreName.My}'.", e);
+ result.ResultCode = EnsureCertificateResult.ErrorSavingTheCertificateIntoTheCurrentUserPersonalStore;
+ return result;
+ }
+ }
+ if (path != null)
+ {
+ result.Diagnostics.Debug("Trying to export the certificate.");
+ result.Diagnostics.Debug(result.Diagnostics.DescribeCertificates(certificate));
+ try
+ {
+ ExportCertificate(certificate, path, includePrivateKey, password, result.Diagnostics);
+ }
+ catch (Exception e)
+ {
+ result.Diagnostics.Error("An error ocurred exporting the certificate.", e);
+ result.ResultCode = EnsureCertificateResult.ErrorExportingTheCertificate;
+ return result;
+ }
+ }
+
+ if ((RuntimeInformation.IsOSPlatform(OSPlatform.Windows) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) && trust)
+ {
+ try
+ {
+ result.Diagnostics.Debug("Trying to export the certificate.");
+ TrustCertificate(certificate, result.Diagnostics);
+ }
+ catch (UserCancelledTrustException)
+ {
+ result.Diagnostics.Error("The user cancelled trusting the certificate.", null);
+ result.ResultCode = EnsureCertificateResult.UserCancelledTrustStep;
+ return result;
+ }
+ catch (Exception e)
+ {
+ result.Diagnostics.Error("There was an error trusting the certificate.", e);
+ result.ResultCode = EnsureCertificateResult.FailedToTrustTheCertificate;
+ return result;
+ }
+ }
+
+ return result;
+ }
+
+ private class UserCancelledTrustException : Exception
+ {
+ }
+
+ private enum RemoveLocations
+ {
+ Undefined,
+ Local,
+ Trusted,
+ All
+ }
+
+ internal class DetailedEnsureCertificateResult
+ {
+ public EnsureCertificateResult ResultCode { get; set; }
+ public DiagnosticInformation Diagnostics { get; set; } = new DiagnosticInformation();
+ }
+#endif
+
+ internal class DiagnosticInformation
+ {
+ public IList Messages { get; } = new List();
+
+ public IList Exceptions { get; } = new List();
+
+ internal void Debug(params string[] messages)
+ {
+ foreach (var message in messages)
+ {
+ Messages.Add(message);
+ }
+ }
+
+ internal string[] DescribeCertificates(params X509Certificate2[] certificates)
+ {
+ return DescribeCertificates(certificates.AsEnumerable());
+ }
+
+ internal string[] DescribeCertificates(IEnumerable certificates)
+ {
+ var result = new List();
+ result.Add($"'{certificates.Count()}' found matching the criteria.");
+ result.Add($"SUBJECT - THUMBPRINT - NOT BEFORE - EXPIRES - HAS PRIVATE KEY");
+ foreach (var certificate in certificates)
+ {
+ result.Add(DescribeCertificate(certificate));
+ }
+
+ return result.ToArray();
+ }
+
+ private static string DescribeCertificate(X509Certificate2 certificate) =>
+ $"{certificate.Subject} - {certificate.Thumbprint} - {certificate.NotBefore} - {certificate.NotAfter} - {certificate.HasPrivateKey}";
+
+ internal void Error(string preamble, Exception e)
+ {
+ Messages.Add(preamble);
+ if (Exceptions.Count > 0 && Exceptions[Exceptions.Count - 1] == e)
+ {
+ return;
+ }
+
+ var ex = e;
+ while (ex != null)
+ {
+ Messages.Add("Exception message: " + ex.Message);
+ ex = ex.InnerException;
+ }
+
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/CertificateGeneration/CertificatePurpose.cs b/src/Shared/CertificateGeneration/CertificatePurpose.cs
new file mode 100644
index 0000000000..7b3231f80d
--- /dev/null
+++ b/src/Shared/CertificateGeneration/CertificatePurpose.cs
@@ -0,0 +1,11 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+namespace Microsoft.AspNetCore.Certificates.Generation
+{
+ internal enum CertificatePurpose
+ {
+ All,
+ HTTPS
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/CertificateGeneration/EnsureCertificateResult.cs b/src/Shared/CertificateGeneration/EnsureCertificateResult.cs
new file mode 100644
index 0000000000..84c495249d
--- /dev/null
+++ b/src/Shared/CertificateGeneration/EnsureCertificateResult.cs
@@ -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.
+
+#if NETCOREAPP2_0 || NETCOREAPP2_1 || NETCOREAPP2_2
+
+namespace Microsoft.AspNetCore.Certificates.Generation
+{
+ internal enum EnsureCertificateResult
+ {
+ Succeeded = 1,
+ ValidCertificatePresent,
+ ErrorCreatingTheCertificate,
+ ErrorSavingTheCertificateIntoTheCurrentUserPersonalStore,
+ ErrorExportingTheCertificate,
+ FailedToTrustTheCertificate,
+ UserCancelledTrustStep
+ }
+}
+
+#endif
\ No newline at end of file
diff --git a/src/Shared/ClosedGenericMatcher/ClosedGenericMatcher.cs b/src/Shared/ClosedGenericMatcher/ClosedGenericMatcher.cs
new file mode 100644
index 0000000000..f234c2edbc
--- /dev/null
+++ b/src/Shared/ClosedGenericMatcher/ClosedGenericMatcher.cs
@@ -0,0 +1,106 @@
+// 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.Linq;
+using System.Reflection;
+
+namespace Microsoft.Extensions.Internal
+{
+ ///
+ /// Helper related to generic interface definitions and implementing classes.
+ ///
+ internal static class ClosedGenericMatcher
+ {
+ ///
+ /// Determine whether is or implements a closed generic
+ /// created from .
+ ///
+ /// The of interest.
+ /// The open generic to match. Usually an interface.
+ ///
+ /// The closed generic created from that
+ /// is or implements. null if the two s have no such
+ /// relationship.
+ ///
+ ///
+ /// This method will return if is
+ /// typeof(KeyValuePair{,}), and is
+ /// typeof(KeyValuePair{string, object}).
+ ///
+ public static Type ExtractGenericInterface(Type queryType, Type interfaceType)
+ {
+ if (queryType == null)
+ {
+ throw new ArgumentNullException(nameof(queryType));
+ }
+
+ if (interfaceType == null)
+ {
+ throw new ArgumentNullException(nameof(interfaceType));
+ }
+
+ if (IsGenericInstantiation(queryType, interfaceType))
+ {
+ // queryType matches (i.e. is a closed generic type created from) the open generic type.
+ return queryType;
+ }
+
+ // Otherwise check all interfaces the type implements for a match.
+ // - If multiple different generic instantiations exists, we want the most derived one.
+ // - If that doesn't break the tie, then we sort alphabetically so that it's deterministic.
+ //
+ // We do this by looking at interfaces on the type, and recursing to the base type
+ // if we don't find any matches.
+ return GetGenericInstantiation(queryType, interfaceType);
+ }
+
+ private static bool IsGenericInstantiation(Type candidate, Type interfaceType)
+ {
+ return
+ candidate.GetTypeInfo().IsGenericType &&
+ candidate.GetGenericTypeDefinition() == interfaceType;
+ }
+
+ private static Type GetGenericInstantiation(Type queryType, Type interfaceType)
+ {
+ Type bestMatch = null;
+ var interfaces = queryType.GetInterfaces();
+ foreach (var @interface in interfaces)
+ {
+ if (IsGenericInstantiation(@interface, interfaceType))
+ {
+ if (bestMatch == null)
+ {
+ bestMatch = @interface;
+ }
+ else if (StringComparer.Ordinal.Compare(@interface.FullName, bestMatch.FullName) < 0)
+ {
+ bestMatch = @interface;
+ }
+ else
+ {
+ // There are two matches at this level of the class hierarchy, but @interface is after
+ // bestMatch in the sort order.
+ }
+ }
+ }
+
+ if (bestMatch != null)
+ {
+ return bestMatch;
+ }
+
+ // BaseType will be null for object and interfaces, which means we've reached 'bottom'.
+ var baseType = queryType?.GetTypeInfo().BaseType;
+ if (baseType == null)
+ {
+ return null;
+ }
+ else
+ {
+ return GetGenericInstantiation(baseType, interfaceType);
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/CopyOnWriteDictionary/CopyOnWriteDictionary.cs b/src/Shared/CopyOnWriteDictionary/CopyOnWriteDictionary.cs
new file mode 100644
index 0000000000..1408059ad9
--- /dev/null
+++ b/src/Shared/CopyOnWriteDictionary/CopyOnWriteDictionary.cs
@@ -0,0 +1,155 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections;
+using System.Collections.Generic;
+
+namespace Microsoft.Extensions.Internal
+{
+ internal class CopyOnWriteDictionary : IDictionary
+ {
+ private readonly IDictionary _sourceDictionary;
+ private readonly IEqualityComparer _comparer;
+ private IDictionary _innerDictionary;
+
+ public CopyOnWriteDictionary(
+ IDictionary sourceDictionary,
+ IEqualityComparer comparer)
+ {
+ if (sourceDictionary == null)
+ {
+ throw new ArgumentNullException(nameof(sourceDictionary));
+ }
+
+ if (comparer == null)
+ {
+ throw new ArgumentNullException(nameof(comparer));
+ }
+
+ _sourceDictionary = sourceDictionary;
+ _comparer = comparer;
+ }
+
+ private IDictionary ReadDictionary
+ {
+ get
+ {
+ return _innerDictionary ?? _sourceDictionary;
+ }
+ }
+
+ private IDictionary WriteDictionary
+ {
+ get
+ {
+ if (_innerDictionary == null)
+ {
+ _innerDictionary = new Dictionary(_sourceDictionary,
+ _comparer);
+ }
+
+ return _innerDictionary;
+ }
+ }
+
+ public virtual ICollection Keys
+ {
+ get
+ {
+ return ReadDictionary.Keys;
+ }
+ }
+
+ public virtual ICollection Values
+ {
+ get
+ {
+ return ReadDictionary.Values;
+ }
+ }
+
+ public virtual int Count
+ {
+ get
+ {
+ return ReadDictionary.Count;
+ }
+ }
+
+ public virtual bool IsReadOnly
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public virtual TValue this[TKey key]
+ {
+ get
+ {
+ return ReadDictionary[key];
+ }
+ set
+ {
+ WriteDictionary[key] = value;
+ }
+ }
+
+ public virtual bool ContainsKey(TKey key)
+ {
+ return ReadDictionary.ContainsKey(key);
+ }
+
+ public virtual void Add(TKey key, TValue value)
+ {
+ WriteDictionary.Add(key, value);
+ }
+
+ public virtual bool Remove(TKey key)
+ {
+ return WriteDictionary.Remove(key);
+ }
+
+ public virtual bool TryGetValue(TKey key, out TValue value)
+ {
+ return ReadDictionary.TryGetValue(key, out value);
+ }
+
+ public virtual void Add(KeyValuePair item)
+ {
+ WriteDictionary.Add(item);
+ }
+
+ public virtual void Clear()
+ {
+ WriteDictionary.Clear();
+ }
+
+ public virtual bool Contains(KeyValuePair item)
+ {
+ return ReadDictionary.Contains(item);
+ }
+
+ public virtual void CopyTo(KeyValuePair[] array, int arrayIndex)
+ {
+ ReadDictionary.CopyTo(array, arrayIndex);
+ }
+
+ public bool Remove(KeyValuePair item)
+ {
+ return WriteDictionary.Remove(item);
+ }
+
+ public virtual IEnumerator> GetEnumerator()
+ {
+ return ReadDictionary.GetEnumerator();
+ }
+
+ IEnumerator IEnumerable.GetEnumerator()
+ {
+ return GetEnumerator();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/CopyOnWriteDictionary/CopyOnWriteDictionaryHolder.cs b/src/Shared/CopyOnWriteDictionary/CopyOnWriteDictionaryHolder.cs
new file mode 100644
index 0000000000..7cd935e940
--- /dev/null
+++ b/src/Shared/CopyOnWriteDictionary/CopyOnWriteDictionaryHolder.cs
@@ -0,0 +1,166 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+
+namespace Microsoft.Extensions.Internal
+{
+ internal struct CopyOnWriteDictionaryHolder
+ {
+ private readonly Dictionary _source;
+ private Dictionary _copy;
+
+ public CopyOnWriteDictionaryHolder(Dictionary source)
+ {
+ if (source == null)
+ {
+ throw new ArgumentNullException(nameof(source));
+ }
+
+ _source = source;
+ _copy = null;
+ }
+
+ public CopyOnWriteDictionaryHolder(CopyOnWriteDictionaryHolder source)
+ {
+ _source = source._copy ?? source._source;
+ _copy = null;
+ }
+
+ public bool HasBeenCopied => _copy != null;
+
+ public Dictionary ReadDictionary
+ {
+ get
+ {
+ if (_copy != null)
+ {
+ return _copy;
+ }
+ else if (_source != null)
+ {
+ return _source;
+ }
+ else
+ {
+ // Default-Constructor case
+ _copy = new Dictionary();
+ return _copy;
+ }
+ }
+ }
+
+ public Dictionary WriteDictionary
+ {
+ get
+ {
+ if (_copy == null && _source == null)
+ {
+ // Default-Constructor case
+ _copy = new Dictionary();
+ }
+ else if (_copy == null)
+ {
+ _copy = new Dictionary(_source, _source.Comparer);
+ }
+
+ return _copy;
+ }
+ }
+
+ public Dictionary.KeyCollection Keys
+ {
+ get
+ {
+ return ReadDictionary.Keys;
+ }
+ }
+
+ public Dictionary.ValueCollection Values
+ {
+ get
+ {
+ return ReadDictionary.Values;
+ }
+ }
+
+ public int Count
+ {
+ get
+ {
+ return ReadDictionary.Count;
+ }
+ }
+
+ public bool IsReadOnly
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ public TValue this[TKey key]
+ {
+ get
+ {
+ return ReadDictionary[key];
+ }
+ set
+ {
+ WriteDictionary[key] = value;
+ }
+ }
+
+ public bool ContainsKey(TKey key)
+ {
+ return ReadDictionary.ContainsKey(key);
+ }
+
+ public void Add(TKey key, TValue value)
+ {
+ WriteDictionary.Add(key, value);
+ }
+
+ public bool Remove(TKey key)
+ {
+ return WriteDictionary.Remove(key);
+ }
+
+ public bool TryGetValue(TKey key, out TValue value)
+ {
+ return ReadDictionary.TryGetValue(key, out value);
+ }
+
+ public void Add(KeyValuePair item)
+ {
+ ((ICollection>)WriteDictionary).Add(item);
+ }
+
+ public void Clear()
+ {
+ WriteDictionary.Clear();
+ }
+
+ public bool Contains(KeyValuePair item)
+ {
+ return ((ICollection>)ReadDictionary).Contains(item);
+ }
+
+ public void CopyTo(KeyValuePair[] array, int arrayIndex)
+ {
+ ((ICollection>)ReadDictionary).CopyTo(array, arrayIndex);
+ }
+
+ public bool Remove(KeyValuePair item)
+ {
+ return ((ICollection>)WriteDictionary).Remove(item);
+ }
+
+ public Dictionary.Enumerator GetEnumerator()
+ {
+ return ReadDictionary.GetEnumerator();
+ }
+ }
+}
diff --git a/src/Shared/ObjectMethodExecutor/AwaitableInfo.cs b/src/Shared/ObjectMethodExecutor/AwaitableInfo.cs
new file mode 100644
index 0000000000..431b83a6e5
--- /dev/null
+++ b/src/Shared/ObjectMethodExecutor/AwaitableInfo.cs
@@ -0,0 +1,127 @@
+// 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.Linq;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+
+namespace Microsoft.Extensions.Internal
+{
+ internal struct AwaitableInfo
+ {
+ public Type AwaiterType { get; }
+ public PropertyInfo AwaiterIsCompletedProperty { get; }
+ public MethodInfo AwaiterGetResultMethod { get; }
+ public MethodInfo AwaiterOnCompletedMethod { get; }
+ public MethodInfo AwaiterUnsafeOnCompletedMethod { get; }
+ public Type ResultType { get; }
+ public MethodInfo GetAwaiterMethod { get; }
+
+ public AwaitableInfo(
+ Type awaiterType,
+ PropertyInfo awaiterIsCompletedProperty,
+ MethodInfo awaiterGetResultMethod,
+ MethodInfo awaiterOnCompletedMethod,
+ MethodInfo awaiterUnsafeOnCompletedMethod,
+ Type resultType,
+ MethodInfo getAwaiterMethod)
+ {
+ AwaiterType = awaiterType;
+ AwaiterIsCompletedProperty = awaiterIsCompletedProperty;
+ AwaiterGetResultMethod = awaiterGetResultMethod;
+ AwaiterOnCompletedMethod = awaiterOnCompletedMethod;
+ AwaiterUnsafeOnCompletedMethod = awaiterUnsafeOnCompletedMethod;
+ ResultType = resultType;
+ GetAwaiterMethod = getAwaiterMethod;
+ }
+
+ public static bool IsTypeAwaitable(Type type, out AwaitableInfo awaitableInfo)
+ {
+ // Based on Roslyn code: http://source.roslyn.io/#Microsoft.CodeAnalysis.Workspaces/Shared/Extensions/ISymbolExtensions.cs,db4d48ba694b9347
+
+ // Awaitable must have method matching "object GetAwaiter()"
+ var getAwaiterMethod = type.GetRuntimeMethods().FirstOrDefault(m =>
+ m.Name.Equals("GetAwaiter", StringComparison.OrdinalIgnoreCase)
+ && m.GetParameters().Length == 0
+ && m.ReturnType != null);
+ if (getAwaiterMethod == null)
+ {
+ awaitableInfo = default(AwaitableInfo);
+ return false;
+ }
+
+ var awaiterType = getAwaiterMethod.ReturnType;
+
+ // Awaiter must have property matching "bool IsCompleted { get; }"
+ var isCompletedProperty = awaiterType.GetRuntimeProperties().FirstOrDefault(p =>
+ p.Name.Equals("IsCompleted", StringComparison.OrdinalIgnoreCase)
+ && p.PropertyType == typeof(bool)
+ && p.GetMethod != null);
+ if (isCompletedProperty == null)
+ {
+ awaitableInfo = default(AwaitableInfo);
+ return false;
+ }
+
+ // Awaiter must implement INotifyCompletion
+ var awaiterInterfaces = awaiterType.GetInterfaces();
+ var implementsINotifyCompletion = awaiterInterfaces.Any(t => t == typeof(INotifyCompletion));
+ if (!implementsINotifyCompletion)
+ {
+ awaitableInfo = default(AwaitableInfo);
+ return false;
+ }
+
+ // INotifyCompletion supplies a method matching "void OnCompleted(Action action)"
+ var iNotifyCompletionMap = awaiterType
+ .GetTypeInfo()
+ .GetRuntimeInterfaceMap(typeof(INotifyCompletion));
+ var onCompletedMethod = iNotifyCompletionMap.InterfaceMethods.Single(m =>
+ m.Name.Equals("OnCompleted", StringComparison.OrdinalIgnoreCase)
+ && m.ReturnType == typeof(void)
+ && m.GetParameters().Length == 1
+ && m.GetParameters()[0].ParameterType == typeof(Action));
+
+ // Awaiter optionally implements ICriticalNotifyCompletion
+ var implementsICriticalNotifyCompletion = awaiterInterfaces.Any(t => t == typeof(ICriticalNotifyCompletion));
+ MethodInfo unsafeOnCompletedMethod;
+ if (implementsICriticalNotifyCompletion)
+ {
+ // ICriticalNotifyCompletion supplies a method matching "void UnsafeOnCompleted(Action action)"
+ var iCriticalNotifyCompletionMap = awaiterType
+ .GetTypeInfo()
+ .GetRuntimeInterfaceMap(typeof(ICriticalNotifyCompletion));
+ unsafeOnCompletedMethod = iCriticalNotifyCompletionMap.InterfaceMethods.Single(m =>
+ m.Name.Equals("UnsafeOnCompleted", StringComparison.OrdinalIgnoreCase)
+ && m.ReturnType == typeof(void)
+ && m.GetParameters().Length == 1
+ && m.GetParameters()[0].ParameterType == typeof(Action));
+ }
+ else
+ {
+ unsafeOnCompletedMethod = null;
+ }
+
+ // Awaiter must have method matching "void GetResult" or "T GetResult()"
+ var getResultMethod = awaiterType.GetRuntimeMethods().FirstOrDefault(m =>
+ m.Name.Equals("GetResult")
+ && m.GetParameters().Length == 0);
+ if (getResultMethod == null)
+ {
+ awaitableInfo = default(AwaitableInfo);
+ return false;
+ }
+
+ awaitableInfo = new AwaitableInfo(
+ awaiterType,
+ isCompletedProperty,
+ getResultMethod,
+ onCompletedMethod,
+ unsafeOnCompletedMethod,
+ getResultMethod.ReturnType,
+ getAwaiterMethod);
+ return true;
+ }
+ }
+}
diff --git a/src/Shared/ObjectMethodExecutor/CoercedAwaitableInfo.cs b/src/Shared/ObjectMethodExecutor/CoercedAwaitableInfo.cs
new file mode 100644
index 0000000000..4e48ef09a1
--- /dev/null
+++ b/src/Shared/ObjectMethodExecutor/CoercedAwaitableInfo.cs
@@ -0,0 +1,55 @@
+// 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.Linq.Expressions;
+
+namespace Microsoft.Extensions.Internal
+{
+ internal struct CoercedAwaitableInfo
+ {
+ public AwaitableInfo AwaitableInfo { get; }
+ public Expression CoercerExpression { get; }
+ public Type CoercerResultType { get; }
+ public bool RequiresCoercion => CoercerExpression != null;
+
+ public CoercedAwaitableInfo(AwaitableInfo awaitableInfo)
+ {
+ AwaitableInfo = awaitableInfo;
+ CoercerExpression = null;
+ CoercerResultType = null;
+ }
+
+ public CoercedAwaitableInfo(Expression coercerExpression, Type coercerResultType, AwaitableInfo coercedAwaitableInfo)
+ {
+ CoercerExpression = coercerExpression;
+ CoercerResultType = coercerResultType;
+ AwaitableInfo = coercedAwaitableInfo;
+ }
+
+ public static bool IsTypeAwaitable(Type type, out CoercedAwaitableInfo info)
+ {
+ if (AwaitableInfo.IsTypeAwaitable(type, out var directlyAwaitableInfo))
+ {
+ info = new CoercedAwaitableInfo(directlyAwaitableInfo);
+ return true;
+ }
+
+ // It's not directly awaitable, but maybe we can coerce it.
+ // Currently we support coercing FSharpAsync.
+ if (ObjectMethodExecutorFSharpSupport.TryBuildCoercerFromFSharpAsyncToAwaitable(type,
+ out var coercerExpression,
+ out var coercerResultType))
+ {
+ if (AwaitableInfo.IsTypeAwaitable(coercerResultType, out var coercedAwaitableInfo))
+ {
+ info = new CoercedAwaitableInfo(coercerExpression, coercerResultType, coercedAwaitableInfo);
+ return true;
+ }
+ }
+
+ info = default(CoercedAwaitableInfo);
+ return false;
+ }
+ }
+}
diff --git a/src/Shared/ObjectMethodExecutor/ObjectMethodExecutor.cs b/src/Shared/ObjectMethodExecutor/ObjectMethodExecutor.cs
new file mode 100644
index 0000000000..f8e5b70f0d
--- /dev/null
+++ b/src/Shared/ObjectMethodExecutor/ObjectMethodExecutor.cs
@@ -0,0 +1,340 @@
+// Copyright (c) .NET Foundation. All rights reserved.
+// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
+
+using System;
+using System.Collections.Generic;
+using System.Linq.Expressions;
+using System.Reflection;
+
+namespace Microsoft.Extensions.Internal
+{
+ internal class ObjectMethodExecutor
+ {
+ private readonly object[] _parameterDefaultValues;
+ private readonly MethodExecutorAsync _executorAsync;
+ private readonly MethodExecutor _executor;
+
+ private static readonly ConstructorInfo _objectMethodExecutorAwaitableConstructor =
+ typeof(ObjectMethodExecutorAwaitable).GetConstructor(new[] {
+ typeof(object), // customAwaitable
+ typeof(Func