Skip to content

[Mono]: DllImport using MarshalAs(UnmanagedType.VBByRefStr) and CharSet = CharSet.Unicode not supported on Mono. #65698

Open

Description

@lateralusX

Description

Mono runtime currently fails to execute the following CoreCLR runtime tests:

Interop/StringMarshalling/VBByRefStr/VBByRefStrTest

The test fails since Mono marshaler won't handle MarshalAs(UnmanagedType.VBByRefStr) as Unicode when used in a DllImport together with CharSet = CharSet.Unicode, Mono always handles MarshalAs(UnmanagedType.VBByRefStr) as a LPSTR.

These tests have been marked as not supported on none Windows platforms have not been previously run on Mono. Issue detected when enabling CoreCLR runtime tests running on Mono Windows, #64281. As part of that PR, the tests have been disabled on Mono and marked with this issue for future tracking.

Reproduction Steps

Build and run individual runtime test on Windows Mono as described here, https://github.com/dotnet/runtime/blob/main/docs/workflow/testing/mono/testing.md

Expected behavior

Following tests should pass:

Interop/StringMarshalling/VBByRefStr/VBByRefStrTest

Actual behavior

Following tests fails and have been disabled due to this issue:

Interop/StringMarshalling/VBByRefStr/VBByRefStrTest

Regression?

No, this has never worked on Mono.

Known Workarounds

No response

Configuration

No response

Other information

No response

Activity

  1. ghost added
    untriagedNew issue has not been triaged by the area owner
    on Feb 22, 2022
  2. added this to the 8.0.0 milestone on Jul 14, 2022
  3. ghost removed
    untriagedNew issue has not been triaged by the area owner
    on Jul 14, 2022
  4. self-assigned this
    on Jul 27, 2023
  5. modified the milestones: 8.0.0, 9.0.0, Future on Jul 27, 2023
  6. removed their assignment
    on Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions