From 9949c555dfcb74cd48e319b480d15a9016f04c27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Chrobot?= Date: Mon, 7 Sep 2026 09:26:27 +0200 Subject: [PATCH 1/3] Added upgrade-guide --- .../Documentation~/TableOfContents.md | 1 + .../Documentation~/upgrade-guide.md | 66 +++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100644 com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md diff --git a/com.unity.netcode.gameobjects/Documentation~/TableOfContents.md b/com.unity.netcode.gameobjects/Documentation~/TableOfContents.md index 24219a83e5..0faf7e8c18 100644 --- a/com.unity.netcode.gameobjects/Documentation~/TableOfContents.md +++ b/com.unity.netcode.gameobjects/Documentation~/TableOfContents.md @@ -106,4 +106,5 @@ * [FAQ](learn/faq.md) * [Samples](samples.md) * [Boss Room](samples/bossroom/bossroom-landing.md) +* [Upgrading from 2.x to 3.x](upgrade-guide.md) * [Migrate from UNet to Netcode for GameObjects](migratingfromUNet.md) diff --git a/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md b/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md new file mode 100644 index 0000000000..5f3d85827e --- /dev/null +++ b/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md @@ -0,0 +1,66 @@ +# Upgrading from 2.x to 3.x + +Netcode for GameObjects 3.x is a major release. This guide covers the breaking changes you may encounter when upgrading a project from the 2.x series to the 3.x series, and how to resolve each of them. + +Before you begin, back up your project (or make sure it is committed to source control) so you can revert if needed. + +## Editor and dependency requirements + +- **Minimum Editor version.** Netcode for GameObjects 3.x requires Unity **6000.7** or later. Projects on earlier Editor versions must either stay on the 2.x series or upgrade the Editor before installing 3.x. +- **New dependency.** Netcode for GameObjects 3.x depends on the Netcode for Entities package (`com.unity.netcode`), which in turn brings in the Entities packages (`com.unity.entities`, `com.unity.collections`, `com.unity.burst`, `com.unity.mathematics`). Installing 3.x adds these packages to your project. This increases the project's package footprint and build times, and requires an Editor and target platforms that support Burst and Entities. + +## Editor assembly definitions renamed + +The Editor assembly definitions have been renamed to the `Unity.Netcode.GameObjects.*` form: + +| Previous name | New name | +| --- | --- | +| `Unity.Netcode.Editor` | `Unity.Netcode.GameObjects.Editor` | +| `Unity.Netcode.Editor.CodeGen` | `Unity.Netcode.GameObjects.Editor.CodeGen` | +| `Unity.Netcode.Editor.PackageChecker` | `Unity.Netcode.GameObjects.PackageChecker.Editor` | +| `Unity.Netcode.Editor.Tests` | `Unity.Netcode.GameObjects.Editor.Tests` | + +If your own Editor assemblies reference any of these by name in their assembly definition, update the reference to the new name. An API updater is included to migrate references to the moved Editor namespace types automatically; retrigger compilation if it does not resolve everything in one pass, and report any issues with the auto-update process. + +The runtime assembly definition (`Unity.Netcode.Runtime`) and the runtime `Unity.Netcode` namespace are unchanged, so runtime scripts that only use `using Unity.Netcode;` do not need changes for this rename. + +## Obsolete APIs now raise compile errors + +A number of APIs that were already marked `[Obsolete]` with a warning in 2.x now raise a **compile error** in 3.x. The members have not been removed yet, so the error message points you to the replacement in each case. Update your code as follows. + +### NetworkObject + +- `NetworkObject.IsSceneObject` → use `NetworkObject.InScenePlaced`. +- `NetworkObject.SetSceneObjectStatus(bool)` → the in-scene status is now calculated during the build; remove these calls. + +### RPCs + +- The `RequireOwnership` field on `ServerRpc` / RPC attributes → use `InvokePermission` instead: + - `[ServerRpc(RequireOwnership = true)]` → `[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)]` + - `[ServerRpc(RequireOwnership = false)]` → `[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Everyone)]` + +### UnityTransport + +- `UnityTransport.InitialMaxSendQueueSize` → the max send queue size is now determined dynamically; remove use of this constant. You can still set `MaxSendQueueSize` programmatically if required. +- `ConnectionAddressData.ServerEndPoint` (`ParseNetworkEndpoint`) → use `NetworkEndpoint.Parse` on the `Address` field instead. +- `UnityTransport.DebugSimulator` and `UnityTransport.SetDebugSimulatorParameters(...)` → no longer supported and have no effect. Use the Network Simulator from the Multiplayer Tools package instead. + +### Other APIs + +- `CommandLineOptions.Instance` → replaced by `TryGetArg`. +- `NotListeningException` → no longer used. +- The obsolete list/property on `BufferedLinearInterpolator`, the obsolete property on `NetworkList`, and the obsolete method on `NetworkSpawnManager` are no longer usable; remove references to them. +- `NetworkBehaviourEditor.GetRootParentTransform(Transform)` → use `transform.root` instead. + +If you were suppressing the previous warnings with `#pragma warning disable CS0618`, remove those suppressions and apply the replacements above, as the error form (CS0619) cannot be suppressed with a pragma. + +## Behavioral changes + +These changes do not require code edits, but they change runtime behavior. Review them if your project depends on the previous behavior. + +- **`NetworkTransform.UseHalfFloatPrecision` resolution.** Position is now synchronized with a resolution of approximately 1mm regardless of how far an object has travelled (previously the resolution could degrade to approximately 3cm). This does not increase bandwidth, but projects using `NetworkTransform.UseUnreliableDeltas` will send full-precision position updates more often. +- **Interpolation smoothing is now frame-rate independent.** The `Lerp` and `SmoothDampening` interpolation types previously smoothed by different amounts at different frame rates because smoothing was applied per frame instead of over time. Results at 60fps are unchanged; results at other frame rates will differ from 2.x. + +## Netcode for Entities integration (experimental) + +Netcode for GameObjects 3.x introduces the foundations of the unified "GameObject layer for Netcode for Entities" work (the hybrid prefab concept). This integration is experimental in 3.x and is not enabled for standard GameObject workflows by default. Standard `NetworkBehaviour`, `NetworkVariable`, and RPC workflows are unaffected. If you are not using the Entities integration, no action is required beyond the dependency and Editor requirements described above. From 2393dcc3eeae93e4bb0826ea737e8388c3dae625 Mon Sep 17 00:00:00 2001 From: "amy.reeve" Date: Thu, 10 Sep 2026 17:14:53 +0100 Subject: [PATCH 2/3] Docs pass on migration guide --- .../Documentation~/TableOfContents.md | 2 +- .../Documentation~/upgrade-guide.md | 118 ++++++++++++------ 2 files changed, 83 insertions(+), 37 deletions(-) diff --git a/com.unity.netcode.gameobjects/Documentation~/TableOfContents.md b/com.unity.netcode.gameobjects/Documentation~/TableOfContents.md index 0faf7e8c18..e351f13683 100644 --- a/com.unity.netcode.gameobjects/Documentation~/TableOfContents.md +++ b/com.unity.netcode.gameobjects/Documentation~/TableOfContents.md @@ -1,5 +1,6 @@ * [Netcode for GameObjects package](index.md) * [Install](install.md) +* [Upgrade from 2.x to 3.x](upgrade-guide.md) * [Get started](tutorials/get-started-with-ngo.md) * [Client-server quickstart](tutorials/get-started-with-ngo.md) * [Distributed authority quickstart](da-quickstart.md) @@ -106,5 +107,4 @@ * [FAQ](learn/faq.md) * [Samples](samples.md) * [Boss Room](samples/bossroom/bossroom-landing.md) -* [Upgrading from 2.x to 3.x](upgrade-guide.md) * [Migrate from UNet to Netcode for GameObjects](migratingfromUNet.md) diff --git a/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md b/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md index 5f3d85827e..2ee4c27644 100644 --- a/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md +++ b/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md @@ -1,66 +1,112 @@ -# Upgrading from 2.x to 3.x +# Upgrade from 2.x to 3.x -Netcode for GameObjects 3.x is a major release. This guide covers the breaking changes you may encounter when upgrading a project from the 2.x series to the 3.x series, and how to resolve each of them. +Update your project for the Unity Editor, dependency, and API changes that Netcode for GameObjects 3.x introduces. -Before you begin, back up your project (or make sure it is committed to source control) so you can revert if needed. +Version 3.x of Netcode for GameObjects raises the minimum Unity Editor version and adds a dependency on Netcode for Entities. It also renames the Editor assembly definitions and turns several obsolete API warnings into compile errors. Refer to the following sections for the changes that affect your project and the steps to take for each one. -## Editor and dependency requirements +> [!WARNING] +> The API updater modifies your files in place. Commit or back up your work before you update your project. -- **Minimum Editor version.** Netcode for GameObjects 3.x requires Unity **6000.7** or later. Projects on earlier Editor versions must either stay on the 2.x series or upgrade the Editor before installing 3.x. -- **New dependency.** Netcode for GameObjects 3.x depends on the Netcode for Entities package (`com.unity.netcode`), which in turn brings in the Entities packages (`com.unity.entities`, `com.unity.collections`, `com.unity.burst`, `com.unity.mathematics`). Installing 3.x adds these packages to your project. This increases the project's package footprint and build times, and requires an Editor and target platforms that support Burst and Entities. +## Prerequisites -## Editor assembly definitions renamed +Before you upgrade, make sure that your project meets the following requirements: -The Editor assembly definitions have been renamed to the `Unity.Netcode.GameObjects.*` form: +- Unity Editor version 6.7 or later. If your project uses an earlier Editor version, either stay on version 2.x or upgrade the Editor first. +- Target platforms that support Burst and Entities. -| Previous name | New name | +Version 3.x depends on the Netcode for Entities package (`com.unity.netcode`), which in turn depends on the Entities packages (`com.unity.entities`, `com.unity.collections`, `com.unity.burst`, and `com.unity.mathematics`). Installing version 3.x adds these packages to your project. As a result, your project contains more packages, and its build times increase. + +## Upgrade your project to version 3.x + +To upgrade an existing project from version 2.x to version 3.x, follow these steps: + +1. Back up your project, or commit your work to source control. +1. Upgrade your project to Unity Editor version 6000.7 or later. +1. From the Unity Editor, select **Window** > **Package Manager**. +1. From the **Package Manager** window, select **Netcode for GameObjects** in the list of packages. +1. Select version 3.x, then select **Update**. +1. Wait for the API updater to finish, then open the **Console** window to review the remaining compile errors. +1. Resolve the remaining compile errors using the sections that follow. + +After the API updater finishes and you resolve the compile errors, your project compiles against version 3.x. If the API updater doesn't resolve every reference, refer to [Continue an incomplete API update](#continue-an-incomplete-api-update). + +### Continue an incomplete API update + +The API updater doesn't always complete its work in one pass. If the update is incomplete, trigger compilation again so that the API updater can continue to apply its changes. + +If you experience issues with the API updater, report the issue through the [Unity bug submission process](https://unity3d.com/unity/qa/bug-reporting). + +## Update Editor assembly definition references + +Version 3.x renames the Editor assembly definitions to the `Unity.Netcode.GameObjects.*` form: + +| **Original name** | **New name** | | --- | --- | | `Unity.Netcode.Editor` | `Unity.Netcode.GameObjects.Editor` | | `Unity.Netcode.Editor.CodeGen` | `Unity.Netcode.GameObjects.Editor.CodeGen` | | `Unity.Netcode.Editor.PackageChecker` | `Unity.Netcode.GameObjects.PackageChecker.Editor` | | `Unity.Netcode.Editor.Tests` | `Unity.Netcode.GameObjects.Editor.Tests` | -If your own Editor assemblies reference any of these by name in their assembly definition, update the reference to the new name. An API updater is included to migrate references to the moved Editor namespace types automatically; retrigger compilation if it does not resolve everything in one pass, and report any issues with the auto-update process. +If your own Editor assemblies reference any of these assembly definitions by name, update the reference to the new name. The API updater migrates references to the moved Editor namespace types for you. + +Version 3.x doesn't change the runtime assembly definition (`Unity.Netcode.Runtime`) or the runtime `Unity.Netcode` namespace. Runtime scripts that only use `using Unity.Netcode;` need no changes for this rename. + +## Replace obsolete APIs that now raise compile errors + +Version 2.x marks several APIs with `[Obsolete]` and raises a warning for each one. Version 3.x raises a compile error instead. Version 3.x doesn't remove the members, so the error message points you to the replacement in each case. + +### APIs with replacements + +Replace each of the following APIs with its listed replacement: + +| **Original API** | **Replacement** | +| --- | --- | +| `NetworkObject.IsSceneObject` | `NetworkObject.InScenePlaced` | +| `[ServerRpc(RequireOwnership = true)]` | `[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)]` | +| `[ServerRpc(RequireOwnership = false)]` | `[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Everyone)]` | +| `ConnectionAddressData.ServerEndPoint` (`ParseNetworkEndpoint`) | `NetworkEndpoint.Parse` on the `Address` field | +| `CommandLineOptions.Instance` | `TryGetArg` | +| `NetworkBehaviourEditor.GetRootParentTransform(Transform)` | `transform.root` | -The runtime assembly definition (`Unity.Netcode.Runtime`) and the runtime `Unity.Netcode` namespace are unchanged, so runtime scripts that only use `using Unity.Netcode;` do not need changes for this rename. +The `RequireOwnership` field applies to `ServerRpc` and the other remote procedure call (RPC) attributes. Use `InvokePermission` in its place. For more information, refer to [RPCs](advanced-topics/message-system/rpc.md). -## Obsolete APIs now raise compile errors +### APIs without replacements -A number of APIs that were already marked `[Obsolete]` with a warning in 2.x now raise a **compile error** in 3.x. The members have not been removed yet, so the error message points you to the replacement in each case. Update your code as follows. +Remove your use of each of the following APIs: -### NetworkObject +- `NetworkObject.SetSceneObjectStatus(bool)`: version 3.x computes the in-scene status during the build, so remove these calls. +- `UnityTransport.InitialMaxSendQueueSize`: version 3.x determines the maximum send queue size dynamically, so remove your use of this constant. You can still set `MaxSendQueueSize` using C# scripts if you need to. +- `UnityTransport.DebugSimulator` and `UnityTransport.SetDebugSimulatorParameters(...)`: version 3.x no longer supports these members, and they have no effect. Use the [Network Simulator tool](https://docs.unity3d.com/Packages/com.unity.multiplayer.tools@latest?subfolder=/manual/network-simulator) from the Multiplayer Tools package instead. +- `NotListeningException`: version 3.x no longer uses this exception. +- The obsolete list and property on `BufferedLinearInterpolator`, the obsolete property on `NetworkList`, and the obsolete method on `NetworkSpawnManager`: version 3.x no longer supports these members. -- `NetworkObject.IsSceneObject` → use `NetworkObject.InScenePlaced`. -- `NetworkObject.SetSceneObjectStatus(bool)` → the in-scene status is now calculated during the build; remove these calls. +### Remove directives that disable obsolete warnings -### RPCs +If you disabled the version 2.x warnings with `#pragma warning disable CS0618`, remove that directive and apply the replacements in the previous sections. You can't disable the error form (`CS0619`) with `#pragma warning disable`. -- The `RequireOwnership` field on `ServerRpc` / RPC attributes → use `InvokePermission` instead: - - `[ServerRpc(RequireOwnership = true)]` → `[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)]` - - `[ServerRpc(RequireOwnership = false)]` → `[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Everyone)]` +## Behavior changes that don't require code edits -### UnityTransport +The following changes don't require code edits, but they change runtime behavior. Review them if your project depends on the behavior of version 2.x. -- `UnityTransport.InitialMaxSendQueueSize` → the max send queue size is now determined dynamically; remove use of this constant. You can still set `MaxSendQueueSize` programmatically if required. -- `ConnectionAddressData.ServerEndPoint` (`ParseNetworkEndpoint`) → use `NetworkEndpoint.Parse` on the `Address` field instead. -- `UnityTransport.DebugSimulator` and `UnityTransport.SetDebugSimulatorParameters(...)` → no longer supported and have no effect. Use the Network Simulator from the Multiplayer Tools package instead. +### Position synchronization uses a higher resolution -### Other APIs +In version 3.x, `NetworkTransform.UseHalfFloatPrecision` synchronizes position at a resolution of approximately 1 mm, regardless of how far a GameObject has traveled. In version 2.x, the resolution might degrade to approximately 3 cm. The change doesn't increase bandwidth, but a project that uses `NetworkTransform.UseUnreliableDeltas` sends full-precision position updates more often. For more information, refer to [NetworkTransform](components/helper/networktransform.md). -- `CommandLineOptions.Instance` → replaced by `TryGetArg`. -- `NotListeningException` → no longer used. -- The obsolete list/property on `BufferedLinearInterpolator`, the obsolete property on `NetworkList`, and the obsolete method on `NetworkSpawnManager` are no longer usable; remove references to them. -- `NetworkBehaviourEditor.GetRootParentTransform(Transform)` → use `transform.root` instead. +### Interpolation smoothing is frame rate independent -If you were suppressing the previous warnings with `#pragma warning disable CS0618`, remove those suppressions and apply the replacements above, as the error form (CS0619) cannot be suppressed with a pragma. +In version 2.x, the `Lerp` and `SmoothDampening` interpolation types smooth by different amounts at different frame rates, because Netcode for GameObjects applies smoothing per frame instead of over time. Version 3.x applies smoothing over time, so results at 60 frames per second (fps) stay the same as in version 2.x, and results at other frame rates differ. -## Behavioral changes +## Netcode for Entities integration -These changes do not require code edits, but they change runtime behavior. Review them if your project depends on the previous behavior. +> [!NOTE] +> This integration is experimental, so it's not ready for production use. The features and documentation for this integration might change before it's verified for release. -- **`NetworkTransform.UseHalfFloatPrecision` resolution.** Position is now synchronized with a resolution of approximately 1mm regardless of how far an object has travelled (previously the resolution could degrade to approximately 3cm). This does not increase bandwidth, but projects using `NetworkTransform.UseUnreliableDeltas` will send full-precision position updates more often. -- **Interpolation smoothing is now frame-rate independent.** The `Lerp` and `SmoothDampening` interpolation types previously smoothed by different amounts at different frame rates because smoothing was applied per frame instead of over time. Results at 60fps are unchanged; results at other frame rates will differ from 2.x. +Version 3.x introduces the foundations of the unified GameObject layer for Netcode for Entities, known as the hybrid prefab concept. Version 3.x doesn't enable this integration by default for standard GameObject workflows. Standard `NetworkBehaviour`, `NetworkVariable`, and RPC workflows work the same as in version 2.x. -## Netcode for Entities integration (experimental) +## Additional resources -Netcode for GameObjects 3.x introduces the foundations of the unified "GameObject layer for Netcode for Entities" work (the hybrid prefab concept). This integration is experimental in 3.x and is not enabled for standard GameObject workflows by default. Standard `NetworkBehaviour`, `NetworkVariable`, and RPC workflows are unaffected. If you are not using the Entities integration, no action is required beyond the dependency and Editor requirements described above. +- [Install Netcode for GameObjects](install.md) +- [Netcode for Entities](https://docs.unity3d.com/Packages/com.unity.netcode@latest) +- [NetworkObject](components/core/networkobject.md) +- [NetworkTransform](components/helper/networktransform.md) +- [RPCs](advanced-topics/message-system/rpc.md) From 492efa7255c9192e2acad8b070331d3d1326de5b Mon Sep 17 00:00:00 2001 From: "amy.reeve" Date: Thu, 10 Sep 2026 17:24:28 +0100 Subject: [PATCH 3/3] U-PR review comments --- .../Documentation~/upgrade-guide.md | 28 +++++++++++++++---- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md b/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md index 2ee4c27644..b721b3d393 100644 --- a/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md +++ b/com.unity.netcode.gameobjects/Documentation~/upgrade-guide.md @@ -1,8 +1,8 @@ # Upgrade from 2.x to 3.x -Update your project for the Unity Editor, dependency, and API changes that Netcode for GameObjects 3.x introduces. +Update your project for the Unity Editor, assembly definition, dependency, and API changes that Netcode for GameObjects 3.x introduces. -Version 3.x of Netcode for GameObjects raises the minimum Unity Editor version and adds a dependency on Netcode for Entities. It also renames the Editor assembly definitions and turns several obsolete API warnings into compile errors. Refer to the following sections for the changes that affect your project and the steps to take for each one. +Version 3.x of Netcode for GameObjects raises the minimum Unity Editor version, renames the Editor assembly definitions, and turns several obsolete API warnings into compile errors. Refer to the following sections for the changes that affect your project and the steps to take for each one. > [!WARNING] > The API updater modifies your files in place. Commit or back up your work before you update your project. @@ -21,7 +21,7 @@ Version 3.x depends on the Netcode for Entities package (`com.unity.netcode`), w To upgrade an existing project from version 2.x to version 3.x, follow these steps: 1. Back up your project, or commit your work to source control. -1. Upgrade your project to Unity Editor version 6000.7 or later. +1. Upgrade your project to Unity Editor version 6.7 or later. 1. From the Unity Editor, select **Window** > **Package Manager**. 1. From the **Package Manager** window, select **Netcode for GameObjects** in the list of packages. 1. Select version 3.x, then select **Update**. @@ -44,7 +44,7 @@ Version 3.x renames the Editor assembly definitions to the `Unity.Netcode.GameOb | --- | --- | | `Unity.Netcode.Editor` | `Unity.Netcode.GameObjects.Editor` | | `Unity.Netcode.Editor.CodeGen` | `Unity.Netcode.GameObjects.Editor.CodeGen` | -| `Unity.Netcode.Editor.PackageChecker` | `Unity.Netcode.GameObjects.PackageChecker.Editor` | +| `Unity.Netcode.PackageChecker.Editor` | `Unity.Netcode.GameObjects.PackageChecker.Editor` | | `Unity.Netcode.Editor.Tests` | `Unity.Netcode.GameObjects.Editor.Tests` | If your own Editor assemblies reference any of these assembly definitions by name, update the reference to the new name. The API updater migrates references to the moved Editor namespace types for you. @@ -65,11 +65,29 @@ Replace each of the following APIs with its listed replacement: | `[ServerRpc(RequireOwnership = true)]` | `[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Owner)]` | | `[ServerRpc(RequireOwnership = false)]` | `[Rpc(SendTo.Server, InvokePermission = RpcInvokePermission.Everyone)]` | | `ConnectionAddressData.ServerEndPoint` (`ParseNetworkEndpoint`) | `NetworkEndpoint.Parse` on the `Address` field | -| `CommandLineOptions.Instance` | `TryGetArg` | | `NetworkBehaviourEditor.GetRootParentTransform(Transform)` | `transform.root` | The `RequireOwnership` field applies to `ServerRpc` and the other remote procedure call (RPC) attributes. Use `InvokePermission` in its place. For more information, refer to [RPCs](advanced-topics/message-system/rpc.md). +### Replace command-line argument lookups + +Version 3.x raises a compile error for both `CommandLineOptions.Instance` and the `CommandLineOptions.GetArg` instance method, so a typical `Instance.GetArg` call needs a full rewrite rather than a rename. Use the static `CommandLineOptions.TryGetArg` method, which reports whether it found the argument and returns the value through an `out` parameter: + +```csharp +// Version 2.x +var value = CommandLineOptions.Instance.GetArg("--myArg"); +if (value != null) +{ + // Use value. +} + +// Version 3.x +if (CommandLineOptions.TryGetArg("--myArg", out var value)) +{ + // Use value. +} +``` + ### APIs without replacements Remove your use of each of the following APIs: