Skip to content

DOCSP-36167: Update .NET compatibility with note on source generator model requirements #3288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions source/includes/note-java-and-realmany.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.. note:: New apps cannot use ``RealmAny``
.. note:: New Java SDK apps cannot use ``RealmAny``

New :atlas:`App Services Apps </app-services/apps/>`
will not be able to synchronize data models with properties of type
``RealmAny``.
will not be able to synchronize data models with properties of type ``RealmAny``.
103 changes: 69 additions & 34 deletions source/sdk/dotnet/compatibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,18 @@ Platform and Framework Compatibility - .NET SDK
:depth: 2
:class: singlecol

Compatibility
-------------
.. meta::
:description: Compatibility information when developing with Atlas Device SDK for .NET.

.. facet::
:name: genre
:values: reference

Target Platforms
----------------

The following table shows which .NET
version(s) you can use with Realm on your target platforms:
versions you can use with the SDK on your target platforms:

.. list-table::
:header-rows: 1
Expand All @@ -32,80 +39,108 @@ version(s) you can use with Realm on your target platforms:
* - Windows 8.1 or later
- | .NET Core 2.0 or later (.NET 5.0 Framework or later)
| .NET Framework 4.6.1 or later
| MAUI requires Windows 11 and Windows 10 version 1809 or higher, using
| MAUI requires Windows 11 and Windows 10 version 1809 or higher, using
Windows UI Library (WinUI) 3.

* - Universal Windows Platform (UWP)
- .NET Standard 2.0 or later (Fall Creators Update)

* - macOS
- | .NET Core 2.0 or later (.NET 5.0 Framework or later)
| Xamarin.Mac for macOS 10.11 or later.
| Xamarin.Mac for macOS 10.11 or later.
| MAUI requires macOS 10.15 or later, using Mac Catalyst.

* - iOS
- | Xamarin.iOS for iOS 9 or later.
- | Xamarin.iOS for iOS 9 or later.
| MAUI requires iOS 11 or later.

* - Android
- | Xamarin.Android for Android 4.1 (API level 16) or later.
- | Xamarin.Android for Android 4.1 (API level 16) or later.
| MAUI requires Android 5.0 (API level 21) or later.

* - tvOS
- | Xamarin and Unity for tvOS 9.0 or later.
- | Xamarin and Unity for tvOS 9.0 or later.
| For more information on developing for tvOS, see :ref:`<ios-tvos>`.

.. note:: Compatibility with SDK Object Models

The source generator models in .NET SDK v10.18.0 and later
require the following:

- .NET Core 2.0 or later (.NET Framework 5.0 or later)
- C# 9.0 or later

If you are targeting an older version of .NET Framework, your object models
must derive from the
:dotnet-sdk:`RealmObject <reference/Realms.RealmObject.html>`,
:dotnet-sdk:`EmbeddedObject <reference/Realms.EmbeddedObject.html>`, or
:dotnet-sdk:`AsymmetricObject <reference/Realms.AsymmetricObject.html>`
base classes required by the old source generator.

The following demonstrates how you can adjust your current object
models for compatibility with older .NET Frameworks:

.. code-block:: csharp

public partial class Person : IRealmObject // Current model

public class Person : RealmObject // Adjusted to inherit from RealmObject

For more information, refer to :ref:`dotnet-define-a-realm-object-schema`.

Development Environments
------------------------

You can use the following development environments to build Realm apps with
You can use the following development environments to build apps with
the .NET SDK:

- Visual Studio 2015 Update 2 or higher for Windows
- Visual Studio for Mac 7.0 or higher
- Unity `2020.3.12f1 (LTS) <https://unity3d.com/get-unity/download/archive>`__
- Unity `2020.3.12f1 (LTS) <https://unity3d.com/get-unity/download/archive>`__

.. note::

The :doc:`Realm .NET SDK </sdk/dotnet>` may be compatible with
other versions of Unity, but ``2020.3.12f1 (LTS)`` is the version that the
Realm team uses for testing and development. We recommend using
this version to ensure your project works with Realm and that
The :doc:`.NET SDK </sdk/dotnet>` may be compatible with
other versions of Unity, but ``2020.3.12f1 (LTS)`` is the version the
SDK team uses for testing and development. We recommend using
this version to ensure your project works with the .NET SDK and that
the install steps match the :doc:`Integrate Realm with Unity
</sdk/dotnet/unity>` documentation steps because Unity's UI
often changes between versions.
often changes between versions.


Android Deployment
------------------
Due to some instruction set limitations, Realm does not support
deploying Android apps to the ``armeabi`` ABI. Because default templates often
have different ABI settings for Debug and Release modes, your app may throw
a ``System.TypeInitializationException`` exception in Release mode but not when

Due to some instruction set limitations, the SDK does not support
deploying Android apps to the ``armeabi`` ABI. Because default templates often
have different ABI settings for Debug and Release modes, your app may throw
a ``System.TypeInitializationException`` exception in Release mode but not when
it was running in Debug mode.

To avoid this, verify the ABI settings for both Debug and Release modes. To check
and change the settings, follow the steps in the
`Visual Studio CPU Architectures <https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/cpu-architectures>`_
To avoid this, verify the ABI settings for both Debug and Release modes. To check
and change the settings, follow the steps in the
`Visual Studio CPU Architectures <https://docs.microsoft.com/en-us/xamarin/android/app-fundamentals/cpu-architectures>`_
page.

Unless you have a good reason to avoid linking other ABIs, we recommend
Unless you have a good reason to avoid linking other ABIs, we recommend
checking all of the settings other than ``armeabi``.

Limitations
Limitations
------------
Realm has limits imposed to balance flexibility with performance. The SDK
throws an exception during app initialization if the following limits are

The SDK has limits imposed to balance flexibility with performance. The SDK
throws an exception during app initialization if the following limits are
exceeded:

- Class names can't exceed 57 bytes in length.
- Property names can't exceed 63 bytes in length.
- Class names can't exceed 57 bytes in length.
- Property names can't exceed 63 bytes in length.

In addition, for iOS apps, the total size of all open Realm files cannot be
larger than the amount of memory your application is allowed to map in iOS. This
varies per device, and depends on how fragmented the memory space on the device is.
If you need to store more data than is allowed, you can split your data into
multiple Realm files, open a realm only when needed, and close it when it is
In addition, for iOS apps, the total size of all open Realm files cannot be
larger than the amount of memory your application is allowed to map in iOS. This
varies per device, and depends on how fragmented the memory space on the device is.
If you need to store more data than is allowed, you can split your data into
multiple Realm files, open a realm only when needed, and close it when it is
no longer needed.

For more information, see `Open Radar 17119975 <http://www.openradar.me/17119975>`_.
Loading