I'm running a .NET application in Visual Studio 2022 that uses the Oracle.ManagedDataAccess
NuGet package, version 23.5.1 (DLL version 4.122.23.1).
Recently, I've started encountering the following runtime error when deploying the application to a server:
"The type initializer for 'Oracle.ManagedDataAccess.Client.OracleCommand' threw an exception."
This issue previously did not occur and the application was functioning correctly. Interestingly, the same error now occurs even when connecting to and testing the application from my development machine, which was also working before.
As a temporary fix, I downgraded the NuGet package by removing version 23.5.1 and instead shipped the older Oracle.ManagedDataAccess.dll
version 4.122.19.1 ( not using the nuget package, just adding the dll as a reference in the project and shipping this with the deployment). With this version, the application works as expected.
However, I'd like to resolve the issue with version 23.5.1 and get it working again in the deployed environment.