FileNotFoundException:无法加载文件或程序集“System.Configuration.ConfigurationManager, [英] FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager,

查看:52
本文介绍了FileNotFoundException:无法加载文件或程序集“System.Configuration.ConfigurationManager,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 ado.net 从 .net core 3.1 连接到 oracle 数据库,这是我的代码

I am trying to connect to oracle database from .net core 3.1 using ado.net here's my code

private OracleConnection GetOracleConnection()
{
            string conString = "Data Source=Q550.adr.XXXX.com;Persist Security,Info=True;User ID=XXXX;Password=CCC39";
            OracleConnection con = new OracleConnection(conString);
            return con;
}

但是当这个函数在第 2 行执行以下异常时

but when this function executes following exception occured at line number 2

System.TypeInitializationException: 'OracleInternal.Common.ProviderConfig' 的类型初始值设定项引发异常

FileNotFoundException:无法加载文件或程序集System.Configuration.ConfigurationManager,版本=4.0.2.0,文化=中性,PublicKeyToken=cc7b13ffcd2ddd51'.该系统找不到指定的文件.**

FileNotFoundException: Could not load file or assembly 'System.Configuration.ConfigurationManager, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified. **

谁能告诉我发生了什么??

Can anyone tell me what's happening ??

推荐答案

您可以从 Nuget 安装 System.Configuration.ConfigurationManager

You can Install System.Configuration.ConfigurationManager from Nuget

Install-Package System.Configuration.ConfigurationManager

这个问题是一个已知问题,你可以在这里看到,推荐的解决方案是 nuget 包

This problem is a known issue as you can see here and the recommended solution is nuget package

https://github.com/pusher/pusher-websocket-dotnet/问题/34

这篇关于FileNotFoundException:无法加载文件或程序集“System.Configuration.ConfigurationManager,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆