Uh oh!
There was an error while loading. Please reload this page.
Fix hostfxr_get_available_sdks_result_fn array size type. - #340
Merged
Conversation
This changes the array size type to 'int' so it matches the 'int32_t' native type. This was typed as an enum. The enum type is accepted by CoreCLR. Mono throws a MarshalDirectiveException because it requires the array size to be an integral type.
Rainer Sigwald (rainersigwald)
requested review from
Copilot and Rainer Sigwald (rainersigwald)September 26, 2025 14:48
There was a problem hiding this comment.
Pull Request Overview
Fixes a marshaling compatibility issue between CoreCLR and Mono by changing the array size parameter type from an enum to int in the hostfxr_get_available_sdks_result_fn delegate. This change ensures Mono can properly marshal the unmanaged function pointer, as Mono requires array size parameters to be integral types while CoreCLR accepts enum types.
- Changes array size parameter type from
hostfxr_resolve_sdk2_result_key_tenum toint - Maintains compatibility with the native
int32_ttype - Resolves MarshalDirectiveException thrown by Mono runtime
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Rainer Sigwald (rainersigwald)
approved these changes
Sep 26, 2025
Giridhar Trivedi (giritrivedi)
commented
Sep 27, 2025
LGTM |
Giridhar Trivedi (giritrivedi)
commented
Sep 29, 2025
Can this be merged at the earliest ? S390X mono is seeing lot of failures due to this ... |
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Oct 5, 2025
This was referenced Oct 13, 2025
This was referenced Oct 20, 2025
This was referenced Apr 28, 2026
Closed
This was referenced May 5, 2026
This was referenced May 13, 2026
Closed
This was referenced Jun 2, 2026
This was referenced Jun 10, 2026
This was referenced Jul 2, 2026
This was referenced Aug 19, 2026
This was referenced Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This changes the array size type to 'int' so it matches the 'int32_t' native type.
This was typed as an enum.
The enum type is accepted by CoreCLR.
Mono throws a MarshalDirectiveException because it requires the array size to be an integral type.
Fixesdotnet/msbuild#12570.
Rainer Sigwald (@rainersigwald) ptal
cc Jan Kotas (@jkotas)Medha Tiwari (@medhatiwari)Giridhar Trivedi (@giritrivedi)