Skip to content
This repository was archived by the owner on Nov 21, 2018. It is now read-only.

Remove ConfigureAspNetDefaults #141

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions MetaPackages.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26524.0
VisualStudioVersion = 15.0.26507.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{ED834E68-51C3-4ADE-ACC8-6BA6D4207C09}"
EndProject
Expand Down Expand Up @@ -47,8 +47,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TrimDeps", "tools\TrimDeps\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyInjectionApp", "test\TestSites\DependencyInjectionApp\DependencyInjectionApp.csproj", "{65FE2E38-4529-4C93-A7B0-CF12DD7A70C3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Tests", "test\Microsoft.AspNetCore.Tests\Microsoft.AspNetCore.Tests.csproj", "{914D3FAD-8B94-4353-B24F-B264F675481C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -103,10 +101,6 @@ Global
{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
{914D3FAD-8B94-4353-B24F-B264F675481C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{914D3FAD-8B94-4353-B24F-B264F675481C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{914D3FAD-8B94-4353-B24F-B264F675481C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{914D3FAD-8B94-4353-B24F-B264F675481C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -126,6 +120,5 @@ Global
{302400A0-98BB-4C04-88D4-C32DC2D4B945} = {ED834E68-51C3-4ADE-ACC8-6BA6D4207C09}
{67E4C92F-6D12-4C52-BB79-B8D11BFC6B82} = {ED834E68-51C3-4ADE-ACC8-6BA6D4207C09}
{65FE2E38-4529-4C93-A7B0-CF12DD7A70C3} = {EC22261D-0DE1-47DE-8F7C-072675D6F5B4}
{914D3FAD-8B94-4353-B24F-B264F675481C} = {9E49B5B9-9E72-42FB-B684-90CA1B1BCF9C}
EndGlobalSection
EndGlobal
2 changes: 1 addition & 1 deletion build/common.props
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
<MetaPackagePackageReference Include="Microsoft.Extensions.Logging" />
<MetaPackagePackageReference Include="Microsoft.Extensions.Logging.Console" />
<MetaPackagePackageReference Include="Microsoft.Extensions.Logging.Debug" />
<MetaPackagePackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -208,6 +207,7 @@
<FullMetaPackagePackageReference Include="Microsoft.Extensions.Logging.TraceSource" />
<FullMetaPackagePackageReference Include="Microsoft.Extensions.ObjectPool" />
<FullMetaPackagePackageReference Include="Microsoft.Extensions.Options" />
<FullMetaPackagePackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" />
<FullMetaPackagePackageReference Include="Microsoft.Extensions.Primitives" />
<FullMetaPackagePackageReference Include="Microsoft.Extensions.WebEncoders" />
<FullMetaPackagePackageReference Include="Microsoft.Net.Http.Headers" />
Expand Down
32 changes: 0 additions & 32 deletions src/Microsoft.AspNetCore/AspNetCoreExtensions.cs

This file was deleted.

5 changes: 0 additions & 5 deletions src/Microsoft.AspNetCore/WebHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Options.Infrastructure;

namespace Microsoft.AspNetCore
{
Expand Down Expand Up @@ -188,10 +187,6 @@ public static IWebHostBuilder CreateDefaultBuilder(string[] args)
.UseDefaultServiceProvider((context, options) =>
{
options.ValidateScopes = context.HostingEnvironment.IsDevelopment();
})
.ConfigureServices(services =>
{
services.ConfigureAspNetCoreDefaults();
});

return builder;
Expand Down
113 changes: 0 additions & 113 deletions test/Microsoft.AspNetCore.FunctionalTests/WebHostFunctionalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,119 +97,6 @@ await ExecuteTestApp(applicationName, async (deploymentResult, logger) =>
}, setTestEnvVars: true, environment: environment);
}

[Theory]
[InlineData("127.0.0.1", "127.0.0.1")]
[InlineData("::1", "[::1]")]
public async Task BindsKestrelHttpEndPointFromConfiguration(string endPointAddress, string requestAddress)
{
try
{
File.WriteAllText("appsettings.json", @"
{
""Microsoft:AspNetCore:Server:Kestrel"": {
""EndPoints"": {
""EndPoint"": {
""Address"": """ + endPointAddress + @""",
""Port"": 0
}
}
}
}
");
using (var webHost = WebHost.Start(context => context.Response.WriteAsync("Hello, World!")))
{
var port = GetWebHostPort(webHost);

Assert.NotEqual(0, port);

using (var client = new HttpClient())
{
var response = await client.GetAsync($"http://{requestAddress}:{port}");
response.EnsureSuccessStatusCode();
}
}
}
finally
{
File.Delete("appsettings.json");
}
}

[Fact]
public async Task BindsKestrelHttpsEndPointFromConfiguration_ReferencedCertificateFile()
{
try
{
File.WriteAllText("appsettings.json", @"
{
""Microsoft:AspNetCore:Server:Kestrel"": {
""EndPoints"": {
""EndPoint"": {
""Address"": ""127.0.0.1"",
""Port"": 0,
""Certificate"": ""TestCert""
}
}
},
""Certificates"": {
""TestCert"": {
""Source"": ""File"",
""Path"": ""testCert.pfx"",
""Password"": ""testPassword""
}
}
}
");
using (var webHost = WebHost.Start(context => context.Response.WriteAsync("Hello, World!")))
{
var port = GetWebHostPort(webHost);

var response = await HttpClientSlim.GetStringAsync($"https://127.0.0.1:{port}", validateCertificate: false);
Assert.Equal("Hello, World!", response);
}
}
finally
{
File.Delete("appsettings.json");
}
}

[Fact]
public async Task BindsKestrelHttpsEndPointFromConfiguration_InlineCertificateFile()
{
try
{
File.WriteAllText("appsettings.json", @"
{
""Microsoft:AspNetCore:Server:Kestrel"": {
""EndPoints"": {
""EndPoint"": {
""Address"": ""127.0.0.1"",
""Port"": 0,
""Certificate"": {
""Source"": ""File"",
""Path"": ""testCert.pfx"",
""Password"": ""testPassword""
}
}
}
}
}
");
using (var webHost = WebHost.Start(context => context.Response.WriteAsync("Hello, World!")))
{
var port = GetWebHostPort(webHost);

var response = await HttpClientSlim.GetStringAsync($"https://127.0.0.1:{port}", validateCertificate: false);
Assert.Equal("Hello, World!", response);
}
}
finally
{
File.Delete("appsettings.json");
}
}

[Fact]
public void LoggingConfigurationSectionPassedToLoggerByDefault()
{
Expand Down
68 changes: 0 additions & 68 deletions test/Microsoft.AspNetCore.Tests/ConfigurationTests.cs

This file was deleted.

21 changes: 0 additions & 21 deletions test/Microsoft.AspNetCore.Tests/Microsoft.AspNetCore.Tests.csproj

This file was deleted.