EntityFramework-Plus icon indicating copy to clipboard operation
EntityFramework-Plus copied to clipboard

Net Native won't compile when using UWP and EntityFramework.Plus.EFCore

Open mabbond opened this issue 6 years ago • 7 comments

Description

I'm trying to compile an app using .Net Native. But the app won't compile. Create a blank uwp app. Add a .netstandard2 class library Add Z.EntityFramework.Plus.EFCore 3 Add a reference to the class library from the UWP app.

Exception

Warning MCG : warning MCG0007: Unresolved P/Invoke

Exception message:
Stack trace:

Warning MCG : warning MCG0007: Unresolved P/Invoke method 'ntdll!RtlGetVersion' for method 'System.Int32 Microsoft.DotNet.PlatformAbstractions.Native.NativeMethods.Windows.RtlGetVersion(Microsoft.DotNet.PlatformAbstractions.Native.NativeMethods.Windows.RTL_OSVERSIONINFOEX)'. Calling this method would throw exception at runtime. Please make sure the P/Invoke either points to a Windows API allowed in UWP applications, or a native DLL that is part of the package. If for some reason your P/Invoke does not satisfy those requirements, please use [DllImport(ExactSpelling=true) to indicate that you understand the implications of using non-UWP APIs.

mabbond avatar Dec 21 '19 14:12 mabbond

Hello @mabbond ,

Thank you for reporting,

We will look at it to determine if that's possible for us to do something.

Best Regards,

Jon


Performance Libraries context.BulkInsert(list, options => options.BatchSize = 1000); Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation Eval.Execute("x + y", new {x = 1, y = 2}); // return 3 C# Eval FunctionSQL Eval Function

JonathanMagnan avatar Dec 24 '19 16:12 JonathanMagnan

Hello @mabbond ,

Sorry for the long delay.

Do your project is working when adding EF Core without our library? If so, could you provide ta new project that compiles with EF Core added?

From what we have read so far, you are not the only one to have this kind of issue and it doesn't seem related to our library.

JonathanMagnan avatar Jan 03 '20 17:01 JonathanMagnan

I have the same issue with Z EF Plus 3.41 for Xamarin, UWP project. Removing your library results in being able to compile in release mode, Adding your library results in the error.

tommy-uytterhaegen avatar Jun 17 '21 04:06 tommy-uytterhaegen

Hello @Tuytje ,

Could you give us a small runnable project with the minimum code required) that show this error?

JonathanMagnan avatar Jun 17 '21 13:06 JonathanMagnan

Don't have the time to produce a runnable project at this time. I can supply more info if needed. Do you have a minimum runnable project with Z EF Plus, Xamarin, UWP (SQLite) that I could try to run? If that works I can try to carve away a bit of time to run it for me and see if it fails whjen trying to build with .NET chain enabled

I have been hunting this bug for some time. Finally found out it was to do with the Z EF Plus libraries.

I've switch back & forth (add/remove library) 3 times, to make sure. I tried with the paid library as well and that one didn't have the issue (but I can't pay $800 / year :)).

I have been digging deeper in the actual thing the compiler nags about and it seems it has a problem with types that can already be null being used as a nullable type like object & string (you can do int?, long?, etc, but a type that is already nullable gives problems when using them as nullable object?, string?). I can't say 100% sure that this is the issue, but the errors & log point in that type of error, within the library (since it works when Z EF Plus is removed).

I love the library and would love to be able to use it, but I will be forced to strip it out if a solution or work-a-round can't be found

tommy-uytterhaegen avatar Jun 18 '21 08:06 tommy-uytterhaegen

Hello @Tuytje ,

No, and unfortunately we don't have either time to produce this kind of application and we don't really know/use Xamarin.

As for the paid library, you can only purchase it once (license works forever, you just don't get access to new release after 1 year) but that's another story. There is a good chance that if the issue doesn't get fixed for EF Plus, it will also eventually be part of EF Extensions as well since we don't know what is currently "wrong" in the code.

JonathanMagnan avatar Jun 21 '21 12:06 JonathanMagnan

I wish I had time to deliver the project, since I do like the library. The solution for me was to remove EF Core Plus & rewrite the code that used it, using another library that does similar things. The build work now. I really hope you find the issue. Please comment on this thread once you do, I'd like to know :)

tommy-uytterhaegen avatar Jun 22 '21 09:06 tommy-uytterhaegen