Change IIS projects to target netcoreapp3.0 (#4371)

* Change IIS projects to target netcoreapp3.0 #3754
This commit is contained in:
Chris Ross 2018-12-11 13:46:46 -08:00 committed by GitHub
parent 7f1f7a5256
commit 7fdd930f50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
42 changed files with 73 additions and 94 deletions

View File

@ -4,7 +4,7 @@
<!-- Using shorter assembly name instead of Microsoft.AspNetCore.Server.Kestrel.Performance because https://github.com/dotnet/BenchmarkDotNet/issues/498 -->
<AssemblyName>IIS.Performance</AssemblyName>
<RootNamespace>Microsoft.AspNetCore.Server.IIS.Performance</RootNamespace>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<OutputType>Exe</OutputType>
<ServerGarbageCollection>true</ServerGarbageCollection>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

View File

@ -115,7 +115,7 @@
<MSBuild
Projects="$(StressAppBasePath)\StressTestWebSite.csproj"
Targets="Publish"
Properties="TargetFramework=netcoreapp2.2;Configuration=$(Configuration);RuntimeIdentifier=win7-%(Platforms.Identity);PublishDir=$(StressAppPublishPath)\%(Identity);BuildProjectReferences=false" />
Properties="TargetFramework=netcoreapp3.0;Configuration=$(Configuration);RuntimeIdentifier=win7-%(Platforms.Identity);PublishDir=$(StressAppPublishPath)\%(Identity);BuildProjectReferences=false" />
<ItemGroup>
<StressAppFiles Include="$(StressAppPublishPath)\**\*" />

View File

@ -44,26 +44,19 @@
<Copy SourceFiles="$(MSBuildThisFileDirectory)launchSettings.json" DestinationFolder="$(MSBuildProjectDirectory)\Properties" SkipUnchangedFiles="true" />
</Target>
<!-- Deps file injection-->
<ItemGroup Condition="('$(InProcessTestSite)' == 'true') AND ('$(ReferenceTestTasks)' != 'false')">
<ItemGroup Condition="('$(InProcessTestSite)' == 'true') AND ('$(ReferenceTestTasks)' != 'false')">
<ProjectReference Include="$(MSBuildThisFileDirectory)..\test\TestTasks\TestTasks.csproj">
<ReferenceOutputAssembly>False</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
</ItemGroup>
<Target Name="PrepareInjectionApp" Condition="'$(InProcessTestSite)' == 'true'">
<PropertyGroup>
<InjectDepsAssembly>$(MSBuildThisFileDirectory)..\test\TestTasks\bin\$(Configuration)\$(TargetFramework)\TestTasks</InjectDepsAssembly>
<InjectDepsApp Condition="'$(TargetFramework)' == 'net461'">$(InjectDepsAssembly)</InjectDepsApp>
<InjectDepsArguments>"win7-$(NativePlatform)" "$(AncmInProcessRHPath)"</InjectDepsArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'net461'">
<InjectDepsAssembly>$(InjectDepsAssembly).exe</InjectDepsAssembly>
<InjectDepsApp>$(InjectDepsAssembly)</InjectDepsApp>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' != 'net461'">
<PropertyGroup>
<InjectDepsAssembly>$(InjectDepsAssembly).dll</InjectDepsAssembly>
<InjectDepsApp>dotnet</InjectDepsApp>
<InjectDepsArguments>$(InjectDepsAssembly) $(InjectDepsArguments)</InjectDepsArguments>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2;net461</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

View File

@ -3,7 +3,7 @@
<Import Project="..\..\build\testsite.props" />
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<InProcessTestSite>true</InProcessTestSite>
</PropertyGroup>

View File

@ -78,17 +78,12 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
return ReadAsyncInternal(new Memory<byte>(buffer, offset, count), cancellationToken).AsTask();
}
#if NETCOREAPP2_1
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
{
ValidateState(cancellationToken);
return ReadAsyncInternal(destination, cancellationToken);
}
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif
private async ValueTask<int> ReadAsyncInternal(Memory<byte> buffer, CancellationToken cancellationToken)
{

View File

@ -89,17 +89,12 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
return _context.WriteAsync(new ReadOnlyMemory<byte>(buffer, offset, count), cancellationToken);
}
#if NETCOREAPP2_1
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
{
ValidateState(cancellationToken);
return new ValueTask(_httpResponseControl.WriteAsync(source, cancellationToken));
return new ValueTask(_context.WriteAsync(source, cancellationToken));
}
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif
public void StartAcceptingWrites()
{

View File

@ -145,15 +145,10 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
return _requestStream.ReadAsync(buffer, offset, count, cancellationToken);
}
#if NETCOREAPP2_1
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
{
return _requestStream.ReadAsync(destination, cancellationToken);
}
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif
public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)
{
@ -165,15 +160,10 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
return _responseStream.WriteAsync(buffer, offset, count, cancellationToken);
}
#if NETCOREAPP2_1
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
{
return _responseStream.WriteAsync(source, cancellationToken);
}
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif
public override long Seek(long offset, SeekOrigin origin)
{

View File

@ -68,13 +68,8 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
public override Task<int> ReadAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
=> _inner.ReadAsync(buffer, offset, count, cancellationToken);
#if NETCOREAPP2_1
public override ValueTask<int> ReadAsync(Memory<byte> destination, CancellationToken cancellationToken = default)
=> _inner.ReadAsync(destination, cancellationToken);
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif
public override int ReadByte()
=> _inner.ReadByte();
@ -91,13 +86,8 @@ namespace Microsoft.AspNetCore.Server.IIS.Core
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
=> _inner.WriteAsync(buffer, offset, count, cancellationToken);
#if NETCOREAPP2_1
public override ValueTask WriteAsync(ReadOnlyMemory<byte> source, CancellationToken cancellationToken = default)
=> _inner.WriteAsync(source, cancellationToken);
#elif NETSTANDARD2_0
#else
#error TFMs need to be updated
#endif
public override void WriteByte(byte value)
=> _inner.WriteByte(value);

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PackageId>Microsoft.AspNetCore.Server.IIS</PackageId>
<Description>Provides support for hosting ASP.NET Core in IIS using the AspNetCoreModule.</Description>
<NoWarn>$(NoWarn);CS1591</NoWarn>
@ -9,7 +9,7 @@
<PackageTags>aspnetcore;iis</PackageTags>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackNativeAssets Condition="'$(OS)' == 'Windows_NT'">true</PackNativeAssets>
<NativeAssetsTargetFramework>netcoreapp2.2</NativeAssetsTargetFramework>
<NativeAssetsTargetFramework>netcoreapp3.0</NativeAssetsTargetFramework>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>

View File

@ -2,7 +2,7 @@
<PropertyGroup>
<Description>ASP.NET Core components for working with the IIS AspNetCoreModule.</Description>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageTags>aspnetcore;iis</PackageTags>

View File

@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Server.IntegrationTesting.IIS
// Start timer
StartTimer();
// For an unpublished application the dllroot points pre-built dlls like projectdir/bin/debug/net461/
// For an unpublished application the dllroot points pre-built dlls like projectdir/bin/debug/netcoreapp3.0/
// and contentRoot points to the project directory so you get things like static assets.
// For a published app both point to the publish directory.
var dllRoot = CheckIfPublishIsRequired();

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp3.0</TargetFramework>
<PackageId>Microsoft.AspNetCore.Server.IntegrationTesting.IIS</PackageId>
<!-- Always include a pre-release label since this is an internal-only package. -->
<Version>$(VersionPrefix)-$(VersionSuffix)</Version>

View File

@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithApplicationTypes(ApplicationType.Portable)
.WithAllAncmVersions()
.WithAllHostingModels();

View File

@ -31,7 +31,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAllAncmVersions()
.WithAllHostingModels();

View File

@ -22,7 +22,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAllAncmVersions()
.WithAllHostingModels();

View File

@ -50,7 +50,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
Assert.Equal(
new byte[] {
0x1F, 0x8B, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
0x04, 0x0B, 0x63, 0x60, 0xA0, 0x3D, 0x00, 0x00,
0x04, 0x0A, 0x63, 0x60, 0xA0, 0x3D, 0x00, 0x00,
0xCA, 0xC6, 0x88, 0x99, 0x64, 0x00, 0x00, 0x00 },
await response.Content.ReadAsByteArrayAsync());
}

View File

@ -66,7 +66,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
await _fixture.Client.RetryRequestAsync("/WaitingRequestCount", async message => await message.Content.ReadAsStringAsync() == "0");
}
[ConditionalFact]
[ConditionalFact(Skip = "https://github.com/aspnet/AspNetCore/issues/4512")]
public async Task ClientDisconnectCallbackStress()
{
// Fixture initialization fails if inside of the Task.Run, so send an

View File

@ -109,7 +109,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAncmV2InProcess();

View File

@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAncmVersions(AncmVersion.AspNetCoreModuleV2)
.WithAllHostingModels();

View File

@ -32,7 +32,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22)
.WithTfms(Tfm.NetCoreApp30)
.WithApplicationTypes(ApplicationType.Portable)
.WithAllAncmVersions();

View File

@ -26,7 +26,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAllAncmVersions();

View File

@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
new DeploymentParameters(publisher.ApplicationPath, DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64)
{
HostingModel = hostingModel,
TargetFramework = "netcoreapp2.2",
TargetFramework = Tfm.NetCoreApp30,
AncmVersion = AncmVersion.AspNetCoreModuleV2
},
publish);

View File

@ -113,7 +113,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
RuntimeFlavor.CoreClr,
RuntimeArchitecture.x64)
{
TargetFramework = Tfm.NetCoreApp22,
TargetFramework = Tfm.NetCoreApp30,
AncmVersion = AncmVersion.AspNetCoreModuleV2,
HostingModel = HostingModel.InProcess,
PublishApplicationBeforeDeployment = true,

View File

@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
.WithTfms(Tfm.NetCoreApp30)
.WithApplicationTypes(ApplicationType.Portable)
.WithAllAncmVersions()
.WithAllHostingModels();

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<IsTestProject>false</IsTestProject>
</PropertyGroup>

View File

@ -1,15 +1,6 @@
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<!-- These tests are remaining at netcoreapp2.2 because the Benchmarks and functional tests use the same websites.
We must leave the benchmarks at 2.1, and if you try to import a project that uses 22 to a 21 project it complains. -->
<DeveloperBuildTestTfms>netcoreapp2.2</DeveloperBuildTestTfms>
<StandardTestTfms>$(DeveloperBuildTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' ">$(StandardTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestTfms);net461</StandardTestTfms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
</ItemGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>IISBackwardsCompatibility.FunctionalTests</TestGroupName>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>IISForwardsCompatibility.FunctionalTests</TestGroupName>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TestGroupName>IIS.FunctionalTests</TestGroupName>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<Import Project="..\..\build\functional-test-assets.targets" />
@ -11,7 +11,6 @@
<ProjectReference Include="..\Common.Tests\Common.Tests.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Server.IntegrationTesting" Version="$(MicrosoftAspNetCoreServerIntegrationTestingPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="$(MicrosoftAspNetCoreHostingPackageVersion)" />

View File

@ -24,7 +24,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
.WithTfms(Tfm.NetCoreApp30)
.WithAllApplicationTypes()
.WithAllAncmVersions()
.WithAllHostingModels();

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<DisableFastUpToDateCheck>True</DisableFastUpToDateCheck>
</PropertyGroup>

View File

@ -30,7 +30,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration.FunctionalTests
public static TestMatrix TestVariants
=> TestMatrix.ForServers(DeployerSelector.ServerType)
.WithTfms(Tfm.NetCoreApp22, Tfm.Net461)
.WithTfms(Tfm.NetCoreApp30)
.WithAllAncmVersions();
[ConditionalTheory]

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

View File

@ -1,8 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RuntimeIdentifiers>win7-x64;win7-x86</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>

View File

@ -3,7 +3,7 @@
<Import Project="..\..\..\build\testsite.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>

View File

@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<Import Project="..\..\..\build\testsite.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp2.2</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<InProcessTestSite>true</InProcessTestSite>
</PropertyGroup>

View File

@ -3,7 +3,8 @@
<Import Project="..\..\..\build\testsite.props" />
<PropertyGroup>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<AspNetCoreHostingModel>OutOfProcess</AspNetCoreHostingModel>
</PropertyGroup>
<ItemGroup>

View File

@ -3,7 +3,7 @@
<Import Project="..\..\..\build\testsite.props" />
<PropertyGroup>
<TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
<TargetFramework>netcoreapp3.0</TargetFramework>
<InProcessTestSite>true</InProcessTestSite>
</PropertyGroup>

View File

@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Builder.Internal;
using Microsoft.AspNetCore.Http;
namespace Microsoft.AspNetCore.IISIntegration.FunctionalTests
@ -10,6 +12,8 @@ namespace Microsoft.AspNetCore.IISIntegration.FunctionalTests
{
public static void Register(IApplicationBuilder app, object startup)
{
var delegates = new Dictionary<string, RequestDelegate>();
var type = startup.GetType();
foreach (var method in type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance))
{
@ -17,22 +21,40 @@ namespace Microsoft.AspNetCore.IISIntegration.FunctionalTests
if (method.Name != "Configure" &&
parameters.Length == 1)
{
Action<IApplicationBuilder> appfunc = null;
RequestDelegate appfunc = null;
if (parameters[0].ParameterType == typeof(IApplicationBuilder))
{
appfunc = innerAppBuilder => method.Invoke(startup, new[] { innerAppBuilder });
var innerAppBuilder = app.New();
method.Invoke(startup, new[] { innerAppBuilder });
appfunc = innerAppBuilder.Build();
}
else if (parameters[0].ParameterType == typeof(HttpContext))
{
appfunc = innerAppBuilder => innerAppBuilder.Run(ctx => (Task)method.Invoke(startup, new[] { ctx }));
appfunc = context => (Task)method.Invoke(startup, new[] { context });
}
if (appfunc != null)
if (appfunc == null)
{
app.Map("/" + method.Name, appfunc);
continue;
}
delegates.Add("/" + method.Name, appfunc);
}
}
app.Run(async context => {
foreach (var requestDelegate in delegates)
{
if (context.Request.Path.StartsWithSegments(requestDelegate.Key, out var matchedPath, out var remainingPath))
{
var pathBase = context.Request.PathBase;
context.Request.PathBase = pathBase.Add(matchedPath);
context.Request.Path = remainingPath;
await requestDelegate.Value(context);
}
}
});
}
}
}

View File

@ -0,0 +1,2 @@
version:3.0.0-build-20181120.4
commithash:84dcc6f0eb5455a3c0305d6d238926defb050889