Skip to content

Docs: Add a small note about native methods#736

Closed
3fbaea00 wants to merge 0 commit into
Washi1337:developmentfrom
3fbaea00:master
Closed

Docs: Add a small note about native methods#736
3fbaea00 wants to merge 0 commit into
Washi1337:developmentfrom
3fbaea00:master

Conversation

@3fbaea00

Copy link
Copy Markdown

While using AsmResolver, I ran into an issue where the assembly containing my created native methods (following the guide) would not load. It took me a long time to figure out the reason, which I have now documented in the commit note.
Even though the MSIL specification does not explicitly state that native methods must be defined in , the CoreCLR implementation includes code in coreclr\vm\methodtablebuilder.cpp [MethodTableBuilder::ValidateMethods] that checks for IsGlobalClass(). Because of this, I think this note is worth existing

@Washi1337 Washi1337 added the docs Issues related to the documentation of AsmResolver label Apr 26, 2026

@Washi1337 Washi1337 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Small comment but other than that lgtm. Also, please base your PR on the development branch instead of master.


> [!NOTE]
> There are restrictions on the location of native methods in the
> CLR core implementation: they can only be located in the global <Module> class.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Use backticks:

`<Module>`

@3fbaea00 3fbaea00 changed the base branch from master to development April 26, 2026 15:14
@3fbaea00

Copy link
Copy Markdown
Author

Small comment but other than that lgtm. Also, please base your PR on the development branch instead of master.

oops, my bad. i hope github's branch change works as expected and i will not have to create a new pull request

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

Labels

docs Issues related to the documentation of AsmResolver

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants