Error: Could not load file or assembly 'Oracle.ManagedDataAccessDTC' or one of its dependencies Error: Could not load file or assembly 'Oracle.ManagedDataAccessDTC' or one of its dependencies oracle oracle

Error: Could not load file or assembly 'Oracle.ManagedDataAccessDTC' or one of its dependencies


Based on your PrivatePath (C:\Users\killesj1\Repositories\PEApps\src\app\PEApps.Web\bin) and the subsequent bind attempt for Oracle.ManagedDataAccessDTC.DLL in that private path, you have a copy of the ODP DTC assembly in the application's "bin" directory. Though you don't show it here, the Stack Trace section of the output should show a call to LoadAllAssembliesFromAppDomainBinDirectory. That method will attempt to load all .dll files in the application's "bin" directory. In your case you have a mismatch with respect to bitness of the ODP DTC assembly and the executing process (you've noted you are aware of this sort of issue).

The reason you do not see this issue with a console application is because such an application will not call the LoadAllAssembliesFromAppDomainBinDirectory method (or similar) to "preload" assemblies.

As to how the ODP DTC assembly got into the application's bin directory, perhaps you inadvertently included a reference to it and set "Copy Local" to "True". Or perhaps you added the ODP DTC assembly file to the project and set "Copy To Output Directory" to "True". It's also possible that the file was manually copied into the directory. In other words, there are multiple possibilities as to how the file ended up in the directory.