SQLProvider
SQLProvider copied to clipboard
Resolution path not used for runtime execution (Oracle ODP.NET dll)
Description
Path to Oracle ODB.NET driver (e.g. Oracle.ManagedDataAccess.dll) is not used for runtime version. When executing a project compiled for .NET 4.7.3 / F# 4.6 with the SQLProvider, I run into an exception stating: "Unable to resolve assemblies. One of Oracle.ManagedDataAccess.dll, Oracle.DataAccess.dll must exist in the paths: ..." It seems the path given with parameter "ResolutionPath" is not used.
The same code is executed without errors in FSI (here the path given is definitely used).
Repro steps
-
Setup new project in Visual Studio 2019 (F# Console App .NET Framework).
-
Add SQLProvider via NuGet and setut initialization code (SqlDataProvider) with "ResolutionPath" set to Oracle-Driver directory.
Expected behavior
Runs like the FSI version and uses the Oracle.ManagedDataAccess.dll version from the Oracle driver installation.
Actual behavior
Exception is thrown "Unable to resolve assemblies" (see above).
Known workarounds
Seems like it works when I copy Oracle.ManagedDataAccess.dll to the .exe directory.
Related information
- Used database: Oracle
- Operating system: Windows 7
- .NET 4.7.3
I'm having the same issue with SQLITE and, since I'm using SQL Provider inside a library, called from a web project in IIS, it works when I copy the required dll to the dll source folder instead of the bin folder of either the library or the final web project (this is what the exception message suggests in my case).
Practically speaking I'm forced to link the sqlite driver to the project reference of my SQLProvider library, that defeats the purpose of using a ResolutionPath
imo. It's funny that it works instead if I test the library from the F# interactive...
I've found that it works at runtime when I put the resolution path in the GetDataContext
call !
let context = Sql.GetDataContext(myConnStr, resolutionPath)