0

We have a new asp.net core application that is consuming existing .net full framework libraries. In the asp.net core website, we are using the new style of configuration (appsettings.json, environment variables etc). However, in the existing class libraries they are using ConfigurationManager and we would prefer not to change.

We have existing asp.net 4.5 websites built on these libraries and when we deploy to azure we can use application settings & connection strings to override for the correct environment.

Now that we are deploying an asp.net core app that uses these same libraries, the configuration is not working. We have to deploy an app.config along with the connection strings, but for same reason Azure is no longer overriding these per environment.

How can I get these two configuration mechanisms to work together in such a way, that Azure will ultimately override to provide for the correct environment.

(sorry for the long winded question. Any help would be much appreciated)

1 Answer 1

1
  1. Add System.Configuration.ConfigurationManager from nuget
  2. Add a file app.config:

    <appSettings>
        <add key="webpages:Version" value="2.0.0.0"/>
    </appSettings>
    

Your .NET Core application is a console app ,so it finds app.config first

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.