Skip to content

Add support for converting structs into custom marshallers structs in Visual StudioΒ #81656

@Symbai

Description

@Symbai

With a .NET 7 project we can convert existing DllImport into LibraryImport, see screenshot below. This is a great feature. Unfortunately it does not convert structs into custom marshaller structs. As @AaronRobinsonMSFT mentioned those would provide the most ideal performance instead of using Marshal.PtrToStructure but also fixing errors we get after the conversion when a struct is used as parameter. Not everyone knows about custom marshaller structs or that they perform better. And not everyone knows how to rewrite their structs. It would be superior, just as with LibraryImport, if Visual Studio can do this for us. I was getting told to file out an issue here to requesting it. Background: #45100

Screenshots

image

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions