Does LinqPad Support EF 4.3.1 now?

edited April 2012
If so, how do make it work? I grab the latest version of EF's dll file and paste into my LinqPad folder, the connection string is fine, but when I try to run the query, exception throw.


  • Options
    I was getting an exception related to casting the sections of my config. If this is the error you're experiencing, I was able to make it work by creating a dummy config that only contained the connectionStrings section. And then directing LinqPad to it. Ex:
    <?xml version="1.0" encoding="utf-8"?>
        <add name="Context" providerName="System.Data.SqlClient" connectionString="Server=.;Database=Reporting;Trusted_Connection=true" />
    Let me know if this helps.
  • Options
    Thank you Thank you Thank you!!!

    And I can confirm that this method worth with EF5 beta 2!!
  • Options
    I've reproduced the error and fixed it for 4.42.5, so that you won't need to edit the config file anymore:
  • Options
    If anyone is still experiencing this, let me know. I've not been able to reproduce this myself since changing the assembly binding mechanism in v4.42.5.
  • Options
    edited September 2012
    Hi Joe, I am still seeing this. This is what I am using and the steps I followed:

    Visual Studio 2010 SP1
    SQL Server 2008R2

    - Create a Console App
    - Add a model
    - Add the EF 4.3.1 package via NuGet
    - Remove the default code generator from the model
    - Add the DBContext template
    - write some code to check it works

    Start LINQPad and add your console app and the config that was created. It will test OK but as soon as you try to run a query you will get the error. The config file created by Visual Studio looks like this:
    <?xml version="1.0" encoding="utf-8"?>
        <!-- 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=, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
          <!-- This section defines the logging configuration for My.Application.Log -->
          <source name="DefaultSource" switchName="DefaultSwitch">
              <add name="FileLog" />
              <!-- Uncomment the below section to write to the Application Event Log -->
              <!--<add name="EventLog"/>-->
          <add name="DefaultSwitch" value="Information" />
          <add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter" />
          <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
          <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
        <add name="ReportServerEntities" connectionString="metadata=res://*/Sample.csdl|res://*/Sample.ssdl|res://*/Sample.msl;provider=System.Data.SqlClient;provider connection string="data source=SERVER;initial catalog=ReportServer;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
        <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">
            <parameter value="Data Source=(localdb)\v11.0; Integrated Security=True; MultipleActiveResultSets=True" />
  • Options
    I am experiencing the same problem as above.
  • Options
    Same here. It works with EF4.1, but I get this issue with EF5.
Sign In or Register to comment.