-
-
Notifications
You must be signed in to change notification settings - Fork 303
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
builder.Host.UseAgileConfig()与SkyWalking不兼容 #105
Comments
gudieaofei
changed the title
builder.Host.UseAgileConfig会与SkyWalking冲突
builder.Host.UseAgileConfig与SkyWalking不兼容
Oct 12, 2022
gudieaofei
changed the title
builder.Host.UseAgileConfig与SkyWalking不兼容
builder.Host.UseAgileConfig()与SkyWalking不兼容
Oct 12, 2022
UseAgileConfig 本质上就是调用了 ConfigureAppConfiguration 的 AddAgileConfig 方法,就是多了 services.AddAgileConfig(); 一步而已 。问题可能出在这。 |
`Environment.SetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", "SkyAPM.Agent.AspNetCore"); var builder = WebApplication.CreateBuilder(args); 很简单的代码,引入SkyWalking的环境变量后,执行到UseAgileConfig那里就抛异常了 |
那我得查一下 skyamp 的 client 有啥骚操作 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
当项目引入SkyWalking并设置了环境变量:
Environment.SetEnvironmentVariable("ASPNETCORE_HOSTINGSTARTUPASSEMBLIES", "SkyAPM.Agent.AspNetCore");
调用builder.Host.UseAgileConfig()会报错:
System.InvalidOperationException:“Unable to resolve service for type 'Microsoft.Extensions.Hosting.IHostEnvironment' while attempting to activate 'SkyApm.Agent.Hosting.HostingEnvironmentProvider'.”
但如果使用以下方式是可以正常使用的,麻烦看下如何处理
builder.Host.ConfigureAppConfiguration((context, config) => { var configClient = new ConfigClient(); config.AddAgileConfig(configClient); });
The text was updated successfully, but these errors were encountered: