在 ServiceStack 和 System.Configuration.ConfigurationManger 程序集 (netstandard) 中都发现了 ConfigurationErrorsException

ConfigurationErrorsException is found in both ServiceStack and System.Configuration.ConfigurationManger assemblies (netstandard)

我在我的 .NET Standard 库中同时使用了 ServiceStack 和 System.Configuration.ConfigurationManager 包。我具体参考了 ConfigurationErrorsException class。我的 Visual Studio 无法构建,因为它不知道 ConfigurationErrorsException 来自哪个程序集。

dotnet 团队已将 System.Configuration 命名空间移植到 netcore,所以也许现在是时候将其从 ServiceStack 程序集中删除了?

来源参考

ServiceStack 中的 System.Configuration 命名空间:https://github.com/ServiceStack/ServiceStack/blob/0b84a5a638d4230e6211eba554796980fcdc1f3b/src/ServiceStack/Platforms/PlatformNetCore.cs

System.Configuration.ConfigurationManager 包裹:https://www.nuget.org/packages/System.Configuration.ConfigurationManager/

System.Configuration.ConfigurationManager 包中 ConfigurationErrorsException 的来源:https://github.com/dotnet/corefx/blob/a10890f4ffe0fadf090c922578ba0e606ebdd16c/src/System.Configuration.ConfigurationManager/src/System/Configuration/ConfigurationErrorsException.cs

解决方法

我已经通过为 ServiceStack 程序集设置别名来解决问题:https://github.com/NuGet/Home/issues/4989#issuecomment-310565840,但这似乎很老套。

请求

如果 System.Configuration 命名空间及其 ConfigurationErrorsException class 从 ServiceStack 网络标准库中删除,那就太好了。

我已将其移至 this commit 中的 ServiceStack 命名空间。

此更改适用于现在 available on MyGet 的 v5.5.1。