0

I use:  Visual Studio 2017;
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />;
EntityFramework - 6.1.4;
JetEntityFrameworkProvider - 6.2.0;
WinForm;

MS Access - 2016;
Database - db.accdb;
Tables - Project, Task.

EntityFramework, JetEntityFrameworkProvider installed through Nuget.

 
File App.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup> 
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
    </startup>

</configuration>

I changed the file machine.config:
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config

  <DbProviderFactories>
      <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
      <add name="JetEntityFrameworkProvider" invariant="JetEntityFrameworkProvider" description="JetEntityFrameworkProvider" type="JetEntityFrameworkProvider.JetProviderFactory, JetEntityFrameworkProvider, Version=6.0.0.0, Culture=neutral, PublicKeyToken=756cf6beb8fe7b41" />
    </DbProviderFactories>

Copied the project(F6).

I do the following
enter image description here enter image description here  enter image description here  [enter image description here enter image description here

Question.
How to connect to Access (*.accdb) via Entity Framework and JetEntityFrameworkProvider?

Update_1
Installed "DDEX" via Nuget
enter image description here

Update_2
I downloaded the project at https://github.com/bubibubi/JetEntityFrameworkProvider
enter image description here

For the project "JetDdexProvider" made "Assign a startup project"
enter image description here

Pressed F6
Received errors
*Error exit from the ""% ProgramFiles% \ Microsoft SDKs \ Windows \ v8.0A \ Bin \ NETFX 4.0 Tools \ gacutil.exe "/ u" JetEntityFrameworkProvider "" with code 3.

Error exit from the command "call" C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Community2 \ Common7 \ IDE \ .. \ Tools \ vsvars32.bat " gacutil / u JetEntityFrameworkProvider.dll "with code 9009. JetDdexProvider

Error CS0006
Could not find the metadata file "Z: \ vs \ csharp \ dll \ JetEntityFrameworkProvider \ 2018.05.16 \ fl \ Debug \ JetEntityFrameworkProvider.dll". JetEntityFrameworkProvider.Test Z: \ vs \ csharp \ dll \ JetEntityFrameworkProvider \ 2018.05.16 \ fl \ JetEntityFrameworkProvider.Test \ CSC 1

Error CS0006
Could not find the metadata file "Z: \ vs \ csharp \ dll \ JetEntityFrameworkProvider \ 2018.05.16 \ fl \ Debug \ JetEntityFrameworkProvider.dll". JetEntityFrameworkProvider.Utilities Z: \ vs \ csharp \ dll \ JetEntityFrameworkProvider \ 2018.05.16 \ fl \ JetEntityFrameworkProvider.Utilities \ CSC*

eusataf
  • 807
  • 1
  • 12
  • 24
  • For use DBFirst you need to compile from source code and install the Visual Studio extension (DDEX Provider). Your issue is related to the DDEX provider registration. You need to check install.cmd and update it with the proper registry key (related to VS 2017). – bubi Feb 06 '19 at 06:46
  • @bubi Where is the "install.cmd" file? How to update it? – eusataf Feb 06 '19 at 09:22
  • It's part of the source code. It should be in DDEX project – bubi Feb 06 '19 at 18:04
  • @bubi Installed "DDEX" via Nuget. I did the right thing? Sorry, but I do not understand.   What to do next? Updated the question. – eusataf Feb 06 '19 at 18:35
  • @bubi EntityFramework, JetEntityFrameworkProvider installed through Nuget. – eusataf Feb 06 '19 at 18:36
  • DDEX is not included in NuGet package. NuGet package contains only codefirst libraries. To use DDEX you need to compile the provider from source code (and fix install.cmd). – bubi Feb 07 '19 at 10:48
  • @bubi Updated the question. See "Update_2". What needs to be fixed in "install.cmd"? How to perform "install.cmd" fixes? – eusataf Feb 07 '19 at 14:05

0 Answers0