Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

P/Invoke function returning SafeSocketHandle throws MissingMethodException #45911

Merged
merged 3 commits into from
Dec 11, 2020

Conversation

eerhardt
Copy link
Member

The ILLinker is trimming the private default constructors of SafeHandle classes if they are not used by the library. Adding an XML descriptor file to preserve the private constructors of these SafeHandles so they can be used in P/Invokes in external code.

Fix #45633

…ption

The ILLinker is trimming the private default constructors of SafeHandle classes if they are not used by the library. Adding an XML descriptor file to preserve the private constructors of these SafeHandles so they can be used in P/Invokes in external code.

Fix dotnet#45633
Copy link
Member

@jkotas jkotas left a comment

Choose a reason for hiding this comment

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

Thank you!

Suppress P/Invoke test on Browser
@eerhardt
Copy link
Member Author

Failure is #44657

@eerhardt eerhardt merged commit af1b1ad into dotnet:master Dec 11, 2020
@eerhardt eerhardt deleted the Fix45633 branch December 11, 2020 02:02
@eerhardt
Copy link
Member Author

/backport to release/5.0

@github-actions
Copy link
Contributor

Started backporting to release/5.0: https://github.com/dotnet/runtime/actions/runs/414427274

@github-actions
Copy link
Contributor

@eerhardt backporting to release/5.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: P/Invoke function returning SafeSocketHandle throws MissingMethodException
error: sha1 information is lacking or useless (src/libraries/System.IO.MemoryMappedFiles/tests/System.IO.MemoryMappedFiles.Tests.csproj).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 P/Invoke function returning SafeSocketHandle throws MissingMethodException
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128

Please backport manually!

eerhardt added a commit to eerhardt/runtime that referenced this pull request Dec 11, 2020
…ption (dotnet#45911)

* P/Invoke function returning SafeSocketHandle throws MissingMethodException

The ILLinker is trimming the private default constructors of SafeHandle classes if they are not used by the library. Adding an XML descriptor file to preserve the private constructors of these SafeHandles so they can be used in P/Invokes in external code.

Fix dotnet#45633

Suppress P/Invoke test on Browser
eerhardt added a commit that referenced this pull request Dec 11, 2020
…singMethodException (#45911) (#45942)

* P/Invoke function returning SafeSocketHandle throws MissingMethodException (#45911)

The ILLinker is trimming the private default constructors of SafeHandle classes if they are not used by the library. Adding an XML descriptor file to preserve the private constructors of these SafeHandles so they can be used in P/Invokes in external code.

Fix #45633

Suppress P/Invoke test on Browser

cherry-pick of af1b1ad

* Move ILLinkTrim files to the .csproj folder, where the 5.0 build infrastructure expects them.
Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

P/Invoke function returning SafeSocketHandle throws "System.MissingMethodException: .ctor"
5 participants