C # StructLayout.Explicit Question

Próbuję zrozumieć, dlaczego drugi przykład poniżej działa bez problemów, ale pierwszy przykład daje mi wyjątek poniżej. Wydaje mi się, że oba przykłady powinny dać wyjątek oparty na opisie. Czy ktoś może mnie oświecić?

Nieobsługiwany wyjątek: System.TypeLoadException: Nie można załadować typu „StructTest.OuterType” z zespołu ”StructTest, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null”, ponieważ zawiera pole obiektu o przesunięciu 0, które jest niepoprawnie wyrównane lub nakładające się przez pole inne niż obiekt.
w StructTest.Program.Main (String [] args) Naciśnij dowolny klawisz, aby kontynuować. . .

Przykład 1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace StructTest
{
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    struct InnerType
    {
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
        char[] buffer;
    }

    [StructLayout(LayoutKind.Explicit)]
    struct OuterType
    {
        [FieldOffset(0)]
        int someValue;

        [FieldOffset(0)]
        InnerType someOtherValue;
    }

    class Program
    {
        static void Main(string[] args)
        {
            OuterType t = new OuterType();
            System.Console.WriteLine(t);
        }
    }
}

Przykład 2

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace StructTest
{
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    struct InnerType
    {
        [MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)]
        char[] buffer;
    }

    [StructLayout(LayoutKind.Explicit)]
    struct OuterType
    {
        [FieldOffset(4)]
        private int someValue;

        [FieldOffset(0)]
        InnerType someOtherValue;

    }

    class Program
    {
        static void Main(string[] args)
        {
            OuterType t = new OuterType();
            System.Console.WriteLine(t);
        }
    }
}

questionAnswers(2)

yourAnswerToTheQuestion