AWS lambda在.NET 6上给出 - AppSettings的错误解析JSON文件

发布于 2025-02-05 05:07:48 字数 483 浏览 3 评论 0原文

我刚刚在.NET 6上创建了一个简单的AWS lambda函数。我添加了一个appsettings.json文件,并且正在尝试从文件中读取内容(它们具有AWS资源,然后将其应用于AWSOPTIONS)。

我无法读取此JSON文件,它在控制台上显示了此错误

Loaded local Lambda runtime from project output D:\xxx\yyy\zzz\bin\Debug\net6.0
Error parsing JSON file: D:\xxx\yyy\zzz\bin\Debug\net6.0\appsettings.json
Error parsing JSON file: D:\xxx\yyy\zzz\appsettings.json

,并且如何从配置文件中读取数据没有太大帮助。

典型的假设是基于它属于的ENV加载设置文件,而我所看到的一切已更改了一些,来自.netcore2_1到.net6。请分享您的意见,谢谢!

I just created a simple aws lambda function on .net 6. I have added an appsettings.json file and I'm trying to read contents from the file(which have aws resources and later be applied to AWSOptions).

Im unable to read this json file and it shows this error on the console

Loaded local Lambda runtime from project output D:\xxx\yyy\zzz\bin\Debug\net6.0
Error parsing JSON file: D:\xxx\yyy\zzz\bin\Debug\net6.0\appsettings.json
Error parsing JSON file: D:\xxx\yyy\zzz\appsettings.json

and there isn't much help around on how to read data from config file.

Typical assumption was to load the settings file based on the env that it belonged to and all I get to see it it has changed a little, coming from .netcore2_1 to .net6. Please share your opinion and thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文