What does “Invalid managed/unmanaged type combination.” mean?

前端 未结 1 1349
孤街浪徒
孤街浪徒 2020-12-21 01:07

I have the following struct:

    [StructLayout(LayoutKind.Auto,Pack=0)]
    private unsafe struct BIRDSYSTEMCONFIG
    {
        public byte bySystemStatus;
         


        
相关标签:
1条回答
  • 2020-12-21 01:34

    Turns out all I needed to do was change:

    [StructLayout(LayoutKind.Auto,Pack=0)]
    

    To

    [StructLayout(LayoutKind.Sequential,Pack=0)]
    

    Since the question was about more than just how to solve it, I'll leave it open for a while. It'd be nice to find out a bit more about this error.

    0 讨论(0)
提交回复
热议问题