Skip to content

Specify SizeConst when marshalling field as ByValArray #36134

Description

@elinor-fung

When marshalling using UnmanagedType.ByValArray, the SizeConst field should be specified.

struct MyStruct
{
    [MarshalAs(UnmanagedType.ByValArray)]
    int[] Foo;
}

Category: Interoperability
Default: Enabled

cc @terrajobst @stephentoub @AaronRobinsonMSFT @jkoritzinsky

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-approvedAPI was approved in API review, it can be implementedarea-System.Runtime.InteropServicescode-analyzerMarks an issue that suggests a Roslyn analyzerhelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    Status
    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions