VS2017 Professional, VB.NET project for .NET Framework 4.0. I got following error messages during build: Type JetConnectionFactory is not defined. I also added JetEntityFrameworkProvider.dll to GAC. I installedJetEntityFrameworkProvider v6.1.4 from NuGet and I confirm that the library is referenced and exists. I am trying to setup DbContext configuration dynamically like:
...
Imports JetEntityFrameworkProvider
Public Class ORMConfiguration
Inherits DbConfiguration
Public Sub DbContextConfiguration()
Dim con1 = New OleDb.OleDbConnection(ORMGlobal.ConnectionString)
SetProviderServices("JetEntityFrameworkProvider", Core.Common.DbProviderServices.GetProviderServices(con1))
SetDefaultConnectionFactory(New JetConnectionFactory())
End Sub
End Class
<DbConfigurationType(GetType(ORMConfiguration))>
Partial Public Class ORM
Inherits DbContext
Public Sub New()
MyBase.New(ORMGlobal.ConnectionString)
End Sub
End Class
...
VS2017 Professional, VB.NET project for .NET Framework 4.0. I got following error messages during build:
Type JetConnectionFactory is not defined
. I also addedJetEntityFrameworkProvider.dll
to GAC. I installedJetEntityFrameworkProvider
v6.1.4 from NuGet and I confirm that the library is referenced and exists. I am trying to setupDbContext
configuration dynamically like:My app.config:
How can I dynamically select
JetEntityFrameworkProvider
provider for DbContext and set connection string properly?