The startup project that references the project where Entity Framework is being used needs the following two assemblies in it's bin folder:
- EntityFramework.dll
- EntityFramework.SqlServer.dll
Adding a <section>
to the <configSections>
of the .config file on the startup project makes the first assembly available in that bin directory. You can copy this from the .config file of your Entity Framework project:
<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" />
</configSections>
To make the second .dll available in the bin folder, although not practical, a manual copy from the bin folder of the Entity Framework project can be made.
A better alternative is to add to the Post-Build Events of the Entity Framework project the following lines, which will automate the process:
cd $(ProjectDir)
xcopy /y bin\Debug\EntityFramework.SqlServer.dll ..\{PATH_TO_THE_PROJECT_THAT_NEEDS_THE_DLL}\bin\Debug\
providers
andprovider
stuff, so consider removing it? – Plugpublic BaseStorage(): base ("RaptorDB") {}
, BaseStorage() inherits from DbContext in EF5 everything worked perfectly, not already in EF6. – Hammad