From 5ba8367b17cc555a69822271df84cba16013a0d0 Mon Sep 17 00:00:00 2001 From: maliming Date: Tue, 29 Oct 2019 10:22:44 +0800 Subject: [PATCH] Calling UseRouting before UseMvcWithDefaultRouteAndArea. Resolve #2028 --- .../BackendAdminAppGatewayHostModule.cs | 6 +++++- .../InternalGateway.Host/InternalGatewayHostModule.cs | 6 +++++- .../PublicWebSiteGatewayHostModule.cs | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs index 45fe70e03f..d30dc8e4fb 100644 --- a/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/BackendAdminAppGateway.Host/BackendAdminAppGatewayHostModule.cs @@ -103,7 +103,11 @@ namespace BackendAdminAppGateway.Host app.MapWhen( ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") || ctx.Request.Path.ToString().StartsWith("/Abp/"), - app2 => { app2.UseMvcWithDefaultRouteAndArea(); } + app2 => + { + app2.UseRouting(); + app2.UseMvcWithDefaultRouteAndArea(); + } ); app.UseOcelot().Wait(); diff --git a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs index 1232852126..8b470f826f 100644 --- a/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/InternalGateway.Host/InternalGatewayHostModule.cs @@ -94,7 +94,11 @@ namespace InternalGateway.Host ctx.Request.Path.ToString().StartsWith("/api/abp/") || ctx.Request.Path.ToString().StartsWith("/Abp/") || ctx.Request.Path.ToString().StartsWith("/Test/"), - app2 => { app2.UseMvcWithDefaultRouteAndArea(); } + app2 => + { + app2.UseRouting(); + app2.UseMvcWithDefaultRouteAndArea(); + } ); app.UseOcelot().Wait(); diff --git a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs index 2513c16c00..2add48443a 100644 --- a/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs +++ b/samples/MicroserviceDemo/gateways/PublicWebSiteGateway.Host/PublicWebSiteGatewayHostModule.cs @@ -90,7 +90,11 @@ namespace PublicWebSiteGateway.Host app.MapWhen( ctx => ctx.Request.Path.ToString().StartsWith("/api/abp/") || ctx.Request.Path.ToString().StartsWith("/Abp/"), - app2 => { app2.UseMvcWithDefaultRouteAndArea(); } + app2 => + { + app2.UseRouting(); + app2.UseMvcWithDefaultRouteAndArea(); + } ); app.UseOcelot().Wait();