我使用:
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;
数据库-db.accdb;
表格-项目,任务。
EntityFramework,通过Nuget安装的JetEntityFrameworkProvider。
文件App.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
我更改了文件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>
复制了项目(F6)。
问题。
如何通过实体框架和JetEntityFrameworkProvider连接到Access(* .accdb)?
更新_2
我从https://github.com/bubibubi/JetEntityFrameworkProvider下载了该项目
对于项目“ JetDdexProvider”进行“分配启动项目”
按下 F6
收到错误
*错误
从代码“%ProgramFiles%\ Microsoft SDKs \ Windows \ v8.0A \ Bin \ NETFX 4.0 Tools \ gacutil.exe“ / u” JetEntityFrameworkProvider“”退出,代码为3。
错误 从命令“调用”退出C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Community2 \ Common7 \ IDE \ .. \ Tools \ vsvars32.bat“ gacutil / u JetEntityFrameworkProvider.dll“,代码为9009。JetDdexProvider
错误CS0006
找不到元数据文件“ 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
错误CS0006
找不到元数据文件“ 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 *