Skip to content

Commit ac1c6b3

Browse files
authored
DOCSP-36167: Update .NET compatibility with note on source generator model requirements (#3288)
## Pull Request Info Jira ticket: https://jira.mongodb.org/browse/DOCSP-36167 *Staged Page* - [Platform and Framework Compatibility - .NET SDK](https://preview-mongodbcbullinger.gatsbyjs.io/realm/docsp-36167-compatibility/sdk/dotnet/compatibility/) ## Release Notes - **.NET SDK** - Compatibility: Added note with minimum framework requirements when using the new source model generator.
1 parent f4030d7 commit ac1c6b3

File tree

2 files changed

+71
-37
lines changed

2 files changed

+71
-37
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
.. note:: New apps cannot use ``RealmAny``
1+
.. note:: New Java SDK apps cannot use ``RealmAny``
22

33
New :atlas:`App Services Apps </app-services/apps/>`
4-
will not be able to synchronize data models with properties of type
5-
``RealmAny``.
4+
will not be able to synchronize data models with properties of type ``RealmAny``.

source/sdk/dotnet/compatibility.txt

Lines changed: 69 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ Platform and Framework Compatibility - .NET SDK
1111
:depth: 2
1212
:class: singlecol
1313

14-
Compatibility
15-
-------------
14+
.. meta::
15+
:description: Compatibility information when developing with Atlas Device SDK for .NET.
16+
17+
.. facet::
18+
:name: genre
19+
:values: reference
20+
21+
Target Platforms
22+
----------------
1623

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

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

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

4148
* - macOS
4249
- | .NET Core 2.0 or later (.NET 5.0 Framework or later)
43-
| Xamarin.Mac for macOS 10.11 or later.
50+
| Xamarin.Mac for macOS 10.11 or later.
4451
| MAUI requires macOS 10.15 or later, using Mac Catalyst.
4552

4653
* - iOS
47-
- | Xamarin.iOS for iOS 9 or later.
54+
- | Xamarin.iOS for iOS 9 or later.
4855
| MAUI requires iOS 11 or later.
4956

5057
* - Android
51-
- | Xamarin.Android for Android 4.1 (API level 16) or later.
58+
- | Xamarin.Android for Android 4.1 (API level 16) or later.
5259
| MAUI requires Android 5.0 (API level 21) or later.
53-
60+
5461
* - tvOS
55-
- | Xamarin and Unity for tvOS 9.0 or later.
62+
- | Xamarin and Unity for tvOS 9.0 or later.
5663
| For more information on developing for tvOS, see :ref:`<ios-tvos>`.
5764

65+
.. note:: Compatibility with SDK Object Models
66+
67+
The source generator models in .NET SDK v10.18.0 and later
68+
require the following:
69+
70+
- .NET Core 2.0 or later (.NET Framework 5.0 or later)
71+
- C# 9.0 or later
72+
73+
If you are targeting an older version of .NET Framework, your object models
74+
must derive from the
75+
:dotnet-sdk:`RealmObject <reference/Realms.RealmObject.html>`,
76+
:dotnet-sdk:`EmbeddedObject <reference/Realms.EmbeddedObject.html>`, or
77+
:dotnet-sdk:`AsymmetricObject <reference/Realms.AsymmetricObject.html>`
78+
base classes required by the old source generator.
79+
80+
The following demonstrates how you can adjust your current object
81+
models for compatibility with older .NET Frameworks:
82+
83+
.. code-block:: csharp
84+
85+
public partial class Person : IRealmObject // Current model
86+
87+
public class Person : RealmObject // Adjusted to inherit from RealmObject
88+
89+
For more information, refer to :ref:`dotnet-define-a-realm-object-schema`.
90+
5891
Development Environments
5992
------------------------
6093

61-
You can use the following development environments to build Realm apps with
94+
You can use the following development environments to build apps with
6295
the .NET SDK:
6396

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

68101
.. note::
69102

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

78111

79112
Android Deployment
80113
------------------
81-
Due to some instruction set limitations, Realm does not support
82-
deploying Android apps to the ``armeabi`` ABI. Because default templates often
83-
have different ABI settings for Debug and Release modes, your app may throw
84-
a ``System.TypeInitializationException`` exception in Release mode but not when
114+
115+
Due to some instruction set limitations, the SDK does not support
116+
deploying Android apps to the ``armeabi`` ABI. Because default templates often
117+
have different ABI settings for Debug and Release modes, your app may throw
118+
a ``System.TypeInitializationException`` exception in Release mode but not when
85119
it was running in Debug mode.
86120

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

92-
Unless you have a good reason to avoid linking other ABIs, we recommend
126+
Unless you have a good reason to avoid linking other ABIs, we recommend
93127
checking all of the settings other than ``armeabi``.
94128

95-
Limitations
129+
Limitations
96130
------------
97-
Realm has limits imposed to balance flexibility with performance. The SDK
98-
throws an exception during app initialization if the following limits are
131+
132+
The SDK has limits imposed to balance flexibility with performance. The SDK
133+
throws an exception during app initialization if the following limits are
99134
exceeded:
100135

101-
- Class names can't exceed 57 bytes in length.
102-
- Property names can't exceed 63 bytes in length.
136+
- Class names can't exceed 57 bytes in length.
137+
- Property names can't exceed 63 bytes in length.
103138

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

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

0 commit comments

Comments
 (0)