无法将System.Configuration.ConfigurationManager添加到.NET Core应用程序

编程入门 行业动态 更新时间:2024-10-24 13:21:13
本文介绍了无法将System.Configuration.ConfigurationManager添加到.NET Core应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我需要此软件包才能访问 Web.config 中的设置:

I need this package to access settings in the Web.config:

Restoring packages for D:\ ... path ... \dozor-backend.csproj... Package System.Configuration.ConfigurationManager 4.4.0 is not compatible with netcoreapp1.1 (.NETCoreApp,Version=v1.1). Package System.Configuration.ConfigurationManager 4.4.0 supports: - net461 (.NETFramework,Version=v4.6.1) - netstandard2.0 (.NETStandard,Version=v2.0) Package restore failed. Rolling back package changes for 'dozor-backend'. Time Elapsed: 00:00:01.0720066 ========== Finished ==========

我已经看到其他人在网络核心应用程序中使用了此程序包,那么问题是什么?如何在.NET Core应用程序中使用它?

I've seen other people use this package in net core app, so what's the issue? How can I use it in .NET Core app?

推荐答案

如错误所述,您可以使用 System.Configuration.ConfigurationManager 仅从.NETCoreApp 2.0开始.对于以前的版本,您只有配置API .

As error said, you can use System.Configuration.ConfigurationManager only starting from .NETCoreApp 2.0. For the previous version, you only have new ASP.NET Core configuration mechanism provided by Configuration API.

关于所提供的链接:请仔细阅读,并不表示ConfigurationManager`可用并且可以与早期版本的.NET Core一起使用.

Regarding a provided link: reread it carefully, it doesn't say that ConfigurationManager` is available and works with the previous version of .NET Core.

更多推荐

无法将System.Configuration.ConfigurationManager添加到.NET Core应用程序

本文发布于:2023-11-17 05:24:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1608981.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:应用程序   Configuration   System   ConfigurationManager   Core

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!