Link copying-and-pinning article to existing code examples#52483
Open
Link copying-and-pinning article to existing code examples#52483
Conversation
Co-authored-by: BillWagner <493969+BillWagner@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add example code for copying and pinning procedures
Link copying-and-pinning article to existing code examples
Mar 20, 2026
BillWagner
approved these changes
Mar 20, 2026
Member
BillWagner
left a comment
There was a problem hiding this comment.
This is ready for final review
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the .NET Framework interop article Copying and Pinning to point readers to existing pinning examples elsewhere in the docs set, instead of duplicating new samples in this page.
Changes:
- Adds an inline link from the
GCHandlepinning paragraph to the “Keeping managed objects alive” examples in native interop best practices. - Expands See also with links to native interop best practices and the C#
fixedstatement reference. - Updates frontmatter (
ms.date) and addsai-usage: ai-assisted.
Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
gewarren
approved these changes
Mar 20, 2026
| - [Directional Attributes](/previous-versions/dotnet/netframework-4.0/77e6taeh(v=vs.100)) | ||
| - [Interop Marshaling](interop-marshalling.md) | ||
| - [Native interoperability best practices](../../standard/native-interop/best-practices.md) | ||
| - [fixed statement (C# reference)](../../csharp/language-reference/statements/fixed.md) |
Contributor
There was a problem hiding this comment.
Suggested change
| - [fixed statement (C# reference)](../../csharp/language-reference/statements/fixed.md) | |
| - [`fixed` statement (C# reference)](../../csharp/language-reference/statements/fixed.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Copying and Pinning interop article had no code examples, despite existing repo content covering both
GCHandlepinning patterns and the C#fixedstatement.Changes
GCHandlepinning paragraph pointing directly to the Keeping managed objects alive section of the native interop best practices article, which has concreteGCHandle.Alloc/AddrOfPinnedObject/Freeexamples.GCHandlepinning and callback patternsms.dateand addedai-usage: ai-assisted.Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.
Internal previews