-
-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
apollo最新版本2.8.0热更新失效问题 #206
Comments
你可以修改源代码中的demo项目配置试试看是否有你目前的问题 |
pengweiqhca
added a commit
to pengweiqhca/apollo.net
that referenced
this issue
Feb 20, 2023
…core 6+ mini api.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
一:框架版本
.net 6.0
apollo2.8.0
二:加载apollo配置代码
program加载apollo的配置
//使用apollo
builder.Host.ConfigureAppConfiguration((context, config) =>
{
//获取环境变量
var env = context.HostingEnvironment;
//设置环境变量文件位置
config.SetBasePath(env.ContentRootPath);
//加载配置文件并刷新
//config.AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);
//加载当前环境配置文件并刷新
config.AddJsonFile(path: $"appsettings.{env.EnvironmentName}.json", optional: true, reloadOnChange: true);
//读取apollo配置
config.AddApollo(config.Build().GetSection("apollo")).AddDefault();
//加载环境变量
config.AddEnvironmentVariables();
});
三:控制器读取apollo配置
var configA = _configuration.GetSection("configA").Get();
四:问题点
apollo配置改了后,本地缓存目录能更新成功,可以发现服务端是没问题的
但是客户端一直拿的是旧实例
将版本降级到2.4.1 发现延迟一会后。立马刷新配置了
应该是apollo nuget包有问题
The text was updated successfully, but these errors were encountered: