NET Core import web.config configuration file

1. First, the need to introduce System.Configuration.ConfigurationManager NET Core project, it can read configuration information web.config.

 

 

2. web.config file to the root directory of the project, and the need to change app.config.  Because the nature of the project .NET Core is a console application , so ConfigurationManager API that will go to the default read app.config configuration file, rather than the web .config configuration file.

 

 So you can access general configuration information in the app.config

Guess you like

Origin www.cnblogs.com/zhao-y/p/11918264.html