Realm-dotnet: Add Support for .NET Standard Libraries

Created on 2 Aug 2016  路  6Comments  路  Source: realm/realm-dotnet

The reason I bring this up is because many tools are being moved over to support .NET Core over PCLs. I am trying to use realm and automapper. Automapper 5.0 doesn't support PCLs, it supports .NET core. I can bridge the automapper components from the .NET core library through iOS and Android projects into the pcl which references. However, that is a hassle and it be nice to have either just pcls or just .NET core libraries in my solution.

Goal

The ability to use Realm for Xamarin in a .NET Core library instead of a PCL. I don't know if this is possible currently.

Expected Results

Realm can be used in a .NET Core library for Xamarin iOS and Android (and any other .NET platforms Realm plans to support)

Would love to hear thoughts on this!

T-Enhancement

Most helpful comment

Realm is now a .NET Standard 1.4 library.

All 6 comments

In general, supporting any new standards in the .NET ecosystem is a goal for us and we have already discussed this as being desirable.

Xamarin
Official blog post about .Net Standard Libraries.

There is also a State of the Union meetup in NYC on Aug 16 which includes _Beyond the basics, we鈥檒l look at the world of Cross-Platform .NET, how Xamarin & Mono fit in, .NET Core and the new .NET Standard._ so I suggest we will know more after that. It was advertised in the Xamarin Forums so there may be followup discussions there.

We would very happily accept a PR which helped us towards this, bearing in mind that we of course also need to continue shipping the PCL versions.

.NET Core in General

Any advice on migration issues would also be welcome. Whilst we are focused on the Xamarin mobile platforms of iOS and Android at present, we are also moving towards Windows desktop and UWP releases. Would it make more sense for us to consider .NET Core in the context of ASP.NET support?

The big complication is that we bundle a native library so need a pattern for how to link to that. And, as far as deploying to other platforms goes, we obviously have to build that native library for each of the Linux platforms on which you might run a .NET Core server.

With PCL, provided we have the same interfaces available in both PCL and platform-specific builds, the right code is automatically used. NuGet facilitates this but it is primarily the linker doing the work. (You can set this up by hand without NuGet). We need to know the .NET Core equivalent setup.

Migration and architecture articles of interest found so far:

Looking at the AutoMapper wiki home page it says it supports _.NET Platform Standard 1.1_.

That is a different, although related, thing from .Net Core. So I have renamed this issue to reflect the real need, which is more achievable.

I apologize, that is exactly what I meant. I am not asking for new platforms or anything here. Just iOS and Android with .NET Standard Libraries. Sorry for my misunderstanding of the difference.

Realm is now a .NET Standard 1.4 library.

By supporting 1.4, does it automatically support 2.0? The reason I ask is because I am targeting .NET Standard 2.0 in my app and when I call the Realm.GetInstance() it gives me an install loop error (Don't have the exact error in front of me right now). Should my app work on .NET Standard 2.0 or is that going to happen in the future? I see this: https://github.com/realm/realm-dotnet/pull/1567 but I'm just a little confused as to what should work right now and what is coming?

1567 is unrelated - it only affects XF on UWP and even without it, Realm works there. Yes, we support 2.0, so if you get errors in such a project, feel free to open a new issue.

Was this page helpful?
0 / 5 - 0 ratings