[英]ASP.NET appsettings.json does not exist in my project
I am following this guide on how to create a Web API with ASP.NET Core and MongoDB.我正在关注如何创建一个Web API 与 ASP.NET 内核和 Z206E3718AF092FD1D12F08C I have followed every step successfully up until the Add a configuration model section .
我已成功完成每一步,直到添加配置 model 部分。 In the guide, I need to locate
appsettings.json
and add database configuration values to my project.在指南中,我需要找到
appsettings.json
并将数据库配置值添加到我的项目中。 The problem is that the file they mention appsettings.json
does not exist in my project.问题是他们提到的文件
appsettings.json
在我的项目中不存在。
In the guide, its implied that the file should already exist and should even already have content in it, so I don't know if I should just create it.在指南中,它暗示该文件应该已经存在,甚至应该已经包含内容,所以我不知道是否应该创建它。
I have looked online and all over my project but nothing seems to be definitive on what is the right thing to do (some guides contradict each other, etc.).我已经在网上查看了我的项目,但似乎没有什么是正确的做法(一些指南相互矛盾等)。
Apart from the default ones, I explicitly installed have the following NuGet packages:除了默认的,我明确安装了以下 NuGet 包:
Microsoft.Extensions.Configuration
(I thought this might help, but it didn't) Microsoft.Extensions.Configuration
(我认为这可能会有所帮助,但没有)MongoDB.Driver
(the instructions on the guide said to) MongoDB.Driver
(指南上的说明说要) My setup is the following:我的设置如下:
I have closed and re-opened VS but that didn't change anything.我已经关闭并重新打开了 VS,但这并没有改变任何东西。
This is my solution explorer:这是我的解决方案资源管理器:
Should I just create the file?我应该只创建文件吗? In the guide, it already has content in it.
在指南中,它已经包含了内容。 What about that?
那个怎么样?
Is there a new/different way of add database configuration values to my project?是否有一种新的/不同的方式可以将数据库配置值添加到我的项目中?
Is the guide outdated?指南过时了吗? If it is completely unusable, can you point me to a newer guide on how to Create a web API with ASP.NET Core and MongoDB?
如果它完全无法使用,您能否向我指出有关如何使用 ASP.NET07792FDCAFDA1?
Thank you very much!非常感谢!
The app exists for ASP.NET core projects.该应用程序适用于 ASP.NET 核心项目。 You mistakenly created, I believe, an ASP.NET framewok project.
我相信您错误地创建了一个 ASP.NET 框架项目。 The tutorial is about the ASP.NET core.
本教程是关于 ASP.NET 内核的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.