I am now creating a rest api in .net core using visual studio code, is there anyone here knows how to add a app.config or web.config in this setup? or there any equivalent file here in visual studio code.
Asked
Active
Viewed 468 times
1
-
1This seems a good starting point: https://learn.microsoft.com/en-us/aspnet/core/tutorials/web-api-vsc?view=aspnetcore-2.1 – Lennart Stoop Aug 08 '18 at 09:05
-
4There isn't an `app.config`, or a `web.config`. I recommend reading Microsoft's docs on [configuration in .NET Core](https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.1&tabs=basicconfiguration). – ProgrammingLlama Aug 08 '18 at 09:05
-
I am using Visual Studio Code as IDE – Novice Aug 09 '18 at 06:19
1 Answers
-1
You should use .NET Core Configuration API in the Microsoft.Extensions.Configuration
package. It's more flexible than .NET Framework app
or web.config
, for example it allows you to use multiple configuration sources in different formats (JSON and XML included).
Here's a link to Microsoft docs about .NET Core Configuration: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.1&tabs=basicconfiguration

V0ldek
- 9,623
- 1
- 26
- 57
-
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/low-quality-posts/20529404) – ilim Aug 08 '18 at 09:35
-
Sorry for that and thanks for pointing that out to me. Is this edited version better? – V0ldek Aug 08 '18 at 09:40
-