Skip to content

Link copying-and-pinning article to existing code examples#52483

Open
Copilot wants to merge 3 commits intomainfrom
copilot/add-example-code-copying-pinning
Open

Link copying-and-pinning article to existing code examples#52483
Copilot wants to merge 3 commits intomainfrom
copilot/add-example-code-copying-pinning

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

The Copying and Pinning interop article had no code examples, despite existing repo content covering both GCHandle pinning patterns and the C# fixed statement.

Changes

  • Inline cross-reference — Added a link in the GCHandle pinning paragraph pointing directly to the Keeping managed objects alive section of the native interop best practices article, which has concrete GCHandle.Alloc / AddrOfPinnedObject / Free examples.
  • See also links — Added two entries:
  • Frontmatter — Updated ms.date and added ai-usage: ai-assisted.
Original prompt

This section details on the original issue you should resolve

<issue_title>Request example code for "copying and pinning"</issue_title>
<issue_description>
[Enter feedback here]
Please provide example code on how to use the procedures on this page.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

<agent_instructions>We have examples of using these features in the repo. Linking would be better than replication here.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


💬 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

📄 File 🔗 Preview link
docs/framework/interop/copying-and-pinning.md Copying and Pinning

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
Copilot AI requested a review from BillWagner March 20, 2026 14:40
Copy link
Member

@BillWagner BillWagner left a comment

Choose a reason for hiding this comment

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

This is ready for final review

@BillWagner BillWagner marked this pull request as ready for review March 20, 2026 23:34
@BillWagner BillWagner requested a review from a team as a code owner March 20, 2026 23:34
Copilot AI review requested due to automatic review settings March 20, 2026 23:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 GCHandle pinning 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# fixed statement reference.
  • Updates frontmatter (ms.date) and adds ai-usage: ai-assisted.

Co-authored-by: Bill Wagner <wiwagn@microsoft.com>
- [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)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- [fixed statement (C# reference)](../../csharp/language-reference/statements/fixed.md)
- [`fixed` statement (C# reference)](../../csharp/language-reference/statements/fixed.md)

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.

Request example code for "copying and pinning"

4 participants