Linqpad, Entity Framework and .net 5.0 (vNext)

I have been playing around with .net 5.0 pre-release. I use Linqpad to debug and check linq-to-entities queries. Hiterto this has involved setting up a data connection by referencing the binaries in the appropriate build directory for the solution. The .net 5.0 framework does not appear to have a build directory, or any .dll or .exe files within the solution.

Is it going to be possible to use Linq-pad with .net 5.0 (vNext), and if so what steps need to be taken?

This is part question (is this possible and how) and partly to make people aware of an upcoming issue as .net 5.0 moves to release version

Comments

  • You can generate dll - in Project - Properties - Build tab check "produce outputs on build". DLL will be in artifacts\bin\[project name]\Debug\dnx451\ or dnxcore50 directory. However, when I add this dll to EntityFramework (DbContext) data context and click on "Choose" link , I am getting the following error popup:
    "Could not load file or assembly Microsoft.AspNet.Mvc.ViewFeatures, Version=6.0.0. I am using EF7...
  • LINQPad now supports Entity Framework 7. Go to Add Connection | View more drivers, and click the link for EF7.
  • Can you autogenerate the classes like for LINQ To SQL?
  • This might become a reality as EF7 matures. Right now, EF7 lacks features such as lazy loading of navigation properties, and this would degrade the experience.
  • Like @virshu above, when I attempt to use the EF7 driver, a similar error when I attempt to connect to my dll.
  • No luck using the EF7 driver on dnxcore50. It just throws an error when loading a custom assembly: "Cannot load assembly: Microsoft.AspNet.Identity.EntityFramework, Version=3.0.0.0"
  • I updated to the latest Beta (5.06.08), but I still get similar error. I even tried to load the DLL that gets published to the server - so I know it is the right DLL; but all I get is Could not load Assembly. Now it is System.Runtime - cannot find the file specified. In other cases it was Microsoft.AspNetCore.MvcViewFeatures, but also "cannot find the file specified". Clearly I am doing something wrong - but nothing obvious comes to mind. Currently I am using ASP.NET RC2, but I had exactly same issue with RC1 as well
  • edited July 2016
    I am currently running
    .NETCore.App: 1.0.0-rc2-3002702
    .EntityFrameworkCore.Tools: 1.0.0-preview1-final
    Pomelo.EntityFrameworkCore.MySql: 0.0-prerelease-20160730
    LINQPad: 5.08.01
    LinqPad EntityFramework V7 Driver: 1.0.1.0

    Getting the same, "Could not load Assembly. System.Runtime, Version=4.1.0.0, PublicKeyToken=b03f5f7f11d50a3a when adding connection

    Have added additional Reference 4.1.0.0 System.Runtime from NuGet to LINQPad.

    Not sure if it is the MySql connector is the issue, if LinqPad is the issue or My issue. Any suggestions or can somebody tell me it is not working at this time with what I'm working with. Thanks in advance.
  • Judging from another error report, I suspect that the assemblies that you're referencing could be .NET Core assemblies that are not compatible with the full .NET Framework.

    If you create a .NET Console app, can you reference your EF Core assemblies and use them?

    And if not, does the following help:
    https://github.com/dotnet/core/issues/89
  • I have the same problem, apparently, LINQPad does not support EF Core RTM. Any ideas on when this may be supported?
  • Hello... anybody home?!
  • Where are you trying to reference assemblies from? What's the folder name?

    LINQPad is a .NET 4.6 application, which means you you can only reference assemblies that target NET4.6.x or earlier. From the error message reported a few messages up, it sounds like you're trying to reference netcore assemblies from LINQPad, a NET46 application, and this is not allowed. The solution is to add a NET46 build target to your project.json file and then reference the assemblies in the net46 folder.

    If you've already tried this, or are getting a different error message, let me know.

  • The question was *explicitly* about .NET Core.
    Your statement "LINQPad now supports Entity Framework 7" doesn't seem to be accurate.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!