Skip to content

extern keyword: Is there another purpose than only [DllImport]? #59882

Answered by gfoidl
msedi asked this question in Q&A
Discussion options

You must be logged in to vote

Hopefully extern (C# Reference) (and the link to the language specification there) can answer your question.

The extern modifier is used to declare a method that is implemented externally.

Where "externally" is to be understood as outside of the C# code. So a source generator doesn't fall into this category.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@msedi
Comment options

@gfoidl
Comment options

@msedi
Comment options

Answer selected by msedi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants