Skip to content

Commit 04bcfa7

Browse files
authored
Added note about caching to DllImportResolver (#11864)
1 parent ce0c82a commit 04bcfa7

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

xml/System.Runtime.InteropServices/DllImportResolver.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
4040
The runtime does not do any lifetime management around the handle returned by a <xref:System.Runtime.InteropServices.DllImportResolver>. It is left to the implementation and consuming code to keep the library loaded for as long as necessary and free it if/when desired.
4141
42+
The resolver delegate is called everytime when a PInvoke call is done. It is fine to cache the handle, as long as the consuming code does not call <xref:System.Runtime.InteropServices.NativeLibrary.Free>.
43+
4244
]]></format>
4345
</remarks>
4446
</Docs>

0 commit comments

Comments
 (0)