코드 우선을 사용하여 Entity Framework 6에서 SQL CE WPF를 개인적으로 배포하려고합니다. 개발 시스템 데이터베이스에SQLCE 4 개인 배포 엔터티 프레임 워크 6
가의 AppData 폴더에 잘 생성하고 모든 내가 (더 dB) 예외를 얻을 테스트 PC에 그러나 잘 작동 :이 문제에 대한 가능한 모든 문학을 구현하기 위해 노력했습니다
"The ADO.NET provide with invariant name 'System.Data.SQlServerCe.40' is either not registered in the machine or application config file'
하지만, 여전히 문제가 있습니다. Bin 폴더를 Deployed Folder로 확인했는데 동일합니다. 모든 라이브러리 (x86 및 amd64)가 있고 Project Platform 대상은 x86입니다.
- No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlServerCe.4.0'
- http://erikej.blogspot.dk/2013/11/entity-framework-6-sql-server-compact-4_25.html
- Entity Framewok Code First "ADO.NET provider not found" with local SQL Server CE DLL's
우는 소리가 나는 또한 울부 짖는 코드를 추가 한 내의 App.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
</configSections>
<entityFramework>
<contexts>
<context type="MyProject.DAL.GreatContext, MyProject">
<databaseInitializer type="MyProject.Module.Database.Dal.GreatDbInitializer, MyProject" />
</context>
</contexts>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SqlServerCe.4.0" type="System.Data.Entity.SqlServerCompact.SqlCeProviderServices, EntityFramework.SqlServerCompact" />
</providers>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlCeConnectionFactory, EntityFramework">
<parameters>
<parameter value="System.Data.SqlServerCe.4.0" />
</parameters>
</defaultConnectionFactory>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SqlServerCe.4.0" />
<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"/>
</DbProviderFactories>
</system.data>
</configuration>
하지만 여전히 문제는 남아 :
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
의견이 있으십니까? 당신을 가정
사용할 수 있나요? – ErikEJ