ASP.NET Core support
I am anxiously waiting for EF Core support in LINQPad. The description in Beta says that the support is there, and there is EF 7 (EF Core) driver, currently in version 1.0.1; however, as described here it just doesn't work. Any update on ETA? Not to sound bitter, but I convinced my boss to buy half-dozen copies for the team, but he is holding off since the use-case for just DB driver is quite limited...
Comments
In other words, 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
Anyway - yes, I am pretty sure the assemblies are full ASP.NET Core assemblies. I don't think EF Core would work if I used more limited .NET Core - and I have no problems with the application itself. It's not .NET Console, but rather .NET Web Application, but I hope it doesn't matter.
The problem is very easy to reproduce, and it's consistent! Create a sample .NET Core Web application, add EF Core (NuGet Microsoft.EntityFrameworkCore.SqlServer package), create EF classes (I created from DB by running Scaffold-DbContext) and compile. Then try to publish (to create DLLs, and reference resultant DLL from LinqPad). Get an error.
Are you saying it works for you? Or there is a different scenario that works, and this scenario is not supported (yet)? We currently have Core 1.0 and will be upgrading to 1.0.1 this week if it matters...
Thank you
PS. I am not sure how the linked article would help me - I am not trying to use .NET 4.5 in any way... My framework setting is "netcoreapp1.0".
I read in your comment elsewhere that Linqpad is .NET 4.6 application and can't read Core DLL. Maybe an example what *works* would answer all the questions. Most of us are smart kids - we can probably figure out how to use a working example in our own application
However, if you generate a .NET Core project in Visual Studio or from the command-line (instead of a full .NET project), you won't be able to use the output assemblies in LINQPad. I appreciate that the situation is confusing.
The underlying cause (as I understand), is that you cannot reference a .NET Core library from a .NET Framework application, because .NET Core is not a strict subset of .NET Framework; it relies on a *different* and incompatible runtime.
As I alluded to previously, it seems (at least from reading the documentation and articles on the web) that it should be possible to create a .NET Core project, and then modify the project.json file and adding a build target so that it generates both netcore assemblies and full .NET (or "netstandard") assemblies that you can consume from a .NET application such as LINQPad. I've recently spent some time trying to get a working sample, but unfortunately without success. It's possible that someone else will have more luck (maybe some from Microsoft?)
In terms of a proper solution, I hope that Microsoft will improve the situation in the future. It would be great if there was a way to reference NetCore assemblies from a full .NET Framework application. Perhaps one of the challenges is that there are types and methods in .NET Core that are not present in the .NET Framework. Could these be stubbed / NOP-ed, or they be implemented in a downloadable additional library?