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; } 

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

System.TypeInitializationException: 'The type initializer for 'OracleInternal.Common.ProviderConfig' threw an exception

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 ??

6

1 Answer

You can Install System.Configuration.ConfigurationManager from Nuget

Install-Package System.Configuration.ConfigurationManager 

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

1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy