0

i'm moving my project from .net framework to .Net core 3.1 web api. .Net doesn't seem to include app.config file and I need to add it. I added one but it's doesn't recognized. Is there a way to add app.config file to .Net core app ? or is there any alternative of app.config .net core ?

App.config:

<configSections>
        <section name="corememorycache" type="NHibernate.Caches.CoreMemoryCache.CoreMemoryCacheSectionHandler,NHibernate.Caches.CoreMemoryCache" />
        <section name="hibernate-configuration"
                 type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />
    </configSections>

    <corememorycache expiration-scan-frequency="00:05:00">
        <cache region="foo" expiration="500" sliding="true" />
        <cache region="noExplicitExpiration" sliding="true" />
    </corememorycache>
1
  • Hi Johnny, welcome to the community! Have you read through the steps outline in the documentation here already and you haven't found a solution to this? Usually .Net core configuration takes place in the Startup.cs file and additional configurations can be added in an AppSettings.json file. If you haven't already, please create a new .NET core application and review the structure and included files for hints, and report back. Posting an answer to your own question if you find it is encouraged. Commented May 14, 2020 at 15:41

1 Answer 1

1

In .NET Core the approach is a bit different. By default you should use appsettings.jsonfile

Here is an article about .NET Core configuration: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-3.1

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.