Reputation: 2719
Problem: Can't properly setup LINQPad connection to my Entity Framework dll.
Error: The type initializer for 'System.Data.Entity.Internal.AppConfig' thre an exception. An error occurred creating the configuration section handler for entityFramework: Could not load file or assembly 'EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' on one of its dependencies. The system cannot find the file specified. (C:\Code\NET\FTI_Opp_Model\App.Config line 5)
So I tried doing what @Sorax did in this related question and moved my EntityFramework.dll from the one I got from NuGet in my project into the LINQPad.exe folder. This got me a little further along and the Test now worked. I was encouraged because my connection in the LINQPad panel showed all my entities underneath it.
But when I right click on my Borrower entity and chose "Borrower.Take(100)" I received this error from LINQPad:
The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception.
With an inner exception message:
[A]System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection cannot be cast to [B]System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection. Type A originates from 'EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'Default' at location 'C:\MarkSisson\LinqPad\EntityFramework.dll'. Type B originates from 'EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' in the context 'LoadFrom' at location 'C:\Users\msisson\AppData\Local\Temp\LINQPad\vlnebssu\shadow_ujjvzp\EntityFramework.dll'.
Any ideas?
Upvotes: 3
Views: 1438
Reputation: 1250
Btw the important thing to understand that the type of the assembly also include WHERE IT WAS LOADED.
meaning two same assemblies loaded from different location are not the same type!
Upvotes: 0
Reputation: 30934
Download the latest beta - this problem was fixed in 4.42.05.
Upvotes: 4