Skip to content

Clarify assembly-qualified names for native hosting - #55315

Draft
elinor-fung with Copilot wants to merge 3 commits into
mainfrom
copilot/address-doc-gap-assembly-names
Draft

Clarify assembly-qualified names for native hosting#55315
elinor-fung with Copilot wants to merge 3 commits into
mainfrom
copilot/address-doc-gap-assembly-names

Conversation

Copilot AI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Clarify the native hosting tutorial’s requirements for assembly-qualified names when you load a managed assembly and obtain a function pointer.

Fixes dotnet/runtime#76080

Changes

  • State that the managed type name and any custom delegate type name must be assembly-qualified.
  • Expand the LoadAndGet inline C++ snippet to show the managed assembly path, the assembly-qualified type name (DotNetLib.Lib, DotNetLib), and the target method name together.
  • Remove redundant prose now demonstrated directly by the snippet.

Validation

  • dotnet build samples/snippets/core/tutorials/netcore-hosting/csharp/HostWithHostFxr/src/NativeHost/NativeHost.csproj
  • npx --yes markdownlint-cli2 docs/core/tutorials/netcore-hosting.md
  • Secret scanning
  • CodeQL review (trivial documentation/snippet-boundary changes)

Internal previews

File Preview link
docs/core/tutorials/netcore-hosting.md docs/core/tutorials/netcore-hosting
samples/snippets/core/tutorials/netcore-hosting/csharp/HostWithHostFxr/src/NativeHost/nativehost.cpp samples/snippets/core/tutorials/netcore-hosting/csharp/HostWithHostFxr/src/NativeHost/nativehost.cpp

Copilot AI and others added 3 commits August 3, 2026 21:56
Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
Co-authored-by: elinor-fung <47805090+elinor-fung@users.noreply.github.com>
Copilot AI self-assigned this Aug 5, 2026
Copilot AI review requested due to automatic review settings August 5, 2026 17:38

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR clarifies the native hosting tutorial’s requirements around using assembly-qualified names when calling load_assembly_and_get_function_pointer, and adjusts the inline C++ snippet so the inputs (assembly path, type name, and method name) are shown together.

Changes:

  • Update tutorial text to explicitly require an assembly-qualified managed type name.
  • Update tutorial text to require an assembly-qualified delegate type name when you specify a custom delegate signature.
  • Expand the LoadAndGet snippet region to include the managed assembly path, the assembly-qualified type name, and the target method name.
Show a summary per file
File Description
samples/snippets/core/tutorials/netcore-hosting/csharp/HostWithHostFxr/src/NativeHost/nativehost.cpp Expands the LoadAndGet snippet region so the documented snippet shows the assembly path, assembly-qualified type name, and method name together.
docs/core/tutorials/netcore-hosting.md Clarifies that the type name (and custom delegate type name) must be assembly-qualified when loading a managed assembly and retrieving a function pointer.

Copilot's findings

  • Files reviewed: 2/2 changed files
  • Comments generated: 0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loading a self-contained executable with custom runtime host returns error about missing .deps.json file

3 participants