Skip to content

System.Runtime.Caching dependency in Z.Expressions.Eval prevent using in Xamarin #577

Closed

Description

@WebDucer

Description

We use Z.EntityFramework.Plus.EFCore in our Xamarin.Forms apps. The verion 3.0.34 break the compability. As I can see, Z.Expressions.Eval adds new dependency from version 3.1.0, System.Runtime.Caching. This dependency prevent apps from build. On build we get the error below:

Can not resolve reference: `System.Runtime.Caching`, referenced by `Z.Expressions.Eval`. Please add a NuGet package or assembly reference for `System.Runtime.Caching`, or remove the reference to `Z.Expressions.Eval`.

Adding of System.Runtime.Caching NuGet package to the project doesn't help.

Further technical details

  • EF version: 3.1
  • EF Plus version: 3.0.34
  • Database Provider: SQLite

Activity

  1. JonathanMagnan commented on Jan 30, 2020

    @JonathanMagnan
    Member

    Hello @WebDucer ,

    Thank you for reporting, we will look at it why that's not working

    Best Regards,

    Jon


    Performance Libraries
    context.BulkInsert(list, options => options.BatchSize = 1000);
    Entity Framework Extensions • Entity Framework Classic • Bulk Operations • Dapper Plus

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

  2. JonathanMagnan commented on Feb 5, 2020

    @JonathanMagnan
    Member

    Hello @WebDucer ,

    My developer didn't succeed to reproduce the issue.

    It's possible for you to provide a small runnable project with the issue? It will be faster for us to find out why that's not working.

  3. JonathanMagnan commented on Feb 7, 2020

    @JonathanMagnan
    Member

    Hello @WebDucer

    Since our last conversation, we haven't heard from you.

    As mentioned in my previous message, is it possible for you to provide a small runnable project with the issue?

    Looking forward to hearing from you,

    Jon

  4. MartinLeist commented on Feb 7, 2020

    @MartinLeist

    Hello @JonathanMagnan

    I'm having the same issue and created a small sample project where I could reproduce it. I get the error when trying to compile the android project.
    SampleIssue.zip

    thanks in advance
    Martin

  5. JonathanMagnan commented on Feb 7, 2020

    @JonathanMagnan
    Member

    Awesome thank you ;) We will look at it.

  6. JonathanMagnan commented on Feb 8, 2020

    @JonathanMagnan
    Member

    Here is what my developer found so far: dotnet/runtime#28686

    It seems there was indeed an issue with Xamarin.Android and the caching library.

    It looks to be fixed in v3.0

    Is it possible for you to upgrade to this version?

    On our side, we had to do this change to make sure all framework version was using the same cache, and no 2 different caching libraries.

  7. WebDucer commented on Feb 8, 2020

    @WebDucer
    Author

    Thanks. I will try it on Monday and see what versions we use in Android projects.

  8. MartinLeist commented on Feb 10, 2020

    @MartinLeist

    I'm not sure how I would get to the correct version. I'm using VS 2019 16.4.4 which should have the latest .net Core SDK included. I tried updating to the latest Xamarin.Forms version (4.4.0.991640) and downgrading the EFCore Version to 3.0.2, using .NetStandard 2.1.

    Everything to no avail. I'm still getting the error. Am I missing some place where I could change a version? My Android version for compiling is 9.0, min-version 5.0 and targetversion 9.0.

  9. JonathanMagnan commented on Feb 11, 2020

    @JonathanMagnan
    Member

    That's a very good question @MartinLeist ,

    No one is used with Xamarin here (just the very basic). We tried on our side and didn't find how to make it works either.

    We are currently in discussion about moving all our .NET Core project to use the new Microsoft.Extensions.Caching cache (which was used previously). If this change gets accepted, we will try to do it this week.

    Personally, I don't like the fact that the .NET Framework and .NET Core projects will use a different cache but we might not have the choice to eventually move to this one either.

    I will let you know more very soon.

  10. JonathanMagnan commented on Feb 12, 2020

    @JonathanMagnan
    Member

    Hello @WebDucer , @MartinLeist ,

    Just to let you know that the final decision was to move all .NET Standard version of our library to use instead Microsoft.Extensions.Caching.

    So probably at the start of next week, our library will no longer use System.Runtime.Caching dll.

    So this issue will be fixed soon ;)

  11. JonathanMagnan commented on Feb 17, 2020

    @JonathanMagnan
    Member

    Hello,

    A new version has been released.

    For EF Core, our library should no longer have a dependency on System.Runtime.Caching.

    Could you try it and let us know if that's now working?

  12. JonathanMagnan commented on Feb 24, 2020

    @JonathanMagnan
    Member

    Hello,

    Since our previous conversation, we haven't heard from you.

    Did you get the time to try out the new version?

    looking forward to hearing from you,

    Jon

  13. MartinLeist commented on Feb 25, 2020

    @MartinLeist

    Hi @JonathanMagnan

    sorry for the late answer. I did not have time to attempt the EFCore 3 update again earlier. I tried today and while I still get errors, they are not with your project. The compilation works now. I also updated my sample project to EFCore 3.1.2 and Z.EntityFramework.Plus.EFCore 3.0.39 and it now has no problem with compilation anymore.

    Thanks.

  14. JonathanMagnan commented on Feb 25, 2020

    @JonathanMagnan
    Member

    Awesome, thank you for letting us know.

    Have a great day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions