Testing Gen 8.6 sample model cooperative application for .NET/C# under Windows Server 2022 VM.
Generated Server Manager P900 for CLR/Oracle/C#.
Assembled and under DataSources "Server Connection Strings", disabled the Encrypt option and set:
Name = GENDB
Data Provider = Oracle.ManagedDataAccess.Client
Data Connection String = Data Source=orcl;User ID=genuser;Password=genuser
After installing the application sample.msi file when the server is called using .NET remoting from a C client see this error:05/13/26-04:19:17:733350[1]: DataSource::Connect(): Attempting to open a DbConnection for (Name=GENDB, ProviderName=Oracle.ManagedDataAccess.Client)05/13/26-04:19:17:889596[1]: DataSource::Connect(): Failed to load DbProviderFactory for "Oracle.ManagedDataAccess.Client", caught: Unable to find the requested .Net Framework Data Provider. It may not be installed.
Gen 8.6 .NET CLR/C#/Oracle
The Oracle Data Provider for .NET ODAC option has been installed via Oracle 32-bit client install (install type "Administrator").
The file Oracle.ManagedDataAccess.dll is visible in directory "C:\app\oracle\product\19.0.0\client_1\odp.net\managed\common".
Per Oracle doc page Oracle® Data Provider for .NET > Developer's Guide> 19c > Installing and Configuring Oracle Data Provider for .NET > Installing Oracle Data Provider for .NET, Managed Driver a configure.bat can be run but that only seems to add registry entries.
To resolve the problem the Oracle.ManagedDataAccess.dll needs to be:
The Oracle utility OraProvCfg.exe can be used to do this.
There is a version to update both x86 .NET Framework machine.config ("C:\app\oracle\product\19.0.0\client_1\odp.net\managed\x86\OraProvCfg.exe") and x64 .NET Framework machine.config ("C:\app\oracle\product\19.0.0\client_1\odp.net\managed\x64\OraProvCfg.exe").
Only the latter was needed in step 2 to resolve this problem - See Additional Information.
C:\>"C:\app\oracle\product\19.0.0\client_1\odp.net\managed\x64\OraProvCfg.exe" /action:gac /providerpath:"C:\app\oracle\product\19.0.0\client_1\odp.net\managed\common\Oracle.ManagedDataAccess.dll"INFO: c:\app\oracle\product\19.0.0\client_1\odp.net\managed\common\oracle.manageddataaccess.dll is registered successfully in GAC.
C:\>"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe" /l Oracle.ManagedDataAccessMicrosoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.0Copyright (c) Microsoft Corporation. All rights reserved.The Global Assembly Cache contains the following assemblies: Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=MSILNumber of items = 1
C:\Users\Administrator>"C:\app\oracle\product\19.0.0\client_1\odp.net\managed\x64\OraProvCfg.exe" /action:config /product:odpm /frameworkversion:v4.0.30319 /providerpath:"C:\app\oracle\product\19.0.0\client_1\odp.net\managed\common\Oracle.ManagedDataAccess.dll"INFO: The following section has been added.<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />INFO: The following element added under DbProviderFactories.<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.19.1, Culture=neutral, PublicKeyToken=89b483f429c47342" />
"Oracle.ManagedDataAccess.Client" is found and the problem is resolved.The built Gen sample model sample.msi file installed to directory "C:\Program Files (x86)\Broadcom\sample" because Build Tool OPTIONS token OPT.BITS was set to default value 32.
However Gen .NET applications are compiled with the 'Platform=AnyCPU' option and can be run as x86 or x64 per Is 64-bit supported for Gen 8.6 .NET proxies, clients or servers.
During this research it was found that the application was being run under x64 .NET Framework which is why this file was changed: "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config".
Similar changes were first tried in the x86 file "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config" using "C:\app\oracle\product\19.0.0\client_1\odp.net\managed\x86\OraProvCfg.exe" in step 2 of the Resolution but they had no effect on the problem.