Closed szg closed 4 years ago
我用 106.54.227.205:8080 测试的就可以,本地Docker 里边 的就不行。
跳过服务发现都是配置过的,也能获取到配置。只是用 ConfigurationManager.AppSettings[key] 能获取到最新的值,但是用IConfiguration[key]获取不到最新值,
你可以运行Apollo.AspNet.Demo
运行之后结果跟我之前发的一致,都是IConfiguration[key]获取不到最新的
我 部署方式,按照 https://github.com/ctripcorp/apollo/wiki/Apollo-Quick-Start-Docker%E9%83%A8%E7%BD%B2 一、二,执行。跳过服务发现,appsetting 配置
<add key="Apollo.MetaServer" value="http://192.168.5.133:8080/" /> <add key="Apollo.ConfigServer" value="http://192.168.5.133:8080/" />
你开启日志看看
Com.Ctrip.Framework.Apollo.Logging.UseConsoleLogging()
控制台 程序 没问题的。只有 web下才有这个问题。不太清除原因。但是连接 106.54.227.205:8080 ,也没有配置服务发现 却没有问题。
看看你是这个问题吗?
这个刚也试了,但是我不是这个问题。代码我传 gitee 了,只有 10行代码,希望指正 https://gitee.com/sunnyfish/apollon_test_nfx471
你的web.config的runtime没有配置正确,请保证编译输出里没有版本重定向输出
应该跟这个关系不大吧。json.net 引用版本 apollo.net为 6.0.8,现在随便建个 4.5 项目都是10.0+了,对吧,我用 官网 https://github.com/ctripcorp/apollo.net/blob/dotnet-core/Apollo.AspNet.Demo/Startup.cs#L23 运行我本地 docker apollo 结果跟我 4.7.1 有版本重定向一致,我认为,如果不是 代码的问题的话。可能是 docker 部署的问题,因为,我用你们提供的那个地址 106.54.227.205:8080,IConfiguration[key],AppSetting[key]能得到相同的结果。
我关掉了
如图,将 key aaa 从 aoaoao... 更新 为 aoao 后, Configuration[key].value:aoaoao....,AppSetting[key].value:aoao Global 配置如下 public class WebApiApplication : System.Web.HttpApplication { public static IConfiguration Configuration { get; private set; } protected void Application_Start() { GlobalConfiguration.Configure(WebApiConfig.Register);
Web.config 配置如下
`