Efcore: Discussion: EF Core 2.0 to target .NET Standard 2.0

Created on 25 May 2017  Â·  23Comments  Â·  Source: dotnet/efcore

All 23 comments

We use EF Core on .NET 4.5.2. I assume with this decision, we are out of luck to use v2 on that framework version. Will EF Core 1.x keep getting new features + bug fixes after stable v2 is shipped?

@tugberkugurlu can you elaborate on what prevents you from moving to .NET 4.6.1?

Will EF Core 1.x keep getting new features + bug fixes after stable v2 is shipped?

The current thinking is that we won't develop new features for 1.x. We have identified a few issues that we believe would meet the bar for a patch release, but we haven't closed on a plan for patching.

Not to be a bugger, but whatever was fixed in 2.0 that allows AutoMapper ProjectTo() to work correctly would be a nice addition to a 1.x patch. ProjectTo() works fine in 2.0 and 1.x when the nesting doesn't go beyond a level or so (not Parent-> Child -> Child...)

Wonder if it was this that fixed it in 2.0? Is this in 1.1.2?

https://github.com/aspnet/EntityFramework/issues/8204

When I understand that right, the current Version of Mono is already supporting .net standard 2.0 right?

It's a bit confusing, since it he matrix you posted in the announcement (https://docs.microsoft.com/en-us/dotnet/standard/library) it lists for the most frameworks just vNext. But the currently shipped Mono version is 5.0.1.1 (https://developer.xamarin.com/releases/current/) and based on your announcement should support .net standard 2.0. And update for the matrix would be much appreciated here. Also would make it a bit easier to evaluate the impact of such a change.

Since UWP and EF are kind of a bundle I think it would be improtant to keep the phase in which EF 2.0 can't be used in UWP as short as possible. What could help as well would be a more precise ETA for the UWP update so we can estimate how much time we have to bridge.

Does somebody know when Mono 5.0 will be shipped with VS 2017?
I compiled sucessfully my android-App with Microsoft.EntityFrameworkCore.Sqlite 2.0.0-preview2-final (VisualStudio.15.Preview/15.3.0-pre.2.0+26606.0, Xamarin 4.5.0.481 (cb14994)). But the App crashes during the startup, because it coudn't find netstandard.dll.so, libaot-netstandard.dll.so, Mono.Posix, Version=2.0.0.0...

06-29 16:19:38.454 D/Mono    ( 4110): Assembly Ref addref HandballReporter.Droid[0xab0b0ec0] -> Microsoft.EntityFrameworkCore[0xb06cab60]: 2
06-29 16:19:38.455 D/Mono    ( 4110): Image addref netstandard[0xaeb94d20] -> netstandard.dll[0x9bfb4200]: 2
06-29 16:19:38.455 D/Mono    ( 4110): Prepared to set up assembly 'netstandard' (netstandard.dll)
06-29 16:19:38.455 D/Mono    ( 4110): Assembly netstandard[0xaeb94d20] added to domain RootDomain, ref_count=1
06-29 16:19:38.456 D/Mono    ( 4110): AOT: image 'netstandard.dll.so' not found: dlopen failed: library "/data/app/com.handballreporter.droid-1/lib/x86/libaot-netstandard.dll.so" not found
06-29 16:19:38.457 D/Mono    ( 4110): AOT: image '/usr/local/lib/mono/aot-cache/x86/netstandard.dll.so' not found: dlopen failed: library "/data/app/com.handballreporter.droid-1/lib/x86/libaot-netstandard.dll.so" not found
06-29 16:19:38.457 D/Mono    ( 4110): Config attempting to parse: 'netstandard.dll.config'.
06-29 16:19:38.457 D/Mono    ( 4110): Config attempting to parse: '/usr/local/etc/mono/assemblies/netstandard/netstandard.config'.
06-29 16:19:38.457 D/Mono    ( 4110): Assembly Ref addref Microsoft.EntityFrameworkCore[0xb06cab60] -> netstandard[0xaeb94d20]: 2
06-29 16:19:38.460 D/Mono    ( 4110): Assembly Ref addref netstandard[0xaeb94d20] -> mscorlib[0xab0b0da0]: 38
06-29 16:19:38.464 D/Mono    ( 4110): Assembly Ref addref System.Runtime[0xb2e517a0] -> System[0xaeb948a0]: 4
Loaded assembly: netstandard.dll [External]
Resolved pending breakpoint at 'App.xaml.cs:37,1' to void HandballReporter.XForms.App..ctor () [0x00047].
The connection with the debugger has been lost. The target application may have exited.
System.IO.FileNotFoundException: Die Datei oder Assembly "Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Dateiname: "Mono.Posix, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756"
   bei Mono.Debugging.Soft.SoftDebuggerSession.ResolveSymbolicLink(String path)
   bei Mono.Debugging.Soft.SoftDebuggerSession.PathsAreEqual(String p1, String p2)
   bei Mono.Debugging.Soft.SoftDebuggerSession.FindLocationByMethod(MethodMirror method, String file, Int32 line, Int32 column, Boolean& insideTypeRange)
   bei Mono.Debugging.Soft.SoftDebuggerSession.FindLocationByType(TypeMirror type, String file, Int32 line, Int32 column, Boolean& genericMethod, Boolean& insideTypeRange)
   bei Mono.Debugging.Soft.SoftDebuggerSession.ResolveBreakpoints(TypeMirror type)
   bei Mono.Debugging.Soft.SoftDebuggerSession.HandleTypeLoadEvents(TypeLoadEvent[] events)
   bei Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
   bei Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()

Sorry for this post, but I need help to install Ef Core 2.0 Preview 2 package on VS2015.

I have made these steps:

  • Changed target framework to .NET 4.6.1;
  • Cleared all nuget packages (efCore 1.x and its dependencies);
  • Installed NETStandard.Library.NETFramework package;
  • Added this on vbproj file (as described here):
<PropertyGroup>
  <PackageTargetFallback>netstandard2.0</PackageTargetFallback>
</PropertyGroup>
  • Rebuilt Project.

The error above continues to show on Efcore package installation:

Could not install package 'Microsoft.EntityFrameworkCore 2.0.0-preview2-final'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.1', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

I need help.

Thanks.

@HClausing Could you follow up on NuGet/Home? I'm not sure what the plans are for supporting .NET Standard 2.0 on Visual Studio 2015...

Oh, didn't pay so much attention to this.

By the way, I was using EfCore 1.2 (from myget) and posted yesterday about problems on Where clause for generated SQL statements, and received a help to update EFCore version. Migrated all projects do .NET 4.6.1 but didn't see this limitation of VS2015.

What version os EfCore do you recommend for me?

Thanks.

To test the latest fixes and features, you'll need...

Thank you.

Downloading right now, and trying EfCore 2.0 Preview 1.0 on VS2015 until VS2017 is installing.

Regards.

People who wan't to use EF-Core 2.0 in Xamarin-Projects with VS17 Preview 3 maybe run into a System.IO.FileNotFoundException during the startup phase:
Could not load file or assembly ‘Mono.Posix, Version=2.0.0.0, …
This is a bug in the installation, it can be fixed manually:
https://releases.xamarin.com/common-issues-in-the-xamarin-15-2-2-release-being-tracked-by-the-xamarin-team/

@divega : I wan't to test EF-Core 2.0 on UWP. But currenty UWP supports only .netstandard 1.6.
Over https://dotnet.myget.org/feed/dotnet-core/package/nuget/Microsoft.NETCore.UniversalWindowsPlatform i tried to install the new version with this error:

Install-Package : Unable to find package Microsoft.NETCore.UniversalWindowsPlatform with version (>= 6.0.0-preview2-25520-02)
  - Found 15 version(s) in nuget.org [ Nearest version: 5.4.0-preview1-002111-00 ]
  - Found 3 version(s) in Microsoft Visual Studio Offline Packages [ Nearest version: 5.4.0 ]
  - Found 0 version(s) in CliFallbackFolder
  - Found 0 version(s) in ASPNet
In Zeile:1 Zeichen:1
+ Install-Package Microsoft.NETCore.UniversalWindowsPlatform -Version 6 ...
+     + CategoryInfo          : NotSpecified: (:) [Install-Package], Exception
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand

Do you know if it's possible to install such a version or must developers wait for a newer VS-Version and/or Windows-Update?

Yes, I know this post.
The problem is, that I had a lot of mysterious effects/bug's with EF Core and .net native in the past.
The .net native compiler is unfortunately still instable (Reflection).
For my UWP-Application I just can use EF Core 1.0.0-rc2-final - all other versions doesn't work with .net native.
My aim is, to test it as soon as possible, to prevent that I have to wait more than one year for a newer release of EF (with new features and bugs) which won't work at last.
So it would be also good for microsoft to make this possible for developers to test UWP 2.0 as soon as possible, if they wan't to succeed with new products like Hololens and other IoT-Products in the future.
It's not surprising that smartphones with windows 10 mobile was a flop.

I think you can test UWP by installing the Windows 10 SDK Insider Preview, but I haven't actually tried it yet...

Never mind. I couldn't get it working. (Works now with VS 2017 15.4)

Please check this discussion for UWP6.0 and comment if necessary
https://github.com/almirvuk/Xamarin.Forms_EFCore/issues/1#issue-254869554

2017-09-03_13-38-52

This decision basically kills EFCore for UWP.

EFCore 2.0 is only supported on UWP version 16299, which is not even out yet for the consumer and even if it would be available only a small percentage of the users would have the latest version installed. Especially in the business sector it needs some time to upgrade all devices. Currently in our company we still use 14393 even though 15063 is out a long time now.

The main goal behind UWP and Windows 10 is to have API levels that one can target. I can use any API level as min or as max version and when I would like to use EFCore 2.0 I would limit myself to api level 16299 as min version and couldn't support older windows versions.

And before you say, I could use the current stable 1.1.3. I am using this version currently but I encountered an issue just yet and I'm not able to test if it is still present in the latest version because we are not able to use 2.0.

On other notes, I don't get this decision. Why ist it necessary? The current stable version still feels pretty beta and this kills compatibility for a lot of people. Furthermore I don't get why the preview version of EFCore 2.0 wasn't targeting .Net Standard 2.0 and it was working fine.

I know that limiting yourself to the newest APIs makes life easier but it makes life worse for a lot of other people. Please consider reverting this decision.

Greetings
Gary

+1 for that. Now stuck at EFCore 1.1 since the majority of Win10 aren't there yet.

For Windows apps, EF6 might be the better option for now.

EF6 is not compatible with windows apps

Ah, boo. I think they did that intentionally to stop us from hitting DBs directly from the app. Bummer.

But I guess they changed their minds if EFCore supports it now...

Was this page helpful?
0 / 5 - 0 ratings