Configurationmanager.appsettings cannot be used in ASP. NET Core

Source: Internet
Author: User

Just approached. NET core, ready to migrate some of the previous technology tools first to. NET Standard, convenient for later use, the results of ConfigurationManager AppSettings there are various problems

First,

Error CS0012 type ' NameValueCollection ' is defined in unreferenced assemblies. You must add a reference to the assembly "System, version=4.0.0.0, Culture=neutral, publickeytoken=b77a5c561934e089".

Given the cross-platform of. NET Core and. NET Standard, System.dll should not get the system locally, so go to NuGet to find it, and then find it decisively.

Microsoft.NETCore.Portable.Compatiblity, which contains some system-level class libraries

But the result is still the same, and then continue to Baidu all kinds of information, the result is ... No results

Helpless only FQ help Google, the result let me find this

No configurationmanager in ASP. NET Core does not support

Resources

Https://www.danylkoweb.com/Blog/no-configurationmanager-in-aspnet-core-GC

https://stackoverflow.com/questions/40551232/ Configurationmanager-appsettings-generates-compile-time-error-on-net-standard-1

One way to get appsettings in Core

https://colinmackay.scot/2016/07/03/application-configuration-in-net-core-part-1/

Configurationmanager.appsettings cannot be used in ASP. NET Core

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.