I created an entity model based on SQL Server Table in my project. I write get operation on button click. When I am opening the page for first time its working fine for me. but on button click I am getting the following error:
Could not load file or assembly 'EntityFramework, Version=22.214.171.124, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
I tried putting
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=126.96.36.199, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
in app.config, but it doesn't resolve the issue.
Basically go to Entity Framework in the references section, go to it's properties and select "Copy Local" = "True".
Credit to Respuestas/Jambor