.NetCore 获取项目配置文件信息

//string strxdebugenabled = System.Configuration.ConfigurationManager.AppSettings["xdebugenabled"];
            ExeConfigurationFileMap map = new ExeConfigurationFileMap();
            map.ExeConfigFilename = AppDomain.CurrentDomain.BaseDirectory + "/DCONFIG/App.config";
            Configuration config = System.Configuration.ConfigurationManager.OpenMappedExeConfiguration(map, ConfigurationUserLevel.None);
            //string connstr = config.ConnectionStrings.ConnectionStrings["appSettings"].ConnectionString;
            string strxdebugenabled = config.AppSettings.Settings["xdebugenabled"].Value;

你可能感兴趣的:(C#,.NET,个人学习总结,.netcore,c#)