none
What is the purpose of appsettings.json file in ASP.NET Core RRS feed

  • Question

  •   
    1. Are there any in build classes from Microsoft that read this appsettings.json files ? If yes, are they part of .NET Standard already.

    2. What is the use of appsettings.json file in ASP.NET core.Is there a similar file for the .NET Core console applications as well


    Thursday, August 9, 2018 4:22 PM

All replies

  • Hi subbarao ram,

    Thank you for posting here.

    >>Are there any in build classes from Microsoft that read this appsettings.json files ? If yes, are they part of .NET Standard already.

    For your question, do you mean you want to access to the AppSettings.json file in .NET Standard? If yes, we do not suggest to do that. But you could load a json file as configuration. Please refer to the link below to check the sample which load json file as configuration.

    https://stackoverflow.com/questions/50562798/reading-appsettings-json-from-net-standard-library

    >>What is the use of appsettings.json file in ASP.NET core.Is there a similar file for the .NET Core console applications as well

    For the use of appsettings.json, please refer to the links below.

    https://blog.elmah.io/appsettings-in-aspnetcore/

    https://www.c-sharpcorner.com/article/all-about-appsettings-json-in-asp-net-core-2-0/

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, August 10, 2018 6:18 AM
    Moderator
  • Thank you Wendy Zang. I have couple of follow up questions
    1. What is the Microsoft Recommendation on reading the Application Configuration on .NET Standard platform ?
    2. We want a settings/config file from where we read properties such as connection string, userid, password, heart beat interval etc and many more. What is the Microsoft recommendation for such a use case on .NET Standard/Core platform ?
    Friday, August 10, 2018 8:46 AM