Skip to content

Commit b02393f

Browse files
authored
Merge pull request #1424 from microsoft/dev/andarno/doc-update
Update NativeAOT doc
2 parents 18e66b4 + def1744 commit b02393f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docfx/docs/nativeAOT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ A consuming application can target NativeAOT while referencing StreamJsonRpc by
1313

1414
Set the <xref:StreamJsonRpc.JsonRpcProxyOptions.AcceptProxyWithExtraInterfaces?displayProperty=nameWithType> property to `true` to reduce the number of predefined groups for which proxies must be specially generated.
1515
1. Use <xref:StreamJsonRpc.NerdbankMessagePackFormatter> or <xref:StreamJsonRpc.SystemTextJsonFormatter> instead of the default <xref:StreamJsonRpc.JsonMessageFormatter>.
16-
<xref:StreamJsonRpc.NerdbankMessagePackFormatter> provides the best and safest experience and greatest set of functionality when you can use MessagePack encoding, but <xref:StreamJsonRpc.SystemTextJsonFormatter> must be used when UTF-8 JSON encoding is required.
16+
<xref:StreamJsonRpc.NerdbankMessagePackFormatter> provides the best and safest experience and greatest set of functionality when you can use MessagePack encoding, including support for [RPC marshalable objects](../exotic_types/rpc_marshalable_objects.md) in NativeAOT scenarios, but <xref:StreamJsonRpc.SystemTextJsonFormatter> must be used when UTF-8 JSON encoding is required.
1717
1. Set <xref:System.Text.Json.JsonSerializerOptions.TypeInfoResolver> on the <xref:StreamJsonRpc.SystemTextJsonFormatter.JsonSerializerOptions?displayProperty=nameWithType> property to the `Default` property on your class that derives from <xref:System.Text.Json.Serialization.JsonSerializerContext>.
1818
1. Use <xref:StreamJsonRpc.JsonRpc.AddLocalRpcTarget(StreamJsonRpc.RpcTargetMetadata,System.Object,StreamJsonRpc.JsonRpcTargetOptions)?displayProperty=nameWithType> to add RPC target objects rather than other overloads.
1919
1. When constructing proxies, use the <xref:StreamJsonRpc.JsonRpc.Attach*> methods with `typeof` arguments or specific generic type arguments.
2020
1. When using named parameters (e.g. <xref:StreamJsonRpc.JsonRpc.NotifyWithParameterObjectAsync*> or <xref:StreamJsonRpc.JsonRpc.InvokeWithParameterObjectAsync*>), call the overloads that accept <xref:StreamJsonRpc.NamedArgs>.
21-
1. Avoid [RPC marshalable objects](../exotic_types/rpc_marshalable_objects.md).
21+
1. If you need [RPC marshalable objects](../exotic_types/rpc_marshalable_objects.md) in a NativeAOT application, use <xref:StreamJsonRpc.NerdbankMessagePackFormatter>. Avoid them when using <xref:StreamJsonRpc.SystemTextJsonFormatter>, whose marshalable object support is not NativeAOT safe.
2222

2323
## Sample program
2424

0 commit comments

Comments
 (0)