在我的.Net标准库项目中,System.Configuration.ConfigurationManager似乎不起作用

问题描述 投票:1回答:1

在我的.Net标准库项目中,System.Configuration.ConfigurationManager似乎不起作用。

即使该方法未调用,它也包含该语句

object o = ConfigurationManager.GetSection(_strSectionName);

我已经安装了Nuget软件包System.Configuration.ConfigurationManager版本4.6.0

但是如果我在此语句中右键单击ConfigurationManager,则>

object o = ConfigurationManager.GetSection(_strSectionName);

向我显示版本4.0.2.0的元数据,即

Assembly System.Configuration.ConfigurationManager, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51

我认为应该去的版本是4.6.0。

也许是引起问题的原因。

在我的.Net标准库项目中,System.Configuration.ConfigurationManager似乎不起作用。甚至不被调用的方法,它包含Statement对象o = ...

c# .net-standard-2.0
1个回答
0
投票

程序集版本正确,应该为4.0.2.0,这与软件包版本(此处为4.6.0)分开。

© www.soinside.com 2019 - 2024. All rights reserved.