C# vs 2017.net核心类库项目中的引用管理器为空
我正在尝试添加对C# vs 2017.net核心类库项目中的引用管理器为空,c#,.net-core,visual-studio-2017,configurationmanager,C#,.net Core,Visual Studio 2017,Configurationmanager,我正在尝试添加对System.Configuration.dllassembly的引用。 我使用的是.Net framework Core,可以在我的.csproj文件中看到: <TargetFramework>netcoreapp2.2</TargetFramework> 第一个问题:如果我不引用该程序集,如何成功构建上述行 如果我尝试使用ConfigurationManager类从app.config文件读取数据(如上所述),我会收到一个错误,抱怨: CS0103
System.Configuration.dll
assembly的引用。我使用的是.Net framework Core,可以在我的
.csproj
文件中看到:
<TargetFramework>netcoreapp2.2</TargetFramework>
第一个问题:如果我不引用该程序集,如何成功构建上述行
如果我尝试使用ConfigurationManager
类从app.config文件读取数据(如上所述),我会收到一个错误,抱怨:
CS0103 The name 'ConfigurationManager' does not exist in the current context
问题二:我能做些什么来解决这个错误?我的代码或项目有什么问题
我的案例与不同,这不是该问题的重复。
添加参考
供您本地参考。您需要使用Nuget Package Manager来包含引用
最重要的是,.Net Core不使用.Net Framework包,而ConfigurationManager
是.Net Framework包
您需要使用.Net Core或.Net Standard库和.Net Core
添加参考
用于本地参考。您需要使用Nuget Package Manager来包含引用
最重要的是,.Net Core不使用.Net Framework包,而ConfigurationManager
是.Net Framework包
您需要使用.Net Core或.Net Standard库和.Net Core
CS0103 The name 'ConfigurationManager' does not exist in the current context