问题描述
限时送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:关键词]
发布评论