尝试在Program.cs中使用Azure密钥保管库设置Azure应用程序配置,并遇到以下错误:
'IConfigurationBuilder'不包含'AddAzureAppConfiguration'的定义
public static IHostBuilder CreateHostBuilder(string[] args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
webBuilder.ConfigureAppConfiguration((hostingContext, config) =>
{
var settings = config.Build();
config.AddAzureAppConfiguration(options =>
{
options.Connect(settings["ConnectionStrings:AppConfig"])
.ConfigureKeyVault(kv =>
{
kv.SetCredential(new DefaultAzureCredential());
});
});
})
.UseStartup<Startup>());
2条答案
按热度按时间cgfeq70w1#
添加以下软件包修复了它:
mnemlml82#
或者更好: