C#Visual Studio,如何从AppSetting.json访问值?
我想从appsetting.json文件访问值,我的问题还在于我在项目多个应用程序中都有,不允许将其重命名,我该如何解决该问题? 也许用相对路径解决?
想要从tst -> src/api /.../ appsettings.json properties appsettings.json 谢谢!
I want to access values from appsetting.json file, my problem is also that I have in my project multiple appsetting files, not allowed to rename it, how can I solve that problem?
Maybe solve with relative path?
want to access from tst -> src/Api/.../appsettings.json
Properties appsettings.json
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
.NET Core
.NET Framework
设置类必须与您的JSON结构匹配
.net core
.net framework
Settings class must match your json structure
这对我有用!
This worked for me!