最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Microsoft.Extensions.Configuration.UserSecrets 6.0.1: ConfigurationBuilder.AddUserSecrets() fails - Stack Overflow

programmeradmin0浏览0评论

This code works with Microsoft.Extensions.Configuration.UserSecrets 6.0.1. If I install Microsoft Graph 9.0.1, it does not work. There are no sections in the config object. The secrets.json file is identical in both projects, is set to "copy if newer", and is successfully copied to the bin/debug folder.

var config = new ConfigurationBuilder()
                .SetBasePath(AppDomain.CurrentDomain.BaseDirectory)
                .AddUserSecrets<MSGraphEmailTest>()
                .Build();

If user secrets are still supported in 9.0, is there any way to get them to work?

For now, I'm just using .AddJsonFile("secrets.json"). Works fine.

发布评论

评论列表(0)

  1. 暂无评论