FileNotFoundException:无法加载文件或程序集“System.Configuration.ConfigurationManager,

编程入门 行业动态 更新时间:2024-10-26 12:35:33
本文介绍了FileNotFoundException:无法加载文件或程序集“System.Configuration.ConfigurationManager,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

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

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

private OracleConnection GetOracleConnection()
{
            string conString = "Data Source=Q550.adr.XXXX;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/pusher/pusher-websocket-dotnet/问题/34

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

更多推荐

[db:关键词]

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

发布评论

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

>www.elefans.com

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