相关疑难解决方法(0)

使用ConfigurationManager的.net完整框架的.Net Core 2.0应用程序设置

假设以下项目结构:

  1. 项目A:

    • .net完整框架(4.6.2)
    • 通过以下方式内部访问配置:

    ConfigurationManager.AppSettings [“ key”];

  2. 项目B:

    • .net core 2.0(编译到.net 4.6.2)
    • 参考和使用项目A

问题:
.net核心使用新的配置机制-是否可以通过一种方式挂钩.net核心配置(在项目B中),该方式将使项目A可以通过ConfigurationManager使用配置-即在项目A中无需更改代码?

此答案中添加NuGet包System.Configuration.ConfigurationManager就像在此答案中一样 仅将ConfigurationManager添加到项目B中,但在项目A中无法通过ConfigurationManager使用任何配置

.net c# .net-core

1
推荐指数
1
解决办法
924
查看次数

标签 统计

.net ×1

.net-core ×1

c# ×1