I am trying to scaffold some classes from an Oracle database for use with a .NET Core Web API. I have installed the following nuget packages:
Oracle.EntityFrameworkCore - v2.18.0-beta3
Oracle.ManagedDataAccess.Core - v2.18.6
I have tried scaffolding with both providers, and I get two different errors.
Scaffold command - Scaffold-DbContext "Data Source=(DESCRIPTION=(ADDRESS_LIST= (ADDRESS=(COMMUNITY=tcpcom.world)(PROTOCOL=tcp)(HOST={Host})(PORT={Port})))(CONNECT_DATA=(SID={SID}))); User ID={UserId};Password={Password}" {Provider} -o Models
ORA-01017: invalid username/password; logon denied
Unable to find expected assembly attribute named DesignTimeProviderServicesAttribute in provider assembly
Oracle.ManagedDataAccess. This attribute is required to identify the class which acts as the design-time service provider factory.
IDesignTimeDbContextFactory<T>
interface with no luckI've tried countless things from google today with no luck. Could this be a problem with the Oracle drivers?
EDIT
I have created a .NET Core console app, installed EF Core and Oracle.EntityFrameworkCore and tried to scaffold but get the same error. Also confirmed connection string is correct by using it to create a DbContext and query a table, returning records.
The issue turned out to be a dollar sign $
in the password. The VS Package Manager console provides a PowerShell interface, and the $
is a reserved symbol in PowerShell, so it needed to be escaped by placing a backtick `
in front of the $
.
Answer from Oracle Community forums.