Skip to content

Add marshaller shape docs to docs with more detailed explanations #47125

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

@jtschuster jtschuster changed the title WIP Add marshaller shape docs to docs with better explanations Add marshaller shape docs to docs with more detailed explanations Jul 8, 2025
@jtschuster jtschuster marked this pull request as ready for review July 8, 2025 23:36
@jtschuster jtschuster requested review from jkoritzinsky and a team as code owners July 8, 2025 23:36
Copy link
Contributor

@gewarren gewarren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, I left a few suggestions.

Co-authored-by: Genevieve Warren <[email protected]>

## Marshaller shapes

The set of methods that the marshalling generator expects from a custom marshaller type is referred to as the *marshaller shape*. To support stateless, static custom marshaller types in .NET Standard 2.0 (which doesn't support static interface methods), and improve performance, interface types are not used to define and implement the marshaller shapes. Instead, the shapes are documented in the [Custom marshaller shapes](custom-marshaller-shapes.md) article. The expected methods (or shape) depends on the whether the marshaller is stateless or stateful, and whether it supports marshalling from managed to unmanaged, unmanaged to managed, or both (declared with `CustomMarshallerAttribute.MarshalMode`). The .NET SDK includes analyzers and code fixers to help with implementing marshallers that conform to the required shapes.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jkoritzinsky @AaronRobinsonMSFT Is this accurate and complete?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Doc BUG] [Missing information] Marshalling shapes
3 participants