From 75730ec6ff3fb28beb8427c9bbc674a922df701e Mon Sep 17 00:00:00 2001 From: liguoliang Date: Mon, 7 Mar 2022 16:22:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7Ocelot=2018.0.0=20&=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81.net6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/ApiGatewayDemo/ApiGatewayDemo.csproj | 6 +++--- demo/ApiGatewayDemo/Properties/launchSettings.json | 2 +- demo/ProductApi/ProductApi.csproj | 2 +- demo/ProductApi/Properties/launchSettings.json | 2 +- .../NacosClient/V2/ServiceCollectionExtensions.cs | 4 +++- src/Ocelot.Provider.Nacos/Ocelot.Provider.Nacos.csproj | 8 ++++---- .../Ocelot.Provider.Nacos.Test.csproj | 4 ++-- 7 files changed, 15 insertions(+), 13 deletions(-) diff --git a/demo/ApiGatewayDemo/ApiGatewayDemo.csproj b/demo/ApiGatewayDemo/ApiGatewayDemo.csproj index 4e94517..7534418 100644 --- a/demo/ApiGatewayDemo/ApiGatewayDemo.csproj +++ b/demo/ApiGatewayDemo/ApiGatewayDemo.csproj @@ -1,12 +1,12 @@ - + - net5.0 + net6.0 ApiGatewayDemo - + diff --git a/demo/ApiGatewayDemo/Properties/launchSettings.json b/demo/ApiGatewayDemo/Properties/launchSettings.json index c096f62..c9098c2 100644 --- a/demo/ApiGatewayDemo/Properties/launchSettings.json +++ b/demo/ApiGatewayDemo/Properties/launchSettings.json @@ -3,7 +3,7 @@ "ApiGatewayDemo": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://localhost:5001", + "applicationUrl": "http://0.0.0.0:5001", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/demo/ProductApi/ProductApi.csproj b/demo/ProductApi/ProductApi.csproj index 301b5a2..717577b 100644 --- a/demo/ProductApi/ProductApi.csproj +++ b/demo/ProductApi/ProductApi.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 diff --git a/demo/ProductApi/Properties/launchSettings.json b/demo/ProductApi/Properties/launchSettings.json index 4042ab6..701f18a 100644 --- a/demo/ProductApi/Properties/launchSettings.json +++ b/demo/ProductApi/Properties/launchSettings.json @@ -18,7 +18,7 @@ "ProductApi": { "commandName": "Project", "launchBrowser": true, - "applicationUrl": "http://*:5002", + "applicationUrl": "http://0.0.0.0:5002", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/Ocelot.Provider.Nacos/NacosClient/V2/ServiceCollectionExtensions.cs b/src/Ocelot.Provider.Nacos/NacosClient/V2/ServiceCollectionExtensions.cs index 53af0ed..8051c9d 100644 --- a/src/Ocelot.Provider.Nacos/NacosClient/V2/ServiceCollectionExtensions.cs +++ b/src/Ocelot.Provider.Nacos/NacosClient/V2/ServiceCollectionExtensions.cs @@ -21,7 +21,9 @@ namespace Ocelot.Provider.Nacos.NacosClient.V2 public static IServiceCollection AddNacosAspNet(this IServiceCollection services, IConfiguration configuration, string section = "nacos") { services.Configure(configuration.GetSection(section)); - services.AddNacosV2Naming(configuration); + + services.AddNacosV2Naming(configuration, sectionName: section); + services.AddSingleton(); return services; diff --git a/src/Ocelot.Provider.Nacos/Ocelot.Provider.Nacos.csproj b/src/Ocelot.Provider.Nacos/Ocelot.Provider.Nacos.csproj index 19dd224..fdf6dec 100644 --- a/src/Ocelot.Provider.Nacos/Ocelot.Provider.Nacos.csproj +++ b/src/Ocelot.Provider.Nacos/Ocelot.Provider.Nacos.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 softlgl softlgl softlgl @@ -12,10 +12,10 @@ - - + + - + diff --git a/test/Ocelot.Provider.Nacos.Test/Ocelot.Provider.Nacos.Test.csproj b/test/Ocelot.Provider.Nacos.Test/Ocelot.Provider.Nacos.Test.csproj index 3384b5d..8cf1083 100644 --- a/test/Ocelot.Provider.Nacos.Test/Ocelot.Provider.Nacos.Test.csproj +++ b/test/Ocelot.Provider.Nacos.Test/Ocelot.Provider.Nacos.Test.csproj @@ -1,7 +1,7 @@ - + - net5.0 + net6.0 false