realm / realm-dotnet

Realm is a mobile database: a replacement for SQLite & ORMs
https://realm.io
Apache License 2.0
1.25k stars 165 forks source link

Realm 1.2.0 is not compatible with .NETStandard,Version=v1.4 due to dependencies not compatible with .NETStandard #1378

Closed JonDouglas closed 7 years ago

JonDouglas commented 7 years ago

Goals

I'm trying to install Realm into a dotnetstandard 1.4 class library.

Expected Results

It should install into the class library.

Actual Results

It does not install into the class library.

Both of the following libraries do not support .NETStandard 1.4:

DotNetCross.Memory.Unsafe 0.2.2

Realm.DataBinding 1.0.0

Restoring packages for C:\Users\dougl\Documents\GitHub\LawnCareTimeline\LawnCareTimeline.Core\LawnCareTimeline.Core.csproj...
  GET https://api.nuget.org/v3-flatcontainer/realm/index.json
  OK https://api.nuget.org/v3-flatcontainer/realm/index.json 184ms
  GET https://api.nuget.org/v3-flatcontainer/realm/1.2.0/realm.1.2.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/realm/1.2.0/realm.1.2.0.nupkg 148ms
  GET https://api.nuget.org/v3-flatcontainer/realm.database/index.json
  OK https://api.nuget.org/v3-flatcontainer/realm.database/index.json 264ms
  GET https://api.nuget.org/v3-flatcontainer/realm.database/1.2.0/realm.database.1.2.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/realm.database/1.2.0/realm.database.1.2.0.nupkg 216ms
  GET https://api.nuget.org/v3-flatcontainer/fody/index.json
  GET https://api.nuget.org/v3-flatcontainer/realm.databinding/index.json
  GET https://api.nuget.org/v3-flatcontainer/dotnetcross.memory.unsafe/index.json
  OK https://api.nuget.org/v3-flatcontainer/fody/index.json 251ms
  GET https://api.nuget.org/v3-flatcontainer/fody/1.29.4/fody.1.29.4.nupkg
  OK https://api.nuget.org/v3-flatcontainer/realm.databinding/index.json 276ms
  GET https://api.nuget.org/v3-flatcontainer/realm.databinding/1.0.0/realm.databinding.1.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/realm.databinding/1.0.0/realm.databinding.1.0.0.nupkg 181ms
  OK https://api.nuget.org/v3-flatcontainer/dotnetcross.memory.unsafe/index.json 642ms
  GET https://api.nuget.org/v3-flatcontainer/dotnetcross.memory.unsafe/0.2.2/dotnetcross.memory.unsafe.0.2.2.nupkg
  OK https://api.nuget.org/v3-flatcontainer/fody/1.29.4/fody.1.29.4.nupkg 485ms
  OK https://api.nuget.org/v3-flatcontainer/dotnetcross.memory.unsafe/0.2.2/dotnetcross.memory.unsafe.0.2.2.nupkg 165ms
Installing DotNetCross.Memory.Unsafe 0.2.2.
Installing Fody 1.29.4.
Installing Realm.DataBinding 1.0.0.
Installing Realm.Database 1.2.0.
Installing Realm 1.2.0.
Package Realm.DataBinding 1.0.0 is not compatible with netstandard1.4 (.NETStandard,Version=v1.4). Package Realm.DataBinding 1.0.0 supports:
  - monoandroid44 (MonoAndroid,Version=v4.4)
  - portable-monoandroid+monotouch+net45+sl5+win8+wp8+wpa81+xamarinios10+xamarinmac (.NETPortable,Version=v0.0,Profile=net45+sl5+wp8+wpa81+win8+monoandroid+Xamarin.iOS10+monotouch+Xamarin.Mac)
  - xamarinios10 (Xamarin.iOS,Version=v1.0)
Package DotNetCross.Memory.Unsafe 0.2.2 is not compatible with netstandard1.4 (.NETStandard,Version=v1.4). Package DotNetCross.Memory.Unsafe 0.2.2 supports:
  - dnxcore50 (DNXCore,Version=v5.0)
  - dotnet (.NETPlatform,Version=v5.0)
  - net (.NETFramework,Version=v0.0)
  - net11 (.NETFramework,Version=v1.1)
  - netcore (.NETCore,Version=v0.0)
  - netcore45 (.NETCore,Version=v4.5)
  - portable-net40+sl4+win8+wp7 (.NETPortable,Version=v0.0,Profile=Profile2)
One or more packages are incompatible with .NETStandard,Version=v1.4.
Package restore failed. Rolling back package changes for 'LawnCareTimeline.Core'.
Time Elapsed: 00:00:15.9591151
========== Finished ==========

Steps to Reproduce

  1. Create a new dotnetstandard 1.4 class library
  2. Try to install Realm

Version of Realm and Tooling

Comments

Based on the following release notes:

After the upgrade, you'll see a number of new NuGet dependencies being added - those are reference assemblies, already part of mscorlib, so will not affect your application's size or performance. Additionally, we're releasing a new platform specific DataBinding package that contains helper methods that enable two-way databinding scenarios by automatically creating transactions when setting a property.

https://github.com/realm/realm-dotnet/blob/master/CHANGELOG.md

Does this mean that the current DataBinding package will be replaced with platform specific ones then?

nirinchev commented 7 years ago

This was an oversight on our part. I recently started working on a workaround - https://github.com/realm/realm-dotnet/pull/1375 that should address this. It's a little hacky at the moment, but I hope to wrap it up in the next few days. In the meantime, you could manually add reference to the latest DotNetCross.Memory.Unsafe (0.2.3.4) and this prerelease version of Realm.DataBinding: Realm.DataBinding.1.1.0.nupkg.zip

After you've added them, you should be able to add a reference to the realm packages.

nirinchev commented 7 years ago

This should be fixed in Realm 1.2.1 that has just been released (nuget may take some time to index it).

JonDouglas commented 7 years ago

Thanks for this quick fix. I'll wait for the release to be indexed.